【问题标题】:ModSecurity audit log rule limitModSecurity 审核日志规则限制
【发布时间】:2016-08-29 17:13:52
【问题描述】:

有没有办法使用 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。

可以这样配置吗?

【问题讨论】:

    标签: logging audit mod-security


    【解决方案1】:

    不确定为什么要这样做?

    之所以显示三个是因为这个请求触发了三个不同的规则。

    ModSecurity 通常会阻止第一个失败的规则,所以你不会看到这个。没有没有阻止请求(因此阻止其余规则触发)的事实表明了以下两件事之一:

    1. 您要么在DetectionOnly 模式下运行。在这种模式下,查看所有规则特别有用,否则您修复一个规则只是为了发现另一个规则,依此类推。

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

    所以,对我来说,ModSecurity 正在做它应该在这里做的事情,不知道为什么你认为它应该只显示一个规则?

    【讨论】:

    • 这不是关于>它我
    • 那么,您如何在不了解它失败的所有规则的情况下对威胁进行分类? AFAIK 你不能想要>你
    猜你喜欢
    • 2018-10-27
    • 1970-01-01
    • 1970-01-01
    • 2019-02-21
    • 1970-01-01
    • 2013-11-23
    • 2021-12-23
    • 2020-08-09
    • 2019-10-02
    相关资源
    最近更新 更多