How to Automate Blocking with Online IP Blacklists in cPFence?

cPFence provides a robust IP Database (IPDB) that dynamically adapts to new threats by updating hourly. This ensures your server is protected against the latest malicious activity. You can view the current number of entries in the IPDB and verify its hourly updates using the following command:

sudo ipset list | grep -E "Name:|Number of entries:"

These IPs are updated hourly with the latest protection from our dynamic network, and you’ll notice the number of IPs changing every single hour as our system dynamically adapts to new threats. If any IP on a cPFence-protected server is detected as malicious, our IPDB is automatically updated to keep all clients secured.

Adding a Custom List of IPs

Our IPDB is already the largest in the market and outperforms similar security products. However, If you’d like to add more custom lists, you can do so using this command:

cpfence --bulk-blacklist-ip https://yoursite.com/your_custom_black_list.txt

Replace https://yoursite.com/your_custom_black_list.txt with the URL of your custom IP list. This command will download the file, validate its contents, and blacklist the specified IPs.

Automating the Process with Cron Jobs

To keep your custom blacklist updated automatically, you can schedule this process using a cron job. Here’s an example cron job to update the blacklist every hour:

0 * * * * /usr/local/bin/cpfence --bulk-blacklist-ip https://yoursite.com/your_custom_black_list.txt > /dev/null 2>&1

This cron job will run hourly, ensuring the latest IPs from your online blacklist are always added to your server’s protection.

Ensuring File Compatibility

Make sure your custom IP list is in Unix format. If the file is in Windows format, convert it using the following command:

dos2unix /path/to/custom_blacklist.txt

This ensures that cPFence can properly process and apply the blacklist without issues.

 


Need Further Assistance?

If you encounter any issues or need additional help, feel free to reach out to our support team via your client portal.

  • 1 Korisnici koji smatraju članak korisnim
Je li Vam ovaj odgovor pomogao?

Vezani članci

How to use cPFence IPDB / DDoS Module ?

cPFence provides robust tools for managing IP databases (IPDB) and protecting against DDoS...

How to Whitelist / Blacklist a Full Country ?

This guide explains how to whitelist or blacklist entire countries in cPFence. You can manage...

How to Whitelist / Blacklist an IP ?

This guide explains how to manage IP addresses by adding them to the whitelist or blacklist in...

How to Fix Bulk IP Blacklisting or Whitelisting Issues in cPFence?

If you're facing issues when attempting to bulk blacklist or whitelist IPs in cPFence, the most...

How to Check the Status of an IP in cPFence?

cPFence allows you to quickly check the current state of an IP address to see if it has been...