A web application firewall (WAF) filters HTTP traffic between clients and a web application and blocks requests that look like attacks. OWASP describes it as “an application firewall for HTTP applications” whose rules typically target threats such as cross-site scripting (XSS) and SQL injection.
How it works
A WAF sits in front of the application: in a CDN, a cloud load balancer, a reverse proxy or a web server module. It inspects each request’s URL, headers, cookies and body, and sometimes the response, against rules:
- Signature rules match known attack patterns. The open-source OWASP Core Rule Set is a generic set of these for ModSecurity and compatible WAFs.
- Custom rules block or allow by path, method, country, IP list or header.
- Rate limits cap how often a client can hit an endpoint.
Matching requests are blocked, logged or challenged.
WAF versus bot management
A WAF asks whether a request is malicious. Bot management asks who or what is sending it. Credential stuffing, scraping and scalping use perfectly valid requests, so payload rules don’t see them, and IP rules fail against residential proxies. Catching them takes fingerprinting, behavior and challenges.
Some vendors sell bot management as an add-on to a WAF, others as a separate product. Both layers can help against layer 7 DDoS floods.
Use the bot protection checker to see which WAF or bot protection a site uses, and the feature matrix to compare what vendors document.