A Web Application Firewall (WAF) is a security solution that monitors, filters, and blocks HTTP(S) traffic to and from a web application. It protects applications from common web threats by inspecting requests at the application layer (Layer 7) of the OSI model.

Unlike traditional firewalls, which focus on network-level protection, WAFs are tailored to detect and block web-specific attacks like SQL injection, cross-site scripting (XSS), and CSRF.

How WAFs Work

WAFs sit between users and web applications, acting as a reverse proxy that intercepts incoming traffic:

User → WAF → Web Application

They inspect requests and responses based on rules, heuristics, or machine learning models, allowing or blocking them based on patterns.

Types of WAF Deployments

TypeDescriptionExample Use
Network-basedDeployed at the perimeter, hardware or VMHigh-performance, low latency
Host-basedInstalled directly on the application serverDeep integration, customizable
Cloud-basedManaged services via CDN or cloud providerScalable, easy to deploy

Common Features

  • Predefined rule sets (e.g., OWASP Top 10 protections)
  • Custom rule creation
  • Real-time traffic monitoring and logging
  • Rate limiting and throttling
  • Bot mitigation
  • Geo-blocking
  • Virtual patching (blocking known vulnerabilities at request level)
  • DDoS protection (limited)