Bonjour,
Je cherche à créer une prison FailBan pour detecter les tentatives de connexion à mysql/phpmyadmin erronées.
Je suis tombé sur ce sujet : securite-anti-brute-force-t39497.html et j’ai suivi la procédure de Darel qui explique très bien comment faire.
Mais lorsque je lance un fail2ban-regex pour vérifier :
j’ai ce message d’erreur :
Found a match for ' 90 Connect Access denied for user 'root'@'localhost' (using password: YES)
' but no valid date/time found for ' 90 Connect Access denied for user 'root'@'localhost' (using password: YES)
'. Please contact the author in order to get support for this format
Found a match for ' 97 Connect Access denied for user 'john'@'localhost' (using password: YES)
' but no valid date/time found for ' 97 Connect Access denied for user 'aaaa'@'localhost' (using password: YES)
'. Please contact the author in order to get support for this format
Pourtant j’ai bien rajouté à /usr/share/fail2ban/server/datedetector.py ces lignes :
# AAMMJJ HH:MM:SS
template = DateStrptime()
template.setName("YearMonthDay Hour:Minute:Second")
template.setRegex("\d{2}\d{2}\d{2} \d{2}:\d{2}:\d{2}")
template.setPattern("%y%m%d %H:%M:%S")
self.__templates.append(template)
et je ne comprend pas pourquoi j’ai cette erreur…
Quelqu’un à une petite idée ?
Je ne sais pas si c’est utile de le préciser : Mes logs de /var/log/mysql/mysql.log lors de connexions erronées ressemblent à ça :
120811 17:11:43 100 Connect phpmyadmin@localhost on
100 Query SELECT VERSION()
100 Query SET CHARACTER SET 'utf8'
100 Query SET collation_connection = 'utf8_general_ci'
101 Connect Access denied for user 'root'@'localhost' (using password: YES)
100 Quit
120811 17:11:49 102 Connect phpmyadmin@localhost on
102 Query SET CHARACTER SET 'utf8'
102 Query SET collation_connection = 'utf8_general_ci'
103 Connect Access denied for user 'john'@'localhost' (using password: YES)
102 Quit
Voilà,
Quelqu’un sait pourquoi j’ai cette erreur de format ?
Merci