繁体   English   中英

owasp-modsecurity-crs已检测到但未拒绝该请求

[英]owasp-modsecurity-crs detected but not deny the request

我使用ModSecurity和owasp-modsecurity-crs构建了Nginx 1.10.3,并使用curl对其进行了测试。 从nginx日志开始,它可以工作,因为已经使用规则检测到它,但是客户端仍然获得http响应成功,而不是预期的拒绝响应(如403)。

能否请你帮忙? 是否需要任何其他配置?

[sib@sib ~]$ curl -H "User-Agent: Nikto" http://15.116.78.110
...
Welcome to nginx!
...

Nginx error.log:

2017/09/20 20:11:14 [error] 20545#0: [client 15.116.79.38] ModSecurity: Warning. Matched phrase "nikto" at REQUEST_HEADERS:User-Agent. [file "/etc/nginx/owasp-modsecurity-crs/rules/REQUEST-913-SCANNER-DETECTION.conf"] [line "60"] [id "913100"] [rev "2"] [msg "Found User-Agent associated with security scanner"] [data "Matched Data: nikto found within REQUEST_HEADERS:User-Agent: nikto"] [severity "CRITICAL"] [ver "OWASP_CRS/3.0.0"] [maturity "9"] [accuracy "9"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-reputation-scanner"] [tag "OWASP_CRS/AUTOMATION/SECURITY_SCANNER"] [tag "WASCTC/WASC-21"] [tag "OWASP_TOP_10/A7"] [tag "PCI/6.5.10"] [hostname ""] [uri "/"] [unique_id "AcAcAcdcAcAcscAcRcAclc8T"]

我在下面找到了解决方案:

INSTALL文件表示您需要为Nginx显式加载规则文件,因为Nginx本身并不使用按字母顺序排列的加载顺序。 您使用了Apache Include形式* .conf,这导致Nginx在触发规则之前评估了Anomaly Score。 (在942文件之前已加载-> 949文件)。

如下加载它们,您应该可以:

include owasp-modsecurity-crs/crs-setup.conf
include owasp-modsecurity-crs/rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
...
include owasp-modsecurity-crs/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM