Giter VIP home page Giter VIP logo

docker-nginx-modsecurity's Introduction

really/nginx-modsecurity

Docker container providing nginx with [modsecurity] (https://www.modsecurity.org), lua and certbot for Let's Encrypt SSL certificates

GitHub issues GitHub license Docker Pulls

Launch nginx using the default config:

docker run --name nginx-modsecurity \
  --restart=always \
  --net=host \
  -v /data/nginx/conf.d:/etc/nginx/conf.d:rw \
  -v /data/letsencrypt:/etc/letsencrypt:rw \
  -p 80:80 -p 443:443 -d \
  really/nginx-modsecurity

ModSecurity

Pre-configured with rules from OWASP CRS on my default. If you want to disable it for a particular location simply set it to off

server
{
  listen 80;
  listen [::]:80;
  listen [::]:443 ssl http2;
  listen 443 ssl http2;

  server_name insecure.example.com;

  set $upstream "http://10.0.0.1:9000";

  include /etc/nginx/defaults/https.conf;
  include /etc/nginx/defaults/resolver.conf;

  location /
  {
    include /etc/nginx/defaults/proxy.conf;
    proxy_pass $upstream;
    modsecurity off;
  }

  include /etc/nginx/defaults/error-page.conf;

  ssl_certificate /etc/letsencrypt/live/insecure.example.com/fullchain.pem; # managed by Certbot
  ssl_certificate_key /etc/letsencrypt/live/insecure.example.com/privkey.pem; # managed by Certbot

  ssl_trusted_certificate /etc/letsencrypt/live/insecure.example.com/chain.pem; # managed by Certbot
  ssl_stapling on; # managed by Certbot
  ssl_stapling_verify on; # managed by Certbot

}

Certbot

Easily add SSL security to your nginx hosts with certbot. docker exec -it nginx-modsecurity /bin/sh will bring up a prompt at which time you can certbot to your hearts content.

or

docker exec -it nginx-modsecurity certbot --no-redirect --must-staple -d example.com

It even auto-renew's for you every day!

docker-nginx-modsecurity's People

Contributors

troykelly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-nginx-modsecurity's Issues

Problem compiling

I get this error :

./configure: error: unsupported LuaJIT version; ngx_http_lua_module requires LuaJIT 2.x.

Is modsecurity enabled by default?

Hello,

we deployed your docker image using the folloing dockerfile:

FROM really/nginx-modsecurity

COPY . /usr/share/nginx/html/

COPY default.conf /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/nginx.conf

and it's successfully running.
But it seems like the modesecurity rules are not triggered, since it's not blacklisting IP addresses that are hammering the server (using Siege) and requests such as:

https://DOMAIN_NAME/?param=%22%3E%3Cscript%3Ealert(1);%3C/script%3E

are successfully served. Did we miss a step in configuring your image?

Thank you,
:panos

add ssh support

Can you please add ssh support to the image?
currently it shows "ssh: connect to host 172.17.0.2 port 22: Connection refused when trying to ssh to the container" and when running:
"sudo docker exec -it nginx-modsecurity /bin/bash" it showns:
"OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: "/bin/bash": stat /bin/bash: no such file or directory": unknown
"

How can ModSecurity be configured

Hello,

First of all thank you for open-sourcing this work ๐Ÿ˜Š

We're considering using it in our product, but we were wondering how can we configure the ModSecurity parameters.

Thank you,
:panos

Docker build error!

Hi there,
I get an error like image bellow. Can you help me fix it, plz.
image

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.