Salut,
Bon alors j’ai cherché un peu partout, wiki & co, mais je sèche. Mon problème: fail2ban ne veut pas me bannir les tentatives ratées de connection à proftpd. J’utilise une authentification à partir d’une base MySQL.
Debian Squeeze
Version de fail2ban: 0.8.4-3
Version de proftpd: 1.3.3a-6squeeze1
Version de Mysql-server: 5.1.49-3
Dans /etc/fail2ban/jail.local:
[proftpd]
enabled = true
port = ftp,ftp-data,ftps,ftps-data
filter = proftpd
findtime = 300
bantime = 60
logpath = /var/log/proftpd/proftpd.log
maxretry = 2
Mon fichier de log de proftpd est bien /var/log/proftpd/proftpd.log, dans lequel j’obtiens, si j’entre un mauvais mot de passe, des messages du type:
sept. 13 11:41:14 ftp proftpd[32437] mon.domaine.net (::ffff:192.168.1.3[::ffff:192.168.1.3]): FTP session opened.
sept. 13 11:41:16 ftp proftpd[32437] mon.domaine.net (::ffff:192.168.1.3[::ffff:192.168.1.3]): USER test (Login failed): No such user found.
sept. 13 11:41:17 ftp proftpd[32437] mon.domaine.net (::ffff:192.168.1.3[::ffff:192.168.1.3]): FTP session closed.
Et le filtre fail2ban pour proftpd associé:
[code]# Fail2Ban configuration file
Author: Yaroslav Halchenko
$Revision: 728 $
[Definition]
Option: failregex
Notes.: regex to match the password failures messages in the logfile. The
host must be matched by a group named “host”. The tag “” can
be used for standard IP/hostname matching and is only an alias for
(?:::f{4,6}:)?(?P[\w-.^_]+)
Values: TEXT
failregex = (\S+[])[: -]+ USER \S+: no such user found from \S+ [\S+] to \S+:\S+ $
(\S+[])[: -]+ USER \S+ (Login failed): .$
(\S+[])[: -]+ SECURITY VIOLATION: \S+ login attempted. *$
(\S+[])[: -]+ Maximum login attempts (\d+) exceeded *$
Option: ignoreregex
Notes.: regex to ignore. If this regex matches, the line is ignored.
Values: TEXT
ignoreregex =[/code]
J’ai testé différentes autres regex, rien n’y fais -_-.
Si l’un de vous a une idée?
Merci d’avance :þ