Using WAFs
A WAF is a layer 7 device (in the OSI 7 layer model), meaning it operates at the highest layer, namely the application layer. This means that a WAF can interpret HTTP traffic, analyze the payload for threats, and block the traffic accordingly. Physically, a WAF operates like a reverse proxy, being located immediately in front of the terminating device (which it is protecting) and receiving all traffic destined for said terminating device. The WAF processes only incoming requests and does not process the response from the server. Figure 11.1 shows a simplified deployment diagram of a WAF with a rule set filtering API requests to a server.
Figure 11.1 – WAF topology
A WAF is configured with a rule set that defines the specific rules and policies to be applied. Such rule sets can be defined by the WAF vendor, the community (for example, OWASP defines a rule set for the ModSecurity WAF engine), or by the security team in the organization...