diff --git a/HowtoFail2Ban.md b/HowtoFail2Ban.md index 9dad52e2..4bc270b5 100644 --- a/HowtoFail2Ban.md +++ b/HowtoFail2Ban.md @@ -220,7 +220,15 @@ failregex = warning: \[\]: authentication failed: ignoreregex = ~~~ -On peut tester sa règle avec la commande **fail2ban-regex** en précisant une date : +Pour tester une règle : + +~~~ +$ fail2ban-regex auth.log /etc/fail2ban/filter.d/evolix-test.conf +~~~ + +Afin d'obtenir des informations supplémentaires - dans le cas où on cherche les heures de connexion d'une adresse IP particulière - on peut utiliser les options `-v` et/ou `--print-all-matched`. + +On peut aussi tester avec une date : ~~~ $ fail2ban-regex '2017-05-20 10:10:10 foo' 'warning: \[\]: authentication failed:' @@ -234,16 +242,8 @@ Failregex: 1 total |- #) [# of hits] regular expression | 1) [1] \[\]: authentication failed: [...] - -$ fail2ban-regex auth.log /etc/fail2ban/filter.d/evolix-test.conf -[...] ~~~ -Afin d'obtenir des informations supplémentaires - dans le cas où on cherche les heures de connexion d'une adresse IP particulière - on peut utiliser l'option `-v` - -~~~ -$ fail2ban-regex -v auth.log /etc/fail2ban/filter.d/evolix-test.conf -~~~ ### Actions