Bonjour, j'utilise Apache en front end de tomcat, j'ai essayé de configurer apache-badbots dans fail2ban car mon serveur à trop de visite de robots, dans accesslog j'ai par exemple vu ce genre de ligne plusieurs fois :
Donc pour tester j'ai ajouter cette entrée dans jail.conf :[12/May/2019:06:25:36 +0200] "GET /164-5150/department/directory/banking+credit+Wahlkreis+St.+Gallen HTTP/1.1" 410 14471 "-" "Mozilla/5.0 (compatible; SemrushBot/3~bl; +http://www.semrush.com/bot.html)"
puis j'ai ajouté dans filter.d/apache-badbots.conf |SemrushBot à la fin de badbotscustom sans rien changer d'autre
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 [...] bantime = 86400 # A host is banned if it has generated "maxretry" during the last "findtime" # seconds. findtime = 3600 maxretry = 5 [...] [apache-badbots] enabled = true port = http,https filter = apache-badbots
dans le même fichier on a :j'ai pas voulu y toucher par contre quand je fais un :
Code : Sélectionner tout - Visualiser dans une fenêtre à part failregex = ^<HOST> -.*"(GET|POST).*HTTP.*"(?:%(badbots)s|%(badbotscustom)s)"$
j'ai en fin de sortie :
Code : Sélectionner tout - Visualiser dans une fenêtre à part fail2ban-regex -v /var/log/apache2/access.log /etc/fail2ban/filter.d/apache-badbots.conf
donc ou la regex ne fonctionne pas ou j'ai mal configuré mais je vois pas trop.Lines: 45390 lines, 0 ignored, 0 matched, 45390 missed
Merci de votre aide.
Partager