Регулярка для fail2ban, защита админки WP
Posted: Sat Jun 18, 2016 7:45 pm
Коллеги, нужна ваша помощь по составлению регулярки для файла конфига fail2ban.
Что имеем:
1) Сообщения о неуспешной авторизации пишутся в /var/log/httpd/domains/domain.ru.error.log в виде
2) В файле /etc/fail2ban/filter.d/wordpress-auth.conf написано правило:
3) В jail.local секция:
Но в итоге не работает, чувствую что проблема регулярке, но самостоятельно ее решить, к сожалению, не могу. Надеюсь на вашу помощь.
Что имеем:
1) Сообщения о неуспешной авторизации пишутся в /var/log/httpd/domains/domain.ru.error.log в виде
Code: Select all
[Sat Jun 18 19:20:15.575081 2016] [:error] [pid 6441] [client 5.166.162.172:56291] WP LOGIN FAILED for username: 121221, referer: http://domain.ru/wp-login.php
Code: Select all
[Definition]
failregex = \[*\]. \[*\]. \[*\] .\[client <HOST>\].* WP LOGIN FAILED.*
Code: Select all
[wordpress]
enabled = true
port = http,https
filter = wordpress-auth
logpath = /var/log/httpd/domains/*.error.log
maxretry = 3
bantime = 3600
Code: Select all
root@54161 ~]# fail2ban-regex /var/log/httpd/domains/domain.ru.error.log "\[*\]. \[*\]. \[*\] .\[client <HOST>\].* WP LOGIN FAILED for username:.*"
Running tests
=============
Use failregex line : \[*\]. \[*\]. \[*\] .\[client <HOST>\].* WP LOGIN ...
Use log file : /var/log/httpd/domains/domain.ru.error.log
Use encoding : UTF-8
Results
=======
Failregex: 0 total
Ignoreregex: 0 total
Date template hits:
|- [# of hits] date format
| [141] Year(?P<_sep>[-/.])Month(?P=_sep)Day 24hour:Minute:Second(?:,Microseconds)?
| [141] (?:DAY )?MON Day 24hour:Minute:Second(?:\.Microseconds)?(?: Year)?
`-
Lines: 282 lines, 0 ignored, 0 matched, 282 missed [processed in 0.04 sec]
Missed line(s): too many to print. Use --print-all-missed to print all 282 lines