All Projects → theonemule → Docker Waf

theonemule / Docker Waf

Licence: mit
An NGINX and ModSecurity based Web Application Firewall for Docker

Projects that are alternatives of or similar to Docker Waf

Cidram
CIDRAM: Classless Inter-Domain Routing Access Manager.
Stars: ✭ 86 (-52.49%)
Mutual labels:  firewall, waf, protection
Country Ip Blocks
CIDR country-level IP data, straight from the Regional Internet Registries, updated hourly.
Stars: ✭ 100 (-44.75%)
Mutual labels:  firewall, nginx
Vouch Proxy
an SSO and OAuth / OIDC login solution for Nginx using the auth_request module
Stars: ✭ 1,239 (+584.53%)
Mutual labels:  nginx, nginx-proxy
Nginx Proxy Automation
Automated docker nginx proxy integrated with letsencrypt.
Stars: ✭ 2,302 (+1171.82%)
Mutual labels:  nginx, nginx-proxy
Xwaf
xWAF 3.0 - Free Web Application Firewall, Open-Source.
Stars: ✭ 48 (-73.48%)
Mutual labels:  firewall, waf
Ip2geo
Импортер ipgeo-данных в файлы, понятные для nginx geoip module, с поддержкой кодов регионов РФ.
Stars: ✭ 59 (-67.4%)
Mutual labels:  nginx, nginx-proxy
Docker Oidc Proxy
Docker Image built on Alpine Linux for secure OpenID Connect (OIDC) proxy authentication
Stars: ✭ 91 (-49.72%)
Mutual labels:  nginx, nginx-proxy
Ansible Collection Hardening
This Ansible collection provides battle tested hardening for Linux, SSH, nginx, MySQL
Stars: ✭ 2,543 (+1304.97%)
Mutual labels:  protection, nginx
Whatwaf
Detect and bypass web application firewalls and protection systems
Stars: ✭ 1,881 (+939.23%)
Mutual labels:  firewall, waf
Go Agent
Sqreen's Application Security Management for the Go language
Stars: ✭ 134 (-25.97%)
Mutual labels:  waf, protection
Botwall4j
A botwall for Java web applications
Stars: ✭ 41 (-77.35%)
Mutual labels:  firewall, waf
Nginx Admins Handbook
How to improve NGINX performance, security, and other important things.
Stars: ✭ 12,463 (+6785.64%)
Mutual labels:  nginx, nginx-proxy
The World Is Yours
Nginx L7 DDoS Protection! And many more features 💥 ⚡️
Stars: ✭ 20 (-88.95%)
Mutual labels:  nginx, nginx-proxy
Setup Nginx Webserver
🚀Setup a perfect webserver on CentOS/Redhat 7.x guide with understanding.
Stars: ✭ 65 (-64.09%)
Mutual labels:  firewall, nginx
Modsecurity Nginx
ModSecurity v3 Nginx Connector
Stars: ✭ 805 (+344.75%)
Mutual labels:  waf, nginx
Engintron
Engintron for cPanel/WHM is the easiest way to integrate Nginx on your cPanel/WHM server. Engintron will improve the performance & web serving capacity of your server, while reducing CPU/RAM load at the same time, by installing & configuring the popular Nginx webserver to act as a reverse caching proxy in front of Apache.
Stars: ✭ 587 (+224.31%)
Mutual labels:  nginx, nginx-proxy
Openwaf
Web security protection system based on openresty
Stars: ✭ 563 (+211.05%)
Mutual labels:  waf, nginx
Nginx Module Sysguard
Nginx sysguard module
Stars: ✭ 568 (+213.81%)
Mutual labels:  protection, nginx
Symfony 4 Docker Env
Docker Environment for Symfony. PHP-FPM, NGINX SSL Proxy, MySQL, LEMP
Stars: ✭ 119 (-34.25%)
Mutual labels:  nginx, nginx-proxy
Nginx
NGINX Accelerated! This is a Docker image that creates a high performance (FAST!), optimized image for NGINX for use with Redis and PHP-FMP. Deliver sites and applications with performance, reliability, security, and scale. This NGINX server offers advanced performance, web and mobile acceleration, security controls, application monitoring, and management.
Stars: ✭ 157 (-13.26%)
Mutual labels:  nginx, nginx-proxy

Securing Docker Containers with a Web Application Firewall (WAF) built on ModSecurity and NGINX

One can never be too paranoid about online security for a number of reasons. Containers are generally considered to be more secure by default that virtual machines because they substantially reduce the attack surface for a given application and its supporting infrastructure. This does not imply, however, that one should not be vigilant about secure containers. In addition to following secure practices for mitigating security risks with containers, those that use them should also use edge security to protect containers as well. Most applications that are being deployed into containers are in some way connected to the internet with ports exposed and so on. Traditionally, applications are secured with edge devices such as Unified Threat Management (UTM) that provides a suite of protection services including application protection. The nature of containers though makes using a UTM harder, because container loads are portable and elastic. Likewise, container loads are also being shifted to the cloud.

A Web Application Firewall (WAF) is a purpose-built firewall designed to protect against attacks common to web apps. One of the most widely used WAF’s is ModSecurity. Originally, it was written as a module for the Apache webserver, but it has since been ported to NGINX and IIS. ModSecurity protects against attacks by looking for:

  • SQL Injection
  • Insuring the content type matches the body data.
  • Protection against malformed POST requests.
  • HTTP Protocol Protection
  • Real-time Blacklist Lookups
  • HTTP Denial of Service Protections
  • Generic Web Attack Protection
  • Error Detection and Hiding

NGINX, though, is more than merely a web server. It can also act as a load balancer, reverse proxy, and do SSL offloading. Combine with ModSecurity, it has all the features to be a full-blown WAF. The NGINX/ModSecurity WAF has traditionally be deployed on VM’s and bare-metal servers, however it too can also be containerized. Using NGINX/ModSecurity in a container means that a container itself can be a WAF and carry with it all the advantages of containers. Likewise, it can scale and deploy with containers loads with on premise and cloud based solutions while VM’s and physical firewalls cannot. The Dockerfile and script herein builds NGINX and ModSecurity from their sources inside a container, then uploads three config files. These files are configured with the defaults settings on.

  • nginx.conf – This is the NGINX configuration file that contains the directives for load balancing and reverse proxying.
    • Line 44 starts the section about enabling and disabling ModSecurity
    • Line 52 starts the section to configure the reverse proxy. For docker, this will usually be the name of the container that is being fronted by the app.
    • Line 53 contains the internal URL that nginx is proxying.
  • modsecurity.conf – this contains the configuration for modsecurity and some configuration for the defaults and exclusion of the rules used by mod security. Most everything in the modsecurity.conf file can be left as is.
    • Line 230 starts the configuration of the rules.
    • The rules are downloaded and installed (/usr/local/nginx/conf/rules) when the container is built. Individual rules can be disabled or enabled, or they can all be enabled.
  • crs-setup.conf – this configures the rules used by ModSecurity. The file has integrated documentation. Reading through this file explains what the settings are for. For more information about crs-setup.conf, visit OWASP's website.

Using the Dockerfile is simple. Change directories to the dockerfile, and build the image.

UPDATE: 6/8/2020

A new folder was added for ModSecurity 3.0

waf-2 is for ModSecurity 2 waf-3 is for ModSecurity 3

Everything else remails the same.


Multi-Stage Build:

docker build --tag mywaf .

Then run it.

docker run --name my-container-name -p 80:80 mywaf

This creates container.

Also, the image can be used with Docker Compose. The docker-compose.yml isa simple example that will deploy a simple node application along with the WAF. Change directories to the docker compose file, then run.

docker-compose up

Use with Kubernetes

It is possible to use the WAF with Kubernetes too. In short, you create a deployment and load balancer service with the WAF, then use the WAF to connect to your applicaiton running on a deployment with a a cluster IP service. Reference the kube.yml file in the code for specifics.

Then use kubectl to deploy the kube.yml file to your Kubernetes environment.

kubectl create -f kube.yml
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].