2017-11-23 14 views
0

fail2ban 9.6.1 표준 필터 apache-common.conf 및 apache-noscript.conf를 사용하고 있습니다. 그러나 아파치 - NOSCRIPT 아파치의 error_log 이러한 항목과 일치하지 않습니다Fail2ban 필터 apache-noscript가 Apache 로그의 항목과 일치하지 않습니다.

[Thu Nov 23 07:32:25 2017] [error] [client 999.999.999.999] File does not exist: /path/to/requested/file 

The _apache_error_client is: 

_apache_error_client = \[\] \[(:?error|\S+:\S+)\](\[pid \d+(:\S+ \d+)?\])? \[client <HOST>(:\d{1,5})?\] 

The failregex in apache-noscript is: 

failregex = ^%(_apache_error_client)s ((AH001(28|30):)?File does not exist|(AH01264:)?script not found or unable to stat): /\S*(php([45]|[.-]cgi)?|\.asp|\.exe|\.pl)(, referer: \S+)?\s*$ 
      ^%(_apache_error_client)s script '/\S*(php([45]|[.-]cgi)?|\.asp|\.exe|\.pl)\S*' not found or unable to stat(, referer: \S+)?\s*$ 

I guess I have either to modify the regex somehow or the log format of apache. 
I tried removing the pid part from _apache_error_client but without success. 

어떤 제안을 환영합니다.

감사합니다.

답변

0

이 답변을 얻었습니다. ? to /\S*(php([45]|[--cgi)?|.asp|.exe|.pl)는 문제를 해결합니다. */\는 S : 그래서 작업 정규식

^% (_ apache_error_client)의() 스크립트를 찾을 수 없거나없는 찍으하지 | : : | (AH01264) 파일이 존재하지 않습니다? 30) (AH001 (28)입니다 (referer : \ S +)? \ s * $

이것은 고정으로 표시 할 수 있습니다.

감사합니다.