Administrators, autoreview, Vérificateurs d’utilisateurs, checkuser-log, editor, reviewer, usersnoop
3 321
modifications
m (→Test) |
|||
Ligne 123 : | Ligne 123 : | ||
== Test == | == Test == | ||
=== Testez les règles === | |||
L'erreur commune est de se tromper de fichier log... Vérifiez et revérifiez que le fichier donné en "logpath" est le bon. | |||
Ensuite testez vos règles avec la commande /usr/bin/fail2ban-regex | |||
# /usr/bin/fail2ban-regex /var/www/path/logs/userlogins /etc/fail2ban/filter.d/roundcube.conf | |||
Exemple de sortie: | |||
<code> | |||
Running tests | |||
============= | |||
Use regex file : /etc/fail2ban/filter.d/roundcube.conf | |||
Use log file : /var/www/path/logs/userlogins | |||
Results | |||
======= | |||
Failregex | |||
|- Regular expressions: | |||
| [1] FAILED login for .*. from <HOST> | |||
| | |||
`- Number of matches: | |||
[1] 1 match(es) | |||
Ignoreregex | |||
|- Regular expressions: | |||
| | |||
`- Number of matches: | |||
Summary | |||
======= | |||
Addresses found: | |||
[1] | |||
41.xxx.xxx.xxx (Wed Dec 28 15:51:14 2011) | |||
Date template hits: | |||
0 hit(s): MONTH Day Hour:Minute:Second | |||
0 hit(s): WEEKDAY MONTH Day Hour:Minute:Second Year | |||
0 hit(s): WEEKDAY MONTH Day Hour:Minute:Second | |||
0 hit(s): Year/Month/Day Hour:Minute:Second | |||
0 hit(s): Day/Month/Year Hour:Minute:Second | |||
0 hit(s): Day/Month/Year Hour:Minute:Second | |||
0 hit(s): Day/MONTH/Year:Hour:Minute:Second | |||
0 hit(s): Month/Day/Year:Hour:Minute:Second | |||
0 hit(s): Year-Month-Day Hour:Minute:Second | |||
2 hit(s): Day-MONTH-Year Hour:Minute:Second[.Millisecond] | |||
0 hit(s): Day-Month-Year Hour:Minute:Second | |||
0 hit(s): TAI64N | |||
0 hit(s): Epoch | |||
0 hit(s): ISO 8601 | |||
0 hit(s): Hour:Minute:Second | |||
0 hit(s): <Month/Day/Year@Hour:Minute:Second> | |||
Success, the total number of match is 1 | |||
However, look at the above section 'Running tests' which could contain important | |||
information. | |||
</code> | |||
=== Testez l'état des jails === | |||
Avec la commande /usr/bin/fail2ban-client vous pouvez vérifier l'état de vos "jails": | |||
# /usr/bin/fail2ban-client status apache-404 | |||
Exemple de sortie: | |||
<code> | |||
Status for the jail: apache-404 | |||
|- filter | |||
| |- File list: /var/log/path/error.log /var/log/path2/error.log /var/log/path2/error.log Etc... | |||
| |- Currently failed: 5 | |||
| `- Total failed: 32 | |||
`- action | |||
|- Currently banned: 2 | |||
| `- IP list: 41.xxx.xxx.xxx 84.xxx.xxx.xxx | |||
`- Total banned: 2 | |||
</code> | |||
=== Testez en violant une règle === | |||
Créez par exemple un répertoire dans votre serveur apache, rendez obligatoire l'identification, puis entrez plusieurs fois de suite un mot de passe erroné. | Créez par exemple un répertoire dans votre serveur apache, rendez obligatoire l'identification, puis entrez plusieurs fois de suite un mot de passe erroné. | ||
Vous devriez avoir dans vols logs ceci: | Vous devriez avoir dans vols logs ceci: |
modifications