The Plesk auth log shows 14,000 failed logins against /login_up.php in the last 24 hours from 2,300 unique IPs. The panel itself enforces a per-session lockout, but the lockout cycles refresh every fifteen minutes and the attackers keep trying. fail2ban is on, but the only enabled jail is SSH. UFW is on, but it doesn’t know how to read Plesk’s /var/log/plesk/panel.log. The Plesk panel exposes its own firewall extension that is half-hearted at best. The combination that actually works on a production Plesk node is ConfigServer Firewall (CSF) as the outer layer, fail2ban (with all Plesk-specific jails) as the application-layer detector, and a handful of iptables rules below CSF for the patterns nothing else catches. Each tool layers — CSF on its own is not enough, fail2ban on its own is not enough.
What’s happening
A Plesk node sees three categories of unwanted traffic: brute-force on auth endpoints (/login_up.php, wp-login.php, IMAP/POP3, SMTP submission), spam relay attempts on Postfix, and exploit scans against known WordPress plugin URLs. UFW gives you a layer-4 filter only — it can open or close ports, but it cannot read application logs. CSF is a layer-4 filter with a per-port whitelist/blacklist plus a daemon (lfd) that reads logs and dynamically updates iptables. fail2ban is the same idea with a different vocabulary — a series of “jails” each tied to a log file, a regex pattern, and an action (typically iptables block). They overlap; running both is the standard configuration on a Plesk node and the small overhead is worth it because each catches things the other does not. CSF’s lfd catches malformed packet floods and is better at long-tail SSH brute-force; fail2ban has more granular per-service jails and integrates with the Plesk panel-specific log paths. iptables rules below both handle the cases neither tool models well — geographic blocks, ASN-level blocks, application-layer rate limits on specific URLs.
How to verify
CSF should be installed and the daemon running:
csf --version
systemctl status lfd
csf -l | head -40
CSF’s TESTING mode should be off in production (it auto-flushes rules every 5 minutes when on):
grep -E '^TESTING' /etc/csf/csf.conf
# TESTING = "0"
fail2ban should have the full set of Plesk-specific jails active:
fail2ban-client status
# Jail list: plesk-apache, plesk-apache-badbot, plesk-modsecurity, plesk-panel, plesk-postfix, plesk-proftpd, plesk-roundcube, plesk-wordpress, ssh
Each Plesk jail should be reading the right log file:
for jail in plesk-panel plesk-postfix plesk-roundcube plesk-wordpress; do
echo "=== ${jail} ==="
fail2ban-client get "${jail}" logpath
fail2ban-client status "${jail}"
done
Count current bans across all jails:
fail2ban-client banned | jq -r 'to_entries[] | "\(.key): \(.value | length)"'
If plesk-panel is missing or its log path is empty, the brute-force counter against the panel UI is not being enforced.
The fix
The layered hardening is: install CSF, configure CSF for the Plesk port set, wire CSF to fail2ban so they share the ban list, enable every Plesk fail2ban jail, drop in a handful of custom iptables rules for the patterns CSF and fail2ban don’t model.
1. Install ConfigServer Firewall
CSF is not in the distro repositories; install from the upstream tarball.
cd /usr/src
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
# Confirm CSF runs cleanly on this kernel
perl /usr/local/csf/bin/csftest.pl
# RESULT: csf should function on this server
2. Configure CSF for Plesk
Edit /etc/csf/csf.conf — the critical settings are the port list, lfd thresholds, and the testing flag.
# Open ports for Plesk
sed -i 's|^TCP_IN.*|TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,8443,8447"|' /etc/csf/csf.conf
sed -i 's|^TCP_OUT.*|TCP_OUT = "20,21,22,25,53,80,110,113,143,443,465,587,993,995,8443,8447"|' /etc/csf/csf.conf
sed -i 's|^UDP_IN.*|UDP_IN = "53"|' /etc/csf/csf.conf
sed -i 's|^UDP_OUT.*|UDP_OUT = "53,113,123"|' /etc/csf/csf.conf
# Disable testing mode (production)
sed -i 's|^TESTING = .*|TESTING = "0"|' /etc/csf/csf.conf
# Login Failure Daemon thresholds
sed -i 's|^LF_TRIGGER = .*|LF_TRIGGER = "5"|' /etc/csf/csf.conf # generic threshold
sed -i 's|^LF_SSHD = .*|LF_SSHD = "5"|' /etc/csf/csf.conf
sed -i 's|^LF_SSHD_PERM = .*|LF_SSHD_PERM = "0"|' /etc/csf/csf.conf # temp ban, not perm
sed -i 's|^LF_FTPD = .*|LF_FTPD = "10"|' /etc/csf/csf.conf
sed -i 's|^LF_SMTPAUTH = .*|LF_SMTPAUTH = "5"|' /etc/csf/csf.conf
sed -i 's|^LF_POP3D = .*|LF_POP3D = "10"|' /etc/csf/csf.conf
sed -i 's|^LF_IMAPD = .*|LF_IMAPD = "10"|' /etc/csf/csf.conf
sed -i 's|^LF_HTACCESS = .*|LF_HTACCESS = "10"|' /etc/csf/csf.conf
sed -i 's|^LF_MODSEC = .*|LF_MODSEC = "5"|' /etc/csf/csf.conf
# Block known bad ASNs / countries (optional, depends on traffic profile)
# sed -i 's|^CC_DENY = .*|CC_DENY = "CN,RU,KP"|' /etc/csf/csf.conf
# DDoS / SYN flood
sed -i 's|^SYNFLOOD = .*|SYNFLOOD = "1"|' /etc/csf/csf.conf
sed -i 's|^CT_LIMIT = .*|CT_LIMIT = "300"|' /etc/csf/csf.conf
sed -i 's|^PORTFLOOD = .*|PORTFLOOD = "22;tcp;5;300,80;tcp;100;5,443;tcp;100;5"|' /etc/csf/csf.conf
# Restart and start CSF
csf -r
systemctl enable --now csf lfd
csf -l | head -20
3. Wire CSF to fail2ban (they share the ban list)
CSF can be told to honor fail2ban’s bans by enabling its fail2ban integration:
sed -i 's|^X_ARF = .*|X_ARF = "1"|' /etc/csf/csf.conf
cat > /etc/fail2ban/action.d/csf.conf <<'ACTION'
[Definition]
actionban = csf -d <ip> "fail2ban-<name>"
actionunban = csf -dr <ip>
ACTION
# Tell fail2ban to use the CSF action for every jail
cat >> /etc/fail2ban/jail.local <<'JAIL'
[DEFAULT]
banaction = csf
JAIL
systemctl restart fail2ban
csf -r
4. Enable every Plesk fail2ban jail
Plesk’s panel-side fail2ban configuration ships with jail definitions but most are off by default. Enable them via the panel CLI:
plesk bin ip_ban --enable
for jail in \
ssh \
recidive \
plesk-panel \
plesk-apache \
plesk-apache-badbot \
plesk-modsecurity \
plesk-postfix \
plesk-proftpd \
plesk-roundcube \
plesk-wordpress; do
plesk bin ip_ban --enable-jails "${jail}" || true
done
# Set sensible thresholds
plesk bin ip_ban --update plesk-panel --period 600 --max-retries 3
plesk bin ip_ban --update plesk-wordpress --period 600 --max-retries 5
plesk bin ip_ban --update plesk-apache --period 600 --max-retries 6
systemctl restart fail2ban
fail2ban-client status
recidive is the long-tail jail: any IP that’s been banned by other jails repeatedly gets a long-term ban (default 1 week).
5. Custom iptables rules for cases neither tool models
A handful of rules CSF and fail2ban don’t model well — application-layer rate limits, geographic exceptions for office IPs, blocks on specific user-agents.
# Rate-limit POST to wp-login.php across all sites — 5 per minute per IP
iptables -I INPUT -p tcp --dport 443 -m string --string "POST /wp-login.php" --algo bm \
-m recent --set --name wplogin --rsource
iptables -I INPUT -p tcp --dport 443 -m string --string "POST /wp-login.php" --algo bm \
-m recent --update --seconds 60 --hitcount 6 --name wplogin --rsource -j DROP
# Always allow the office IP regardless of what CSF/fail2ban think
csf -a 198.51.100.42 "Office IP — never ban"
# Always block this ASN range (example only — replace with real ranges)
csf -d 192.0.2.0/24 "Known scanner range"
# Persist iptables custom rules across reboot
iptables-save > /etc/iptables/rules.v4
CSF’s own /etc/csf/csf.allow and /etc/csf/csf.deny are the same data persisted across reboots; the csf -a and csf -d commands write them.
6. Block authenticated-only endpoints from the public internet
If your panel only needs to be reachable from the office, restrict :8443 and :8447 to a CIDR allowlist:
# Remove the public allow for 8443/8447
csf -ar 8443
csf -ar 8447
# Allow only the office + ops CIDR
csf -a 198.51.100.0/24 "Panel access — office"
csf -a 203.0.113.10 "Panel access — ops VPN exit"
# Restart CSF
csf -r
After this, every connection to :8443 from outside the allowlist is dropped at the firewall before Plesk even sees it — the brute-force count on plesk-panel drops to near zero overnight.
7. Daily reporting
CSF and fail2ban each have status outputs that can be mailed daily:
cat > /etc/cron.d/firewall-daily <<'CRON'
0 7 * * * root /usr/local/bin/plesk-firewall-report.sh
CRON
cat > /usr/local/bin/plesk-firewall-report.sh <<'SCRIPT'
#!/usr/bin/env bash
{
echo "=== CSF banned IPs (count) ==="
csf -l | grep -c DROP
echo
echo "=== CSF top 20 banned this week ==="
grep "lfd:" /var/log/lfd.log | awk '/Blocked/ {print $NF}' | sort | uniq -c | sort -rn | head -20
echo
echo "=== fail2ban current bans ==="
fail2ban-client banned
echo
echo "=== Top fail2ban offenders this week ==="
zgrep -h "Ban" /var/log/fail2ban.log* | awk '{print $NF}' | sort | uniq -c | sort -rn | head -20
} | mail -s "Plesk firewall daily — $(hostname -s) — $(date +%F)" oncall@example.com
SCRIPT
chmod 700 /usr/local/bin/plesk-firewall-report.sh
The daily mail is the on-call’s morning sanity check. A sudden jump in banned IPs is either a brute-force wave (expected, fail2ban is doing its job) or a misconfiguration in the jail regex (unexpected, investigate).
Layered firewalling on Plesk is a CSF + fail2ban + iptables sandwich, not a single tool. Keep the configuration in version control, run the daily report, and the panel’s brute-force surface stops being a 3 AM page.
Run Plesk under Stack Harbor’s Monitoring + Support with firewall posture audits, fail2ban regex review, and 24x7 escalation on brute-force surges — or start with a security review of your existing Plesk fleet.