Systems Tuning
Fail2ban Jails for SSH, CloudPanel 8443, wp-login & xmlrpc
Combine nftables Fail2ban jails with CloudPanel Nginx error/access log filters to ban distributed wp-login and SSH brute-force hosts automatically.
nftables Drop · 5-Strike 24h Ban · Zero PHP Auth Overhead
Wildcard Log Monitoring Across All Tenant Directories
Configure logpath = /home/*/logs/nginx/access.log inside jail.local so newly added CloudPanel sites inherit wp-login brute-force protection automatically without editing Fail2ban per tenant.
Whitelisting Cloudflare IPs When Behind Proxy
Ensure set_real_ip_from is active in Nginx before enabling Fail2ban HTTP jails so Fail2ban bans the attacker IP in CF-Connecting-IP rather than a Cloudflare edge node.
Measured Parameters & CloudPanel Stack Directives
| Fail2ban Jail | Log Source / Filter | Ban Threshold |
|---|---|---|
| sshd | systemd journal / auth.log | 3 failures in 10m -> 24h nftables ban |
| wp-login-flood | /home/*/logs/nginx/access.log (POST 200) | 6 POSTs to wp-login.php in 2m -> 12h ban |
| nginx-botsearch | 404 scanner paths (.env, wp-config.bak) | 8 hits in 2m -> 24h ban |
| SSH Key-Only Auth | PasswordAuthentication no | Eliminates SSH credential guessing permanently |