Rancher 2负载平衡器的modsecurity + OWASP规则

问题描述 投票:0回答:1

我已经在负载均衡器注释中将“ nginx.ingress.kubernetes.io/enable-modsecurity”设置为true,但似乎不起作用。

负载均衡器是否需要其他配置?可以加载OWASP规则集吗?

Rancher版本是2.2.7。

nginx owasp rancher mod-security web-application-firewall
1个回答
0
投票

如NGINX入口控制器documentation中所述,您必须在ConfigMap中启用ModSecurity模块才能使其正常工作,并且默认情况下它以recommended configuration的“仅检测”模式启动

至于OWASP规则集,您可以设置此注释:

nginx.ingress.kubernetes.io/enable-owasp-core-rules: "true"

或者您可以将其包括在nginx.ingress.kubernetes.io/modsecurity-snippet批注中。请务必注意,这些注释不能一起使用,因为如果这样做,则仅会读取第二个注释(代码段)。

一个简单的例子是:

nginx.ingress.kubernetes.io/modsecurity-snippet: |
SecRuleEngine On
SecDebugLog /tmp/modsec_debug.log
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
© www.soinside.com 2019 - 2024. All rights reserved.