Регулярка для fail2ban, защита админки WP

abst
На сайте с 14.01.2011
Offline
136
1072

Коллеги, нужна ваша помощь по составлению регулярки для файла конфига fail2ban.

Что имеем:

1) Сообщения о неуспешной авторизации пишутся в /var/log/httpd/domains/domain.ru.error.log в виде

[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

2) В файле /etc/fail2ban/filter.d/wordpress-auth.conf написано правило:

[Definition]

failregex = \[*\]. \[*\]. \[*\] .\[client <HOST>\].* WP LOGIN FAILED.*

3) В jail.local секция:

[wordpress]

enabled = true
port = http,https
filter = wordpress-auth
logpath = /var/log/httpd/domains/*.error.log
maxretry = 3
bantime = 3600

Но в итоге не работает, чувствую что проблема регулярке, но самостоятельно ее решить, к сожалению, не могу. Надеюсь на вашу помощь.

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
Облачные VPS с SSD (https://goo.gl/Z2PT6u) от 150 руб. ДЦ в МСК и СПБ. Utpime 99.9%. 100 рублей на тест в подарок!
J
На сайте с 20.02.2014
Offline
120
jkm
#1


\[.*\] \[.*\] \[.*\] \[client <HOST>.* WP LOGIN FAILED.*

Или даже так


\[client <HOST>.* WP LOGIN FAILED

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий