ModSecurity审核日志规则限制

时间:2016-05-04 10:16:05

标签: logging audit mod-security

有没有办法限制每个日志条目中使用ModSecurity出现的规则数量?

--173fad2e-A--
[27/Apr/2016:17:15:25 +0530] VyCmVMCoAwUAAAohwTgAAAAA 127.0.0.1 33330 127.0.0.1 80

[...]

--173fad2e-H--
Message: Warning. Pattern match "^5\\d{2}$" at RESPONSE_STATUS. [file "/etc/modsecurity/activated_rules/modsecurity_crs_50_outbound.conf"] [line "53"] [id "970901"] [rev "2"] [msg "The application is not available"] [data "Matched Data: 503 found within RESPONSE_STATUS: 503"] [severity "ERROR"] [ver "OWASP_CRS/2.2.9"] [maturity "9"] [accuracy "9"] [tag "WASCTC/WASC-13"] [tag "OWASP_TOP_10/A6"] [tag "PCI/6.5.6"]
Message: Warning. Pattern match "^(?i:0|allow)$" at RESPONSE_HEADERS. [file "/etc/modsecurity/activated_rules/modsecurity_crs_55_application_defects.conf"] [line "151"] [id "981405"] [msg "AppDefect: X-FRAME-OPTIONS Response Header is Missing or not set to Deny."] [data "X-FRAME-OPTIONS: "] [tag "WASCTC/WASC-15"] [tag "MISCONFIGURATION"] [tag "http://websecuritytool.codeplex.com/wikipage?title=Checks#http-header-x-frame-options"]
Message: Warning. Operator GE matched 4 at TX:outbound_anomaly_score. [file "/etc/modsecurity/activated_rules/modsecurity_crs_60_correlation.conf"] [line "40"] [id "981205"] [msg "Outbound Anomaly Score Exceeded (score 4): The application is not available"]
[...]

--173fad2e-Z--

这是一个审计日志条目的示例,我想对其进行配置,使其仅在每个日志条目的日志预告片中显示“消息”,而不是(在示例中)3。

是否可以配置?

1 个答案:

答案 0 :(得分:-1)

不确定为什么要这样做?

它显示三个的原因是因为此请求触发了三个不同的规则。

ModSecurity通常会阻止第一个失败的规则,所以你不会看到这个。 阻止请求(因此阻止其他规则触发)的事实暗示了以下两点之一:

  1. 您正在DetectionOnly模式下运行。在这种模式下,查看所有规则特别有帮助,否则您只修复一条规则以发现另一条规则等等。

  2. 您正在运行异常检测模式,该模式运行所有规则,总计错误,然后在错误数量大于设置限制时阻止。如果异常分数的总和低于限制,则允许一个或多个次要规则(否则可能具有大量误报并因此阻止合法流量)通过。再次在此模式下,您需要查看所有失败的规则。

  3. 所以,对我来说,ModSecurity正在做它应该做的事情而不确定为什么你认为它应该只显示一条规则?

相关问题