• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question ModSecurity & Fail2Ban w/ Plesk Subscription behind proxy server

rowingpeter_s

New Pleskian
ModSecurity and Fail2Ban are working well, however, we have one plesk subscription that sits behind a separate proxy server so the Real-IP that is recorded in modsec_audit.log is the IP address of the proxy server. As a result, it is the proxy server [rather than requesting client] that is being banned when ModSecurity rules are triggered.

The ModSecurity log contains both

X-Real-IP: 31.3.246.xxx
X-Forwarded-For: 41.13.216.yyy

We really want to configure so requests are blocked when the "X-Forwarded-For: 41.13.216.yyy" header is present.

It looks as though this could be quite a simple adjustment to the default filters/jails that are provided with Plesk Onyx. Looking for help with how to achieve this.
 
This explains a generic approach very well but it would be great to know if there is a simpler / tried and tested way to apply within Plesk.

Fail2Ban Behind A Proxy/Load Balancer – Centos.Tips

I had thought that it wouldn't be possible as IPTables would only ban the IP address of the proxy. The CentOS article suggests with Packet Inspection we can look for an X-Forwarded-For header and the relevant IP address in the packet and then drop it.
 
Back
Top