При запуске fail2ban-регулярное выражениеFail2ban именованных отказался failregex синтаксис
fail2ban-regex /var/log/named/security1.log /etc/fail2ban/filter.d/named-refused.conf
Я получаю следующий вывод
Running tests
=============
Use regex file : /etc/fail2ban/filter.d/named-refused.conf
Use log file : /var/log/named/security1.log
Matched time template Day-MONTH-Year Hour:Minute:Second[.Millisecond]
Matched time template Day-MONTH-Year Hour:Minute:Second[.Millisecond]
Matched time template Day-MONTH-Year Hour:Minute:Second[.Millisecond]
Matched time template Day-MONTH-Year Hour:Minute:Second[.Millisecond]
Matched time template Day-MONTH-Year Hour:Minute:Second[.Millisecond]
Results
=======
Failregex: 0 total
Ignoreregex: 0 total
Summary
=======
Sorry, no match
Вот некоторые выход security1.log файла
08-Feb-2016 11:38:15.324 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.325 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.325 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.325 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.325 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.325 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.325 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.325 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.325 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.325 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.326 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.326 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.326 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
08-Feb-2016 11:38:15.326 client 192.168.0.1#4444 (cpsc.gov): query (cache) 'cpsc.gov/ANY/IN' denied
failregex является следующим
failregex = %(__line_prefix)sclient <HOST>#\S+: (view (internal|external):)?query(?: \(cache\))? '.*' denied\s*$
Я думаю, что существует разница между выходом моего security1.log и синтаксисом failregex файла named-reject.conf, который не находит ничего.
Спасибо заранее,
Guy
Hi Mbo42, это сработало отлично! Он также работает с микросекундами. Дистро информация: Fedora релиз 17 (Мускулистый Miracle) NAME = Fedora Version = "17 (Мускулистый Чудо)" ID = Fedora version_id = 17 PRETTY_NAME = "Fedora 17 (Мускулистый Чудо)" ANSI_COLOR = "0; 34 " CPE_NAME =" cpe:/o: fedoraproject: fedora: 17 " Fedora release 17 (Beefy Miracle) Fedora release 17 (Beefy Miracle) – Spinsq