例如,这个pdf在启用mod后停止工作,它会产生403错误。
[Wed May 30 18:47:19 2012] [error] [client xxxxxxxxxxx] ModSecurity: Warning. Match of "within %{tx.allowed_http_versions}" against "REQUEST_PROTOCOL" required. [file "base_rules/modsecurity_crs_30_http_policy.conf"] [line "78"] [id "960034"] [msg "HTTP protocol version is not allowed by policy"] [data "HTTP/1.1"] [severity "CRITICAL"] [tag "POLICY/PROTOCOL_NOT_ALLOWED"] [tag "WASCTC/WASC-21"] [tag "OWASP_TOP_10/A6"] [tag "PCI/6.5.10"] [hostname "somedomain.net"] [uri "/guide.pdf"] [unique_id "T8ZPFwoAARkAAA3sIQkAAAAG"]
78线,
SecRule REQUEST_PROTOCOL "!@within %{tx.allowed_http_versions}" "phase:2,t:none,block,msg:'HTTP protocol version is not allowed by policy', severity:'2',id:'960034',tag:'POLICY/PROTOCOL_NOT_ALLOWED',tag:'WASCTC/WASC-21', tag:'OWASP_TOP_10/A6',tag:'PCI/6.5.10',logdata:'%{matched_var}',setvar:'tx.msg=% {rule.msg}',setvar:tx.anomaly_score=+% {tx.warning_anomaly_score},setvar:tx.policy_score=+%{tx.warning_anomaly_score}, setvar:tx.%{rule.id}-POLICY/PROTOCOL_NOT_ALLOWED-%{matched_var_name}=%{matched_var}"
这个规则是什么使这些URL被破坏?
您应该在modsecurity_crs_10_config.conf中有一个部分,如下所示:
# # -=[ HTTP Policy Settings ]=- # # Set the following policy settings here and they will be propagated to the 30 rules # file (modsecurity_crs_30_http_policy.conf) by using macro expansion. # If you run into false positves, you can adjust the settings here. # SecAction "phase:1,id:'981212',t:none,nolog,pass, \ setvar:'tx.allowed_methods=GET HEAD POST OPTIONS', \ setvar:'tx.allowed_request_content_type=application/x-www-form-urlencoded multipart/form-data text/xml application/xml application/x-amf', \ setvar:'tx.allowed_http_versions=HTTP/0.9 HTTP/1.0 HTTP/1.1', \ setvar:'tx.restricted_extensions=.asa/ .asax/ .ascx/ .axd/ .backup/ .bak/ .bat/ .cdx/ .cer/ .cfg/ .cmd/ .com/ .config/ .conf/ .cs/ .csproj/ .csr/ .dat/ .db/ .dbf/ .dll/ .dos/ .htr/ .htw/ .ida/ .idc/ .idq/ .inc/ .ini/ .key/ .licx/ .lnk/ .log/ .mdb/ .old/ .pass/ .pdb/ .pol/ .printer/ .pwd/ .resources/ .resx/ .sql/ .sys/ .vb/ .vbs/ .vbproj/ .vsdisco/ .webinfo/ .xsd/ .xsx/', \ setvar:'tx.restricted_headers=/Proxy-Connection/ /Lock-Token/ /Content-Range/ /Translate/ /via/ /if/'"
你可以添加行allowed_http_versions从你的问题? 或者更好,整个部分?
来自您的Apache访问日志的相同请求的日志行也可能是有用的,但我怀疑我们只有来自config的allowed_http_versions行有足够的信息。
错误消息包含[data "HTTP/1.1"] ,表示规则已被触发,因为HTTP/1.1不是允许的HTTP版本之一。 或者您的allowed_http_versions不包含HTTP/1.1或者有其他的东西与这组规则混淆,这意味着该variables设置不正确。