Skip to content

Plesk Obsidian security hardening — fail2ban, ModSecurity, panel access controls

A defensible Plesk install is not the install Plesk ships. Here is the hardening checklist that survives an audit and the commands to apply it.

You inherit a Plesk Obsidian server that’s been running for two years. The previous admin left no documentation. You SSH in, run a few baseline checks, and find: panel admin password hasn’t been rotated, fail2ban is enabled but only with the default psa-fail2ban jail, ModSecurity is installed but no ruleset is active, OUTBOUND mail is not rate-limited, SSH still allows password auth, and the panel is exposed on :8443 to the entire internet. None of these are red-alarms on their own. Together they’re a checklist of “things that get pointed at during a breach post-mortem”. This is the hardening pass that closes them out before the post-mortem.

What’s happening

Plesk’s install profile is “make it work out of the box on a wide range of customer environments.” That’s the right default for first-boot. It’s not the right configuration for a host serving real customers two years in. The hardening areas:

  1. Authentication. Panel admin, FTP, mail. Each has its own credential model. Each can be configured to require strong creds, MFA where possible, and to lock accounts after failure thresholds.
  2. Network exposure. Panel ports (:8443, :8447), FTP, SSH, mail submission. The default exposure is “open to the world”. The audit-defensible posture is “open only to known operator IPs and customer IPs as needed.”
  3. WAF. ModSecurity ships with Plesk but the rulesets are opt-in. Without OWASP CRS active, you have a placebo.
  4. Brute-force prevention. fail2ban is the right tool. It needs jails for every authentication surface, not just one.
  5. Mail abuse. Outbound rate limits prevent a single compromised mailbox from cascading into an IP blacklist.
  6. Patching cadence. Automatic security updates for the OS, scheduled panel updates that don’t break mail at 03:00, and a documented rollback path.
  7. Logging and retention. All authentication events go somewhere durable, with enough retention to investigate a breach that’s discovered 90 days later.

How to verify

Audit the current state across each area.

Authentication:

# Panel admin account age
plesk db -Ne "SELECT login, locked, pwd_expiration_change_time FROM cp_access \
  WHERE login='admin'"

# Force password rotation if older than 90 days
plesk bin admin --update -passwd "$(openssl rand -base64 24)"

# SSH config
grep -E 'PermitRootLogin|PasswordAuthentication|PubkeyAuthentication' /etc/ssh/sshd_config

Network exposure:

# What's listening to the internet
ss -lntp
# Cross-reference against firewall rules
firewall-cmd --list-all   # RHEL/Alma
ufw status verbose         # Ubuntu

# Panel port is :8443 — confirm it's restricted
firewall-cmd --info-zone=public 2>/dev/null | grep ports

WAF:

# Is ModSecurity loaded?
httpd -M 2>/dev/null | grep security
# Is a ruleset active?
ls /etc/httpd/conf.d/modsecurity.d/
grep -r 'SecRuleEngine' /etc/httpd/conf.d/modsecurity.d/

fail2ban:

fail2ban-client status
fail2ban-client status sshd   # detailed per-jail
fail2ban-client status plesk-postfix

Mail rate limit:

plesk bin server_pref --get | grep -i 'limit\|outgoing'

Patching:

# OS auto-updates
systemctl is-active dnf-automatic.timer   # RHEL
systemctl is-active unattended-upgrades   # Ubuntu

# Plesk auto-update setting
plesk bin server_pref --get-update-settings

The fix

Apply the hardening pass in seven steps. Each is independent — apply one at a time and verify before continuing.

Step 1 — Authentication

Force panel admin password rotation and enable session timeout:

# Rotate panel admin password (store in secrets manager, not in /root/)
NEW_ADMIN_PW=$(openssl rand -base64 24)
plesk bin admin --update -passwd "$NEW_ADMIN_PW"
echo "$NEW_ADMIN_PW" > /root/admin-pw-$(date +%Y%m%d).txt
chmod 600 /root/admin-pw-$(date +%Y%m%d).txt
# Then move this file off-host into your secrets manager

# Session timeout (default is unlimited — fix that)
plesk bin server_pref --update -session-idle-timeout 1800
plesk bin server_pref --update -session-life-time 28800

Disable SSH password auth:

sed -i 's|^[#[:space:]]*PasswordAuthentication.*|PasswordAuthentication no|' /etc/ssh/sshd_config
sed -i 's|^[#[:space:]]*PermitRootLogin.*|PermitRootLogin prohibit-password|' /etc/ssh/sshd_config
sshd -t && systemctl restart sshd

Enable Plesk’s 2FA where the panel supports it (current Obsidian has Google Authenticator TOTP):

plesk bin extension --install plesk-2fa
# Then enable in: panel → My Profile → Two-Factor Authentication

Step 2 — Network exposure

Restrict the panel port to known operator IPs:

# RHEL/Alma firewalld
firewall-cmd --permanent --remove-port=8443/tcp
firewall-cmd --permanent --remove-port=8447/tcp
firewall-cmd --permanent --new-zone=panel-allowed 2>/dev/null
for IP in 203.0.113.10 203.0.113.11; do
  firewall-cmd --permanent --zone=panel-allowed --add-source=$IP
done
firewall-cmd --permanent --zone=panel-allowed --add-port=8443/tcp
firewall-cmd --permanent --zone=panel-allowed --add-port=8447/tcp
firewall-cmd --reload

# Ubuntu ufw
ufw delete allow 8443
ufw delete allow 8447
for IP in 203.0.113.10 203.0.113.11; do
  ufw allow from $IP to any port 8443
  ufw allow from $IP to any port 8447
done
ufw reload

If you have customers who need panel access from arbitrary IPs, this is the wrong play — use a VPN or a bastion-proxy instead. Don’t punch holes per customer IP.

FTP: prefer SFTP-only. Disable plain FTP if no customer requires it:

plesk bin server_pref --update -ftps-only true
plesk bin server_pref --update -ftp-disable true
systemctl restart xinetd  # or vsftpd, depending

Step 3 — WAF (ModSecurity + OWASP CRS)

Plesk includes a ModSecurity ruleset selector. Enable it via the panel or CLI:

# Set ModSecurity to on with the OWASP CRS ruleset
plesk bin server_pref --update -modsecurity-rule-set tortix
# Other ruleset options: atomicbasic, atomic, comodo (commercial), owasp

plesk sbin modsecurity_ctl --enable
plesk bin server_pref --update -modsecurity-rule-engine on

# Confirm
grep SecRuleEngine /etc/httpd/conf.d/modsecurity.conf

CRS in SecRuleEngine On mode will produce false positives on legitimate traffic. Tune by domain rather than disabling globally:

# Per-domain whitelist for a specific rule ID that's blocking legit traffic
mkdir -p /etc/httpd/conf.d/modsecurity.d/per-domain
cat > /etc/httpd/conf.d/modsecurity.d/per-domain/example.com-rules.conf <<'EOF'
<LocationMatch "/wp-admin/admin-ajax.php">
  SecRuleRemoveById 942100 942110 942120
</LocationMatch>
EOF
plesk bin http_server --reconfigure-all

Step 4 — fail2ban

Plesk Obsidian’s Tools & Settings → IP Address Banning is the panel-level fail2ban manager. Enable all standard jails:

plesk bin ip_ban --enable

# Confirm jails active
fail2ban-client status

# Typical jails you want on:
# - plesk-panel       (panel login brute force)
# - plesk-postfix     (SMTP auth brute force)
# - plesk-dovecot     (IMAP/POP auth brute force)
# - plesk-proftpd     (FTP brute force)
# - plesk-roundcube   (webmail brute force)
# - plesk-apache      (404 scanner detection)
# - plesk-modsecurity (WAF alert escalation)
# - ssh-iptables      (SSH brute force)

Add a custom jail for unusual outbound SMTP volume — useful as a tripwire when a mailbox gets compromised:

cat > /etc/fail2ban/filter.d/plesk-outbound-spam.conf <<'EOF'
[Definition]
failregex = ^.*pickup.*from=<.*@<HOST>>.*size=\d+,.*$
ignoreregex =
EOF

cat > /etc/fail2ban/jail.d/outbound-spam.local <<'EOF'
[plesk-outbound-spam]
enabled = true
filter = plesk-outbound-spam
logpath = /var/log/maillog
maxretry = 200
findtime = 600
bantime = 3600
action = iptables-multiport[name=outbound-spam, port="25,587", protocol=tcp]
EOF

systemctl restart fail2ban

Step 5 — Mail rate limit

Limit per-mailbox outbound to prevent a single compromised account from cascading into RBL:

# Server-wide default
plesk bin server_pref --update \
  -outgoing-email-mode-server max-per-user \
  -outgoing-email-limit-from-user 100

# Per-subscription override for higher-volume legitimate senders
plesk bin domain --update bulk-mail.example.com -outgoing-messages-mbox-limit 5000

Step 6 — Patching

OS auto-updates for security:

# RHEL/Alma
dnf -y install dnf-automatic
cat > /etc/dnf/automatic.conf <<'EOF'
[commands]
upgrade_type = security
random_sleep = 900
download_updates = yes
apply_updates = yes
[emitters]
emit_via = stdio
EOF
systemctl enable --now dnf-automatic.timer

# Ubuntu
apt -y install unattended-upgrades
dpkg-reconfigure -plow unattended-upgrades

Plesk auto-update — security only, not feature updates:

plesk bin server_pref --update \
  -release-tier release \
  -update-installation-mode auto-security \
  -panel-update-schedule '03:00'

Step 7 — Logging retention

Plesk’s default log retention is short — /usr/local/psa/var/log/ rotates with logrotate’s defaults. Extend:

cat > /etc/logrotate.d/plesk-retention <<'EOF'
/usr/local/psa/var/log/maillog
/usr/local/psa/var/log/panel.log
/var/log/secure
/var/log/auth.log
{
    rotate 90
    daily
    compress
    delaycompress
    missingok
    notifempty
}
EOF
logrotate -d /etc/logrotate.d/plesk-retention

For audit-grade retention, ship logs off-box to a separate log host or a managed log service (rsyslog forwarding, or filebeat/fluent-bit to a SIEM).

Post-hardening audit

Run all the verification commands again. Each should show the hardened state. Save the output as a baseline so future audits can diff against it.

mkdir -p /root/security-baselines
DATE=$(date +%Y%m%d)
ss -lntp > /root/security-baselines/listening-ports-$DATE.txt
fail2ban-client status > /root/security-baselines/fail2ban-$DATE.txt
firewall-cmd --list-all-zones > /root/security-baselines/firewall-$DATE.txt 2>/dev/null
plesk bin server_pref --get > /root/security-baselines/plesk-prefs-$DATE.txt

Stack Harbor runs Plesk security hardening as part of environment management — with a quarterly review against this baseline and remediation tickets for drift. Pair it with monitoring and support so fail2ban events and ModSecurity alerts flow to the on-call rotation, not nobody. Contact us if you’re inheriting a fleet and need a fast hardening pass.