![]() |
|
Guide CyberPanel ModSecurity + OWASP Rules: It Said Enabled, but Blocked Nothing - Printable Version +- AdminsForum (https://adminsforum.com) +-- Forum: Free & open-source control panels (https://adminsforum.com/Forum-free-open-source-control-panels) +--- Forum: CyberPanel (https://adminsforum.com/Forum-cyberpanel) +---- Forum: CyberPanel Guides & Tutorials (https://adminsforum.com/Forum-cyberpanel-guides-tutorials) +----- Forum: CyberPanel Getting Started Guides (https://adminsforum.com/Forum-cyberpanel-getting-started-guides) +----- Thread: Guide CyberPanel ModSecurity + OWASP Rules: It Said Enabled, but Blocked Nothing (/Thread-guide-cyberpanel-modsecurity-owasp-rules-it-said-enabled-but-blocked-nothing) |
CyberPanel ModSecurity + OWASP Rules: It Said Enabled, but Blocked Nothing - JAY - 10-26-2026 CyberPanel ModSecurity + OWASP Rules: It Said Enabled, but Blocked Nothing CyberPanel 3.0 has a one-click ModSecurity web application firewall (WAF) with the OWASP Core Rule Set. On our test server both switches turned green, the panel said "Operation successful", and SQL injection, XSS and path traversal requests still went straight through to WordPress. The module wasn't even loading. Here is how to test your WAF properly, what was broken, and the fix that made it block attacks. If you came here looking for CSF: CyberPanel 3.0 doesn't offer it any more. The old Code: /firewall/csfStep 1: Test before you change anything A WAF you haven't tested is a guess. We used a tiny shell function that prints the HTTP status for a request against our WordPress site: Code: W=https://yourdomain.com
T(){ curl -s -o /dev/null -w "$1 %{http_code}\n" "$W/?$2"; }
T sqli 'id=1%27%20OR%201=1--'
T lfi 'f=../../../../etc/passwd'
T xss 'q=%3Cscript%3Ealert(1)%3C/script%3E'Code: sqli 200
lfi 200
xss 200Use a new parameter name or value for each test run (we used Code: idCode: uidCode: kCode: rStep 2: Install ModSecurity in the panel Open Security > ModSecurity ( Code: https://YOUR-SERVER-IP:8090/firewall/modSecurityClick Install ModSecurity. After a few seconds the configuration page appeared with the engine, audit log and rule engine all switched on: Step 3: Turn on the OWASP rules Open Security > Rule Packs ( Code: /firewall/modSecRulesPacksCode: /usr/local/lsws/conf/modsec/owasp-modsecurity-crs-3.0-master/Then we ran the tests again. Still 200, 200, 200. Nothing was blocked. Step 4: Check whether the module actually loads The panel can't tell you this. The web server's error log can: Code: grep -i 'mod_security' /usr/local/lsws/logs/error.log | tail -3Code: Failed to load module [mod_security], error: libyajl.so.2: cannot open shared object file: No such file or directoryCode: apt-get install -y libyajl2
systemctl restart lswsCode: Failed to load module [mod_security], error: /usr/local/lsws/modules/mod_security.so: undefined symbol: pcre_freeCode: libpcre3Code: mod_security.soCode: mod_security.so.backup.<number>Code: cd /usr/local/lsws/modules
ls -l mod_security.so*
cp mod_security.so /root/mod_security.so.cyberpanel
cp mod_security.so.backup.* mod_security.so
systemctl restart lsws
grep -i 'mod_security' /usr/local/lsws/logs/error.log | tail -2Code: *Code: [Module: mod_security mod_security 1.4] has been initialized successfullyStep 5: Test again With new parameter names, so no cached answers:
Code: grep -o 'id "[0-9]*"' /usr/local/lsws/logs/auditmodsec.log | sort | uniq -c | sort -rnRule Code: 949110Code: 942100Code: 941xxxCode: 99999Code: ../Code: /usr/local/lsws/conf/modsec/rules.confCode: 920440Code: 930130Code: /.svn/wc.dbCode: /.ssh/id_rsaCode: /backup.sqlCode: /wp-config.phpBefore you leave it on
Quick check after any change Code: grep -i 'mod_security' /usr/local/lsws/logs/error.log | tail -1
T test$RANDOM 'x=../../../../etc/passwd'More CyberPanel guides
Tested on CyberPanel 3.0 (build 8, OpenLiteSpeed edition) on Ubuntu 24.04, October 2026. Menu names can change slightly between versions. |