ingress-nginx-helm/docs/user-guide/third-party-addons/modsecurity.md

17 lines
1.7 KiB
Markdown
Raw Normal View History

2017-10-13 13:55:03 +00:00
# ModSecurity Web Application Firewall
2018-04-29 06:17:29 +00:00
ModSecurity is an open source, cross platform web application firewall (WAF) engine for Apache, IIS and Nginx that is developed by Trustwave's SpiderLabs. It has a robust event-based programming language which provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis - [https://www.modsecurity.org](https://www.modsecurity.org)
2017-10-13 13:55:03 +00:00
The [ModSecurity-nginx](https://github.com/SpiderLabs/ModSecurity-nginx) connector is the connection point between NGINX and libmodsecurity (ModSecurity v3).
The default ModSecurity configuration file is located in `/etc/nginx/modsecurity/modsecurity.conf`. This is the only file located in this directory and contains the default recommended configuration. Using a volume we can replace this file with the desired configuration.
To enable the ModSecurity feature we need to specify `enable-modsecurity: "true"` in the configuration configmap.
2017-10-13 13:55:03 +00:00
2018-04-29 06:17:29 +00:00
>__Note:__ the default configuration use detection only, because that minimises the chances of post-installation disruption.
The file `/var/log/modsec_audit.log` contains the log of ModSecurity.
2017-10-13 13:55:03 +00:00
The OWASP ModSecurity Core Rule Set (CRS) is a set of generic attack detection rules for use with ModSecurity or compatible web application firewalls. The CRS aims to protect web applications from a wide range of attacks, including the OWASP Top Ten, with a minimum of false alerts.
2018-05-30 07:25:12 +00:00
The directory `/etc/nginx/owasp-modsecurity-crs` contains the [owasp-modsecurity-crs repository](https://github.com/SpiderLabs/owasp-modsecurity-crs).
Using `enable-owasp-modsecurity-crs: "true"` we enable the use of the rules.