WAF Not Working? Learn How to Troubleshoot

If the cPFence Web Application Firewall (WAF) is not functioning as expected, follow these 5 troubleshooting steps to diagnose and resolve the issue. These steps apply to servers running LiteSpeed, OpenLiteSpeed, Apache, or Nginx.

How to Tell If Your WAF Is Working

Before troubleshooting, you should confirm whether the WAF is active and enforcing rules. The easiest way is to use the built-in WAF testing tool. It simulates an attack and checks if it's blocked.

Visit this guide to learn how to use the test:

https://my.cpfence.app/knowledgebase/17/How-to-Use-the-cPFence-WAF-Testing-Tool-.html

1. Check Your Web Server Error Logs

Start by reviewing your web server’s error logs to identify any WAF-related issues:

  • LiteSpeed/OpenLiteSpeed:
    tail -n 50 /usr/local/lsws/logs/error.log
  • Apache:
    tail -n 50 /var/log/apache2/error.log
  • Nginx:
    tail -n 50 /var/log/nginx/error.log

These logs can help identify configuration issues, rule errors, or permission problems.

2. Restart the Web Server

Restart your web server to reload the WAF configuration:

  • LiteSpeed/OpenLiteSpeed:
    systemctl restart lshttpd.service
  • Apache:
    systemctl restart apache2.service
  • Nginx:
    systemctl restart nginx.service

3. Run the cPFence Cron Job

cPFence uses a scheduled cron job to keep rules and configurations updated. Running it manually may resolve your issue:

/opt/cpfence/app/cpfcron

Once complete, re-test the WAF to see if the issue is resolved.

4. Restart cPFence

If the WAF is still not working correctly, restart the cPFence engine:

cpfence --restart

5. Still Not Working?

If the issue persists after following the steps above, please contact our support team so we can investigate further.


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.

 

  • 0 Kunder som kunne bruge dette svar
Hjalp dette svar dig?

Relaterede artikler

Why my custom WAF rules are not working?

If your custom ModSecurity rules aren’t taking effect, it’s often due to duplicate rule IDs or...

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

How to Enable / Disable WAF Rule by ID ?

This guide provides instructions for enabling and disabling specific WAF (Web Application...

How to Enable / Disable WAF?

The cPFence Web Application Firewall (WAF) now fully supports Apache, Nginx, OLS, and LSWS web...

How to Identify Problematic WAF Rule IDs in cPFence?

New! You can now use an automatic tracking tool to identify problematic WAF rules in real time....