Nouvelle régles pour fail2ban

Bonjour,

J’aimerais blooqué les personnes qui s’amusent à chercher le dossier mysql…

Pour le moment j’ai ça comme règles :

# Fail2Ban configuration file
# Bans bots scanning for non-existing phpMyAdmin installations on your webhost.
#

[Definition]
# Option: failregex
# Notes.: Regexp to match often probed and not available phpmyadmin paths.
# Values: TEXT
#
failregex = [[]client <HOST>[]] File does not exist: .*(PMA|phpmyadmin|myadmin|mysql|mysqladmin|sqladmin|mypma|admin|xampp|mysqldb|mydb|pmadb|phpmyadmin1|MyAdmin|my$

# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =

Si je vais sur monsite.fr/phpmyadmin, je me fais bannir aussitôt… donc c’est ok.

Par contre je ne comprends pas, dans apache j’ai des lignes du genre :

Est-ce que si je crée la syntaxe suivante je serais tranquille ?

# Fail2Ban configuration file
# Bans bots scanning for non-existing phpMyAdmin installations on your webhost.
#

[Definition]
# Option: failregex
# Notes.: Regexp to match often probed and not available phpmyadmin paths.
# Values: TEXT
#
failregex = [[]client <HOST>[]] client denied by server configuration: .*(phpadmin)

# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =

Je préfére demander avant de faire une grosse boulette :slightly_smiling:

Merci à vous :slightly_smiling:

Salut,
Je mettrais ceci plutôt:

Il faut tester la règle avant de la mettre en fonction:

J’utilise une règle un peu plus restrictive pour les php et autres sql…

# Fail2Ban configuration file [Definition] docroot = /var/www badadmin = PMA|phpmyadmin|myadmin|mysql|mysqladmin|sqladmin|mypma|admin|xampp|mysqldb|mydb|db|pmadb|phpmyadmin1|phpmyadmin2 failregex = [[]client <HOST>[]] File does not exist: %(docroot)s/(?:%(badadmin)s) ignoreregex =

Merci c’est parfait :slightly_smiling: