<![CDATA[Forum Ubuntu-fr.org / proftpd log mal pour fail2ban [résolu]]]> http://forum.ubuntu-fr.org/viewtopic.php?id=384794 Tue, 05 Feb 2013 19:11:55 +0000 FluxBB <![CDATA[Réponse à : proftpd log mal pour fail2ban [résolu]]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=12477271#p12477271 Vous trouverez la réponse ici.
C'est un problème de date en Français alors que Fail2ban le veut en anglais.

]]>
Tue, 05 Feb 2013 19:11:55 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=12477271#p12477271
<![CDATA[Réponse à : proftpd log mal pour fail2ban [résolu]]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=3704714#p3704714 Je rencontre actuellement le même problème, j'ai mis en place une solution similaire à celle de 2F en éditant le fichier /etc/init.d/proftpd et en modifiant la ligne (81 chez moi)

start-stop-daemon --start --quiet --pidfile "$PIDFILE" --oknodo --exec $DAEMON -- $OPTIONS

par

export LANG="en_US.UTF-8" && start-stop-daemon --start --quiet --pidfile "$PIDFILE" --oknodo --exec $DAEMON -- $OPTIONS

C'est quand même dommage de se priver de la protection de fail2ban juste pour une date francisée dans le log...

]]>
Fri, 03 Sep 2010 07:37:34 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=3704714#p3704714
<![CDATA[Réponse à : proftpd log mal pour fail2ban [résolu]]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=3655167#p3655167 Salut,

Je sais que je déterre un post "résolu" ; mais perso, j'ai pas trop compris la manoeuvre...

Je me retrouve exactement avec le même problème.
Mais LOG de ProFTP sont en "Franglais" :

aoû 09 18:48:57 myhost proftpd[17654] myhost.mydomain.tld (192.168.10.210[192.168.10.210]): no such user 'demo'
aoû 09 18:48:57 myhost proftpd[17654] myhost.mydomain.tld (192.168.10.210[192.168.10.210]): USER demo: no such user found from 192.168.10.210 [192.168.10.210] to 192.168.10.220:21
aoû 09 19:55:00 myhost proftpd[17809] myhost.mydomain.tld (192.168.10.210[192.168.10.210]): USER demo (Login failed): No such user found.

On voit bien la date en français et le log en anglais ; du coup ma Regex est foireuse.

Après modification de la regex de fail2ban, il me détecte bien les entrées:

fail2ban-regex /var/log/proftpd/proftpd.log /etc/fail2ban/filter.d/proftpd.conf 

Running tests
=============

Use regex file : /etc/fail2ban/filter.d/proftpd.conf
Use log file   : /var/log/proftpd/proftpd.log

Found a match for ' hiposprod proftpd[10713] hiposprod.hipos.tv (192.168.10.23[192.168.10.23]): USER demo (Login failed): No such user found.
' but no valid date/time found for 'aoû 11 14:45:29'. Please contact the author in order to get support for this format

Results
=======

Failregex
|- Regular expressions:
|  [1] \(\S+\[<HOST>\]\)[: -]+ USER \S+: no such user found from \S+ \[\S+\] to \S+:\S+$
|  [2] \(\S+\[<HOST>\]\)[: -]+ USER \S+ \(Login failed\): Incorrect password\.$
|  [3] \(\S+\[<HOST>\]\)[: -]+ SECURITY VIOLATION: \S+ login attempted\.$
|  [4] \(\S+\[<HOST>\]\)[: -]+ Maximum login attempts \(\d+\) exceeded$
|  [5] \(\S+\[<HOST>\]\)[: -]+ USER \S+ \(Login failed\): No such user found\.$
|
`- Number of matches:
   [1] 0 match(es)
   [2] 0 match(es)
   [3] 0 match(es)
   [4] 0 match(es)
   [5] 0 match(es)

Si j'ai bien compris, il ne détecte pas correctement la date !?

Quelqu'un a une idée, solution ?

Merci

]]>
Wed, 11 Aug 2010 13:06:22 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=3655167#p3655167
<![CDATA[Réponse à : proftpd log mal pour fail2ban [résolu]]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=3368078#p3368078 apres presqu'un mois tranquille, suite à redémarrage, proftpd log à nouveau avec la date en francais.
j'ai essayé de mettre dans proftpd.conf
logformat  ....%{format}t   au lieu de %t
j'ai aussi essayé de déplacer les logs comme ca avait fonctionner avant mais rien n'y fait !!! pourquoi ce truc log en francais. et pourquoi fail2ban ne sait pas le résoudre.
bizarre, ca correspond au changement d'heure, une histoire de gmt machin...suis je le seul ?

merci aux as du regex ou aux as du fuseau horaire et de la faille spatio-temporelle française

edit : j'a aussi essayé "timesGMT on"  mais sans succès. molière me poursuit
j'ai essayé le mod_lang.c, le export lang et plein de choses
La seule solution, pas très propre que j'ai trouvé et qui focntionne c'est de le lancer avec :

export LANG="en_US.UTF-8" && sudo service proftpd restart
]]>
Sun, 28 Mar 2010 19:54:29 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=3368078#p3368078
<![CDATA[Réponse à : proftpd log mal pour fail2ban [résolu]]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=3342113#p3342113 Suis je le seul dans ce cas? neutral

edit : non résolu, j'avais pour des raisons de fénéantise, dirigé les logs de proftpd dans auth.log
en les remettant dans proftpd/proftpd.log. ca a marché jusquà aujourd'hui date du changement d'heure ?? sad

]]>
Tue, 16 Mar 2010 11:44:36 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=3342113#p3342113
<![CDATA[proftpd log mal pour fail2ban [résolu]]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=3340824#p3340824 Bonjour,
j'ai rien trouvé de probant...
j'ai proftpd et fail2ban, le probleme c'est que proftpd à l'air de faire les logs en francais et surtout avec 4 lettres pour le mois contraierement à 3 qui semble être la règle. Du coup fail2ban me mets date/time invalid et ne veut pas agir.
quelques détails :
un exemple de log de proftpd:

Mar 15 00:39:01 toulouse CRON[8894]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 15 00:39:01 toulouse CRON[8894]: pam_unix(cron:session): session closed for user root
mars 15 00:39:01 toulouse proftpd[8893] toulouse (::ffff:60.217.229.228[::ffff:60.217.229.228]): USER administrator: no such user found from ::ffff:60.217.229.228 [::ffff:60.217.229.228] to ::ffff:192.168.0.12:21
mars 15 00:39:02 toulouse proftpd[8893] toulouse (::ffff:60.217.229.228[::ffff:60.217.229.228]): USER administrator: no such user found from ::ffff:60.217.229.228 [::ffff:60.217.229.228] to ::ffff:192.168.0.12:21
mars 15 00:39:02 toulouse proftpd[8893] toulouse (::ffff:60.217.229.228[::ffff:60.217.229.228]): Maximum login attempts (3) exceeded, connection refused
mars 15 00:39:02 toulouse proftpd[8893] toulouse (::ffff:60.217.229.228[::ffff:60.217.229.228]): FTP session closed.

on voit dans les deux premières lignes "Mar" et en dessous proftpd qui log le mois avec "mars"
le regex de fail2ban :

failregex = \(\S+\[<HOST>\]\)[: -]+ USER \S+: no such user found from \S+ \[\S+\] to \S+:\S+ *$
            \(\S+\[<HOST>\]\)[: -]+ USER \S+ \(Login failed\): Incorrect password\. *$
            \(\S+\[<HOST>\]\)[: -]+ SECURITY VIOLATION: \S+ login attempted\. *$
            \(\S+\[<HOST>\]\)[: -]+ Maximum login attempts \(\d+\) exceeded *$

et l'erreur reporté que je comprends bien mais je n'arrive pas à changer le format des logs de proftpd, et je suis pas un pro du regex :

Found a match for 'm toulouse proftpd[20924] toulouse (::ffff:121.12.114.6[::ffff:121.12.114.6]): USER Administrator: no such user found from ::ffff:121.12.114.6 [::ffff:121.12.114.6] to ::ffff:192.168.0.12:21
' but no valid date/time found for 'ars 15 18:29:27'. Please contact the author in order to get support for this format

On voit bien, que le mois le fait tilter wink
D'avance merci

edit : jai bien vu cette solution http://forum.ubuntu-fr.org/viewtopic.php?pid=3142367 mais aucun changement apres restart du fail2ban ;(

]]>
Mon, 15 Mar 2010 18:02:42 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=3340824#p3340824