Sign inSign up

zar3bski/nginx_cerberus

By zar3bski

•Updated over 6 years ago

A custom Nginx proxy pass image for the typical web application

Image
0

428

zar3bski/nginx_cerberus repository overview

⁠Nginx Cerberus

An alpine based Nginx image powered by various security related optimisations

⁠Components

⁠Usage

services:
  nginx: 
    image: zar3bski/nginx_cerberus
    volumes: 
      - ./site.conf:/etc/nginx/conf.d/site.conf
    ports: 
      - 80:80
      - 443:443
    environment: 
      - [email protected]
⁠Env VARs
namerequireddefaultdescription
ADMIN_EMAILTrueNoneexpiration email so Let's Encrypt could notify the administrator (required only if AUTO_HTTPS == True)
AUTO_HTTPSFalseTruegenerate ssl certificates for all domaines found in /etc/nginx/conf.d and migrate to HTTPS
LOG_STDOUTFalseTruewhether or not default logs should be appended to stdout rather than files
⁠server configuration files

Here is how to activate Modsecurity for a website.

server {
    # ...
    modsecurity on;
    modsecurity_rules_file /etc/nginx/modsec/mod_sec_main.conf;
}

mod_sec_main.conf includes all OWASP core rules⁠ stored in /etc/nginx/modsec/owasp_rules. You could either point to /etc/nginx/modsec/crs-setup.conf or to some custom.conf (provided that it includes modsecurity.conf). For instance:

Include "/etc/nginx/modsec/modsecurity.conf"

SecRule ARGS:testparam "@contains test" "id:1234,deny,status:403"

Tag summary

Content type

Image

Digest

Size

99.2 MB

Last updated

over 6 years ago

docker pull zar3bski/nginx_cerberus:amd64-0.3.0