【问题标题】:why does fail2ban not match script not found为什么fail2ban不匹配脚本未找到
【发布时间】:2017-08-04 11:16:13
【问题描述】:

为什么下面fail2ban regex

failregex = ^%(_apache_error_client)s ((AH001(28|30): )?File does not exist|(AH01264: )?script not found or unable to stat).*$
        ^%(_apache_error_client)s script '.*' not found or unable to stat

不匹配

[client 111.111.111.111:51008] script '/srv/www/htdocs/wwwuni/fileadmin/Dokumente/index.php' not found or unable to stat

【问题讨论】:

  • failregex 是两行;第二行在 stat),$ 之后开始
  • 也许你错过了第二行stat之后的$?
  • 丢失的 $ 不是问题。问题是 _apache_error_client 的定义与我更改的行不匹配 _apache_error_client = [[^]]*] [(error|\S+:\S+)]( [pid \d+])? [客户端 (:\d{1,5})?] 到 _apache_error_client = [[^]]*] [(:error|\S+:\S+)]( [pid \d+])? [client (:\d{1,5})?] (: 前面的错误)

标签: regex fail2ban


【解决方案1】:

更改定义后我的问题解决了 apache-common.conf 中的 _apache_error_client 到 _apache_error_client = [[^]]*] [(:error|\S+:\S+)]([pid \d+])? [客户端 (:\d{1,5})?]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-16
    • 1970-01-01
    • 2023-02-20
    • 1970-01-01
    相关资源
    最近更新 更多