Setting up a Web Application Firewall (WAF) with Docker Compose

Modern web applications face a wide range of attack vectors, from SQL injection and XSS to remote code execution. A Web Application Firewall (WAF) inspects and filters HTTP traffic before it reaches your app, adding a safety net alongside secure coding, patching, and least-privilege deployments. It helps reduce exploit windows (virtual patching) while you remediate upstream. Here you’ll build a lightweight proof-of-concept with Docker Compose that layers ModSecurity v3 and the OWASP Core Rule Set (CRS) in front of a simple Node.js backend. The goal is to stand up a fast, tweakable lab: run CRS defaults, add one custom rule, observe logs, and understand how to move between DetectionOnly and blocking. ...

May 19, 2025 · 6 min · 1252 words · Deadloop