BunkerWeb — Open-Source Web Application Firewall
BunkerWeb is an NGINX-based reverse proxy and next-generation Web Application Firewall with ModSecurity rules, anti-bot challenges, and automatic Let's Encrypt for containerized apps.
What it is
BunkerWeb is an open-source Web Application Firewall (WAF) built on NGINX. It functions as a reverse proxy that adds security layers including ModSecurity OWASP Core Rule Set, rate limiting, bot detection, country blocking, automatic HTTPS via Let's Encrypt, and custom security plugins. BunkerWeb protects any web application regardless of its tech stack.
DevOps engineers and development teams who need to secure web applications against common attacks (SQL injection, XSS, CSRF, DDoS) without purchasing commercial WAF products benefit most.
How it saves time or tokens
BunkerWeb bundles security features that typically require configuring multiple tools separately: NGINX for reverse proxy, ModSecurity for WAF rules, Certbot for TLS certificates, fail2ban for rate limiting, and custom scripts for bot detection. BunkerWeb provides all of these through a single configuration file or web UI. Deployment takes minutes with Docker, and the OWASP Core Rule Set provides baseline protection without writing custom rules.
How to use
- Deploy BunkerWeb with Docker:
docker run -p 80:8080 -p 443:8443 \
-e SERVER_NAME=app.example.com \
-e REVERSE_PROXY_URL=/ \
-e REVERSE_PROXY_HOST=http://backend:8080 \
-e AUTO_LETS_ENCRYPT=yes \
-e USE_MODSECURITY=yes \
bunkerity/bunkerweb:latest
- BunkerWeb sits in front of your application, handling TLS termination, WAF filtering, and reverse proxying.
- Access the web UI at
https://app.example.com:7000to manage settings and view security logs.
Example
# docker-compose.yml with BunkerWeb protecting a web app
services:
bunkerweb:
image: bunkerity/bunkerweb:latest
ports:
- '80:8080'
- '443:8443'
environment:
- SERVER_NAME=app.example.com
- REVERSE_PROXY_URL=/
- REVERSE_PROXY_HOST=http://myapp:3000
- AUTO_LETS_ENCRYPT=yes
- USE_MODSECURITY=yes
- USE_BAD_BEHAVIOR=yes
- LIMIT_REQ_RATE=10r/s
- USE_COUNTRY=yes
- BLACKLIST_COUNTRY=CN RU
myapp:
image: my-web-app:latest
expose:
- '3000'
Related on TokRepo
- Security Tools -- Web security and vulnerability scanning tools
- DevOps Tools -- Infrastructure and deployment tools
Common pitfalls
- ModSecurity rules can produce false positives, blocking legitimate requests. Start with the OWASP rules in detection-only mode, review logs, then switch to blocking mode after tuning.
- Rate limiting settings need calibration for your traffic patterns. Too aggressive settings block real users; too lenient settings do not stop attacks.
- BunkerWeb adds latency as a reverse proxy layer. For latency-sensitive applications, benchmark the overhead and adjust worker/connection settings.
Frequently Asked Questions
Yes. BunkerWeb is open source. The community edition includes all core security features. A PRO version adds advanced features like a management UI, clustering, and premium support.
Yes. Set AUTO_LETS_ENCRYPT=yes and BunkerWeb obtains and renews TLS certificates from Let's Encrypt automatically. No manual certificate management required.
BunkerWeb protects against SQL injection, cross-site scripting (XSS), CSRF, directory traversal, bot traffic, DDoS (via rate limiting), and other OWASP Top 10 vulnerabilities through ModSecurity rules.
Yes. Configure multiple SERVER_NAME entries and REVERSE_PROXY rules in the config. Each application gets its own security settings. BunkerWeb routes requests to the correct backend based on hostname.
Yes. BunkerWeb provides a Kubernetes Ingress Controller that integrates with K8s clusters. Security policies are applied via annotations on Ingress resources.
Citations (3)
- BunkerWeb GitHub Repository— BunkerWeb is an NGINX-based open-source WAF
- BunkerWeb Documentation— OWASP ModSecurity Core Rule Set integration
- OWASP Top 10— OWASP Top 10 web application security risks
Related on TokRepo
Discussion
Related Assets
HumHub — Open-Source Enterprise Social Network
A flexible, open-source social networking platform built on Yii2 for creating private communities, intranets, and collaboration spaces within organizations.
Dolibarr — Open-Source ERP & CRM for Business Management
A modular open-source ERP and CRM application written in PHP for managing contacts, invoices, orders, inventory, accounting, and more from a single web interface.
PrestaShop — Open-Source PHP E-Commerce Platform
A widely adopted open-source e-commerce platform written in PHP with a rich module marketplace, multi-language support, and a strong European user base.