【发布时间】:2017-11-23 09:13:16
【问题描述】:
我正在使用 fail2ban 9.6.1 标准过滤器 apache-common.conf 和 apache-noscript.conf。 但是 apache-noscript 与 apache error_log 中的此类条目不匹配:
[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.
欢迎提出任何建议。
谢谢。
【问题讨论】: