An ordinary firewall looks at addresses and ports, whereas a WAF understands HTTP: it reads parameters, headers and the request body and decides whether a request looks like an attack. A proxy usually protects the client, while a WAF is put in place to protect a specific application — either in front of it, at the entry point of the infrastructure, or right in the web server.
How it works
Rules describe dangerous constructs: a quote mark in a parameter, a script in a form field, SQL keywords. The engine applies them to every request–response pair and, depending on the mode, either blocks the request or only flags it in the log. Adoption often starts in logging mode: first statistics are collected and the rules are tuned, then blocking is switched on.
The best known rule set is the OWASP Core Rule Set (CRS): open, general-purpose rules against typical attacks. Strictness is tuned through the “paranoia level”, from 1 to 4: level 1 gives almost no false positives, and each higher level catches more attacks but is also more likely to raise alerts on legitimate traffic. A high level without tuning to the application turns into a stream of false alarms.
Where it runs
| Type | Where it runs | Example |
|---|---|---|
| Web server module | inside Apache, Nginx and IIS | ModSecurity |
| Library | embedded in an application or a gateway | Coraza |
| Dedicated node | a hardware appliance or a cloud service in front of the application | commercial WAFs |
Engines and rules
ModSecurity is the best known engine: started in 2002 as an Apache module, it now filters HTTP in Nginx and IIS alike; in 2024 the project was handed over from Trustwave to OWASP. Coraza is an engine written in Go that understands the same SecLang rule format. Thanks to the shared format, CRS rules are portable between engines, and rules of one’s own are written for a particular application: tuning them can be a substantial job, and they have to be maintained as the application changes.
Limitations
A WAF is a rule-based filter: it catches known attack patterns but does not replace secure code. It knows nothing about the application’s logic, so false positives are dealt with using exception rules, and bypassing the rules is the norm rather than a failure. It is most useful in combination: fixing vulnerabilities, rate limiting and log review.
Sources
the term is written from these pagesVerified 9 Nov