问题描述
我使用 Kong Ingress Controller 已经有一段时间了,我想保护我的 Web 应用程序以及 Kong Ingress 使用 WAF 从所有 Owasp 前 10(或已知)攻击中公开的 API。
>我的方法
我已经构建了一个自定义的 kong(高山)docker 镜像,我在其中添加了:-
- ModSecurity (v3/master):https://github.com/SpiderLabs/ModSecurity
- ModSecurity 连接器:https://github.com/SpiderLabs/ModSecurity-nginx
- Openresty (v1.19.3.1):https://openresty.org/download/openresty-1.19.3.1.tar.gz
- CRS (v3.3/master):https://github.com/coreruleset/coreruleset.git
基本上,我在 Nginx 中添加了 ModSecurity 作为动态模块,并使用 Owasp ModSecurity CRS 进行通用攻击检测。
但是,它基于正则表达式;这意味着必须手动添加每个签名 此外,所有预先配置的规则都必须持续管理和审查误报。
是否有其他方法来管理 WAF 规则(例如自动以某种方式)或更有效的方法来在 Kong Ingress Controller 上启用 WAF ???
解决方法
您已经设法将 ModSecurity 与 OWASP ModSecurity 核心规则集集成。
很遗憾,我无法告诉您任何替代方案。 但我可以通过有关 including the rule files of the Core Rule Set 和 handling of false positives 的有用链接为您提供帮助。 我的一位同事和 CRS 项目负责人写了很有帮助的 NGINX / ModSecurity tutorials。
我希望这对您使用 ModSecurity 和 NGINX 上的核心规则集有所帮助。