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 Users Found This Useful
Was this answer helpful?

Related Articles

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...

Why cPFence May Not Block Certain Connections?

cPFence is designed to intelligently handle incoming traffic and block malicious or abusive...

Am I Under a DDoS Attack? I See Hundreds of GET Requests in the Logs

Read Also: How to Address High Server Load Issues with cPFence? If you're noticing hundreds of...

Why Does a Whitelisted IP Still Appear in cPFence Stats?

If you’ve whitelisted an IP in cPFence but it still appears in the statistics, there’s no need to...

Does cPFence Fully Support IPv6 Security?

Yes, cPFence fully supports IPv6, unlike many competitors that either lack IPv6 support entirely...