Mad World #Save_GAZA: Free Palestine  

Search

Choosing an Open-Source Web Application Firewall for a Self-Hosted App

Choosing an Open-Source Web Application Firewall for a Self-Hosted App

You'll compare reverse-proxy integration, detection-only logging, and the documented controls for tuning rules when choosing an open source web application firewall. BunkerWeb wraps the WAF into its own reverse proxy, while Coraza CRS Docker containers add inspection in front of a backend you already run. Neither project documents a tested deployment, measured false positives, or quantified maintenance effort for this article.

Check how BunkerWeb and Coraza fit in front of your app

BunkerWeb is a full web server built on NGINX and integrates as its own reverse proxy. It supports Linux, Docker, Swarm, and Kubernetes. Coraza CRS Docker offers three proxy variants: Caddy (Alpine), nginx (Debian, non-root), and Apache (Debian). All three forward inspected traffic to a backend service you specify via BACKEND=myapp:8080. The Coraza container becomes your front-end proxy; your existing application remains the backend. If you prefer the WAF and proxy bundled together, BunkerWeb provides that in a single container.

Enable detection-only mode and review logged events

Coraza CRS Docker documents CORAZA_RULE_ENGINE with three settings: On, Off, and DetectionOnly. Detection-only mode logs matches without blocking. The audit engine defaults to RelevantOnly, writing to /dev/stdout in JSON. You can change CORAZA_AUDIT_LOG_RELEVANT_STATUS to adjust which HTTP status codes trigger a log entry. Settings vary across the Caddy, nginx, and Apache variants—not every variable maps identically to each proxy's configuration. BunkerWeb's documentation confirms Docker, Swarm, Kubernetes, and Linux support, but the sources do not detail a detection-only mode or audit-logging controls for this article.

A workflow for a small operator would start with choosing a Coraza variant and a reachable backend, setting CORAZA_RULE_ENGINE=DetectionOnly, then inspecting container logs via docker logs to identify which rule IDs match benign requests before switching to On. This workflow was not tested for this article.

Identify the controls available for rule tuning

Coraza CRS Docker supports rule overrides in /opt/coraza/overrides. You can mount custom configuration files at that path and filter logs by rule ID. The container accepts environment variables for paranoia level (PARANOIA), blocking paranoia (BLOCKING_PARANOIA), and anomaly score thresholds (ANOMALY_INBOUND, ANOMALY_OUTBOUND). The README explains that CORAZA_TAG is no longer applied because recent Coraza rejects metadata actions in SecDefaultAction; to tag rules now, you set the tag action on the rules themselves.

BunkerWeb offers a web UI and CLI configuration. The supplied sources confirm integration flexibility and a "secure by default" approach, but they do not document specific rule-tuning paths, false-positive filtering procedures, or log-analysis workflows for this article.

Deploy a test container and inspect the first events

Start with a Coraza CRS Docker variant that matches your environment. The BunkerWeb README documents version 1.6.16; Coraza CRS Docker's README warns that rolling image tags should not be used in production and lists stable tags in the format <CRS version>-<variant>-<date>, for example 4.25.0-nginx-202509051009. Pin a stable tag, set CORAZA_RULE_ENGINE=DetectionOnly, and direct a sample of your application's traffic through the container. Review the JSON audit logs for rule IDs that match legitimate requests, then write overrides or adjust thresholds before enforcing blocks. The sources do not establish a real-traffic test procedure, measure blocked attacks and false positives, quantify installation or maintenance effort, verify update processes, compare protection performance, or establish when a managed WAF is simpler.

Verification status: Supported by official documentation only under the conditions below; not reproduced in a test environment by IGPROD. Checked 2026-10-20.

Applies to: 1.6.16.

Conditions:

  • The cited Coraza deployment uses Docker containers that forward traffic to a backend service.
  • Coraza container settings do not all map identically across its Caddy, nginx, and Apache variants.

Sources:

Yassine

Yassine runs IGPROD and has written about Synology NAS, Docker and self-hosting here since 2022. About IGPROD

Leave a comment

Your email address will not be published. Required fields are marked *

Your experience on this site will be improved by allowing cookies Cookie Policy