How to Block or Whitelist Certain User Agents ?

This guide will help you block or whitelist specific user agents in cPFence. You can manage these settings easily and ensure they are preserved across cPFence updates.

Step 1: Edit the User Agent Files

To block or whitelist user agents, you need to edit the following files:

 

  • For Blacklisting: /opt/cpfence/app/cpfwaf/userdata_bl_agents
  • For Whitelisting: /opt/cpfence/app/cpfwaf/userdata_wl_agents

 

Add the user agents you want to block or whitelist in the respective files. Each user agent should be on a new line.

Step 2: Apply Your Changes

 

After editing the files, you need to disable and re-enable the Web Application Firewall (WAF) to apply your changes. Run the following commands in your terminal:

 

cpfence --disable-ols-waf
cpfence --enable-ols-waf

 

This will ensure that your changes take effect immediately.

Notes

  • The changes will be preserved even after updating cPFence.
  • whitelist useragent, blacklist useragent
  • 18 Korisnici koji smatraju članak korisnim
Je li Vam ovaj odgovor pomogao?

Vezani članci

How to Enable / Disable WAF Rule by ID ?

This guide provides instructions for enabling and disabling specific WAF rules in cPFence for...

How to Enable / Disable WAF?

This guide provides simple instructions for enabling and disabling the Web Application Firewall...

How to Stop XML-RPC Attacks Server-Wide Using the cPFence WAF?

Important Note: Recommended Method to Block XML-RPC We’ve introduced a new and improved method...

How Does cPFence Handle Bots? Customize Your Bot Protection

cPFence currently detects and blocks over 1000 different bots, helping to reduce server load and...

WAF Not Working? Learn How to Troubleshoot

If the cPFence Web Application Firewall (WAF) is not functioning as expected, follow these...