Allow me

So, like many of us, I have multiple servers each with multiple websites. The server-wide setting for ModSecurity is
On (Enabled). The server-wide setting for fail2ban is checked for
Enable intrusion detection with plesk-modsecurity jail
Active.
I have a website that is having trouble with some false positives. So, in Plesk, I have gone to ModSecurity in that domain's card and selected
Detection Only.
However, fail2ban's default ModSecurity jail filter appears so basic that it does not distinguish between sites that are
Engine-Mode: "ENABLED" or
Engine-Mode: "DETECTION_ONLY".
Code:
[Definition]
failregex = ^(?:\[.*?\]\s\S*)\s<HOST>\s
ignoreregex = ^\[.*?\]\s\S*\s<HOST>\s.*\s\1
If Plesk expects that ModSecurity should work in conjunction with fail2ban and vice versa, and in the UI it gives the option to make a ModSecurity custom change per domain, then it should also provide the ability to make a custom change per domain for fail2ban (e.g. disable jails per domain). If that is not possible, then it should
at the very least inform the user of such a situation and strive to improve fail2ban's supplied ModSecurity jail filter to ignore sites in
Detection Only mode.
Granted,
/var/log/modsec_audit.log is a rather complex logfile to analyse and regex
Unless I'm mistaken, the only workaround at present seems to be to disable in fail2ban server-wide the ModSecurity jail or ease its ban period/attempts while you learn what one or two sites is triggering false positives
Plesk Obsidian 18.0.79
OS: various RHEL flavours and versions.