Modsecurity + Nginx. Based on alpine linux.
476
1.15.2, latest (1.15.2/Dockerfile)
ModSecurity is a Web Application Firewall (WAF). There is two part :
For more information you can read https://github.com/SpiderLabs/ModSecurity/tree/v3/master.
The docker image pockost/nginx-modsecurity is build to be smallest as possible. To achieve this the image is build in two stage.
The first stage build all shared object library. The second one copy only needed library to an official alpine-linux based official nginx image.
ModSecurity need a list of rules to work as expected. If you place all your rules info /etc/modsecurity/rules an init script will generate a /etc/modsecurity/main.conf file. You can use this file in your nginx configuration to enable modsecurity like that :
# /etc/nginx/conf.d/modsecurity.conf
modsecurity on;
modsecurity_rules_file /etc/modsecurity/main.conf;
If you don't have any rule set the OWASP provide some. The Open Web Application Security Project (OWASP) project maintain a list of ModSecurity rules. You can find rules here : https://coreruleset.org/
Additionally, if you plan to use the OWASP ruleset, you have to include the crs-setup.conf in your rules folder.
AUTODISCOVERY_RULES set to no to disable auto discovery of rules.docker run --rm -it -v /path/to/rules/:/etc/modsecurity/rules/ pockost/nginx-modsecurity:latest
You can also find an example on github repositiory.
Content type
Image
Digest
Size
24.7 MB
Last updated
over 8 years ago
docker pull pockost/nginx-modsecurity