• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Resolved can not add new filter to fail2ban

Brujo

Silver Pleskian
Plesk Guru
I am not able to add a new filter to fail2ban

if I go in plesk panel to: Home > Tools & Settings >IP Address Banning > Jails > managing Filters > add filter > type in name & filtercontent and save I get "Information: The jail filter was added". But i can not see the new added filter in the Plesk Filter List (still just the 12 Filters in the list).

On the filesystem > /etc/fail2ban/filter.d/ i can see the new file but with the extension .local - usulay the file is named like xyz.conf

the output of /usr/local/psa/admin/sbin/f2bmng --get-filters-list
[["apache-auth", "fail2ban"], ["apache-badbots", "fail2ban"], ["apache-common", "fail2ban"], ["common", "fail2ban"], ["plesk-courierlogin", "plesk-fail2ban-configurator"], ["plesk-dovecot", "plesk-fail2ban-configurator"], ["plesk-horde", "plesk-fail2ban-configurator"], ["plesk-panel", "plesk-fail2ban-configurator"], ["plesk-qmail", "plesk-fail2ban-configurator"], ["plesk-roundcube", "plesk-fail2ban-configurator"], ["postfix-sasl", "fail2ban"], ["proftpd", "fail2ban"], ["recidive", "fail2ban"], ["sshd", "fail2ban"], ["test", null]]

test is the name i choosed for the new filter and it seems the second field has "null"

any hint ?
 
Last edited:
The "local" extensions are used to specify non-global settings.

Please read the README file in /etc/fail2ban/ :

...
You may copy required ones into /etc/fail2ban changing file extension from
.conf to .local. Configuration sections with jail definitions from jail.conf
should be copied to jail.local instead.

Please note that all local customizations should be done in .local files.

Please make sure, that you define a new jail as well for the new filter to work. To test a new jail configuration, before activating, you might use "fail2ban-regex" ( example from the command line: "fail2ban-regex /path/to/logfile /etc/fail2ban/filter.d/yourfilter.conf" or "fail2ban-regex /path/to/logfile /etc/fail2ban/filter.d/yourfilter.local".
 
Last edited by a moderator:
Hi,

Apologies for resurrecting an old thread.

I've got the same problem here -
@UFHH01 - I've tried following what you said but still it does not list.

The readme says copy and change from .conf to .local. However, the file gets created as .local Nonetheless I copy the file to /etc/fail2ban.

I run the test regex and it parses ok - finds 880 hits.

I cannot see the filter showing in plesk though.

I manually edit the jail.conf file and the jail shows in plesk but is not working.

How can I get my filter to show in the list?

Thanks

plesk is web admin edition, all up to date on centos 7
 
Back
Top