From 40ace8521560d21b0e82c996a8f96ef368cfe40d Mon Sep 17 00:00:00 2001 From: whirigoyen Date: Fri, 6 May 2022 10:27:18 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20option=20--print-all-matched=20pour=20t?= =?UTF-8?q?ester=20une=20r=C3=A8gle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoFail2Ban.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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