# WAF/ModSecurity
The WAF/ModSecurity tab allows you to configure ModSecurity, a powerful Web Application Firewall (WAF) that protects your WordPress instances from common web attacks.
# Prerequisites
- Admin access to the PanelAlpha interface and the Engine server's management pages.
- ModSecurity compiled into the web server running on the Engine (LiteSpeed, Apache, or Nginx).
# Overview
ModSecurity is an open-source web application firewall that:
- Monitors HTTP/HTTPS traffic in real time
- Protects against common web vulnerabilities (SQL injection, XSS, etc.)
- Uses rule sets to detect and block malicious requests
- Provides detailed audit logging for security analysis
# ModSecurity Mode
ModSecurity can operate in three different modes:
# Off
- ModSecurity is completely disabled.
- No traffic inspection or protection.
- Use only for troubleshooting or testing.
Warning: Setting the mode to Off disables all WAF protection.
# Detection Only
- ModSecurity monitors traffic and logs potential threats.
- Does not block suspicious requests.
- Useful for testing rule sets without impacting users.
- Recommended when first implementing ModSecurity.
# Blocking
- ModSecurity actively blocks malicious requests.
- Full protection enabled.
- May require rule tuning to prevent false positives.
- Recommended for production environments after testing.
To change modes: select the desired mode in the dropdown menu and the system will apply the change immediately.
# Rule Sets
The Rule Sets section displays all available ModSecurity rule sets and their status:
# OWASP Core Rule Set
The primary rule set displayed:
- Rule Set — name of the rule collection (for example, "OWASP Core Rule Set")
- Loaded Config Files — number of rules loaded versus total available (for example,
26 / 26) - Enabled — toggle switch to enable or disable the entire rule set
OWASP Core Rule Set provides:
- Protection against OWASP Top 10 vulnerabilities
- SQL injection detection
- Cross-site scripting (XSS) prevention
- Local/remote file inclusion blocking
- Command injection protection
- Session fixation prevention
For upstream details, see the OWASP Core Rule Set (opens new window) project.
# Managing Rule Sets
To enable or disable a rule set:
- Toggle the switch in the Enabled column.
- The change is applied immediately.
- Monitor your audit logs to verify effectiveness.
Note: Disabling rule sets reduces your security protection. Only disable rules if they cause legitimate traffic to be blocked.
# Adjusting Loaded Config Files
Each rule set row includes a link on the Loaded Config Files count. Click the link to open the Loaded Config Files modal, which lists every ModSecurity config file (enabled files are pre-checked):
- Uncheck a file to temporarily disable it without toggling the main rule set.
- Check a file to re-enable it.
- Save the changes; the UI immediately reflects the new set of loaded configs.
This modal is the only way to selectively disable individual rule files while keeping the rule set enabled.
# Audit Log Files
The Audit Log Files section shows detailed logs of ModSecurity activity:
# Log Information
Each audit log entry displays:
- File name — log file identifier (for example,
audit.log) - Last Modified — how long ago the log was last updated (for example, "8 days ago")
- Size — file size in MB (for example, "1.33 MB")
- Actions:
- [download] — download the log file for offline analysis
- [preview] — view log contents directly in the browser
# Viewing Audit Logs
Audit logs contain detailed information about:
- Blocked requests
- Request headers and parameters
- Triggered rules
- Client IP addresses
- Timestamps
- Response actions taken
Example log entry:
[[DATE]:10:23:45 +0000] 192.168.1.50 - -
"GET /wp-admin/admin-ajax.php?action=../../../etc/passwd HTTP/1.1"
Rule 950000: Directory Traversal Attack
Action: Blocked
# Managing Audit Logs
- Download logs regularly for archival and analysis.
- Review logs to identify attack patterns.
- Tune rules based on false positives found in logs.
- Monitor size — large log files may indicate high attack volume.
# Configuration Best Practices
# Initial Setup
Start with Detection Only mode.
- Enable ModSecurity in Detection Only mode.
- Monitor logs for 1–2 weeks.
- Identify any false positives.
Review Audit Logs.
- Download and analyze audit logs.
- Look for legitimate requests being flagged.
- Create exceptions if needed.
Switch to Blocking Mode.
- After confirming no false positives.
- Enable Blocking mode.
- Continue monitoring logs.