A WAF (Web Application Firewall) sits directly in front of your website and APIs. It understands the content of web requests, checking URL parameters, form fields, cookies, and API data for attack payloads. It sits in a different place from a firewall or a CDN, and it looks at different things.
Think of your IT system as an office building. The gate guard controls who can enter the building. The website is the one office inside the building that's open to outside visitors, and it has its own front-desk security who only watches people entering that office and checks whether the forms they fill in carry anything harmful. Regional reception outposts let visitors check in closer to home, and fake visitors get absorbed there. These three roles are the firewall, the WAF, and the CDN.
Each one sits in a different position, and none can substitute for the others.
| Aspect | Firewall | WAF | CDN edge protection |
|---|---|---|---|
| Protection layer | Network layer: the connection itself | Application layer: the content of web requests | Network edge: handled before traffic reaches your data center |
| What it understands | Source address, port, protocol | URL parameters, form fields, cookies, and API data | Where traffic comes from and how much of it there is |
| What it blocks | Sources and ports outside the allowed range | SQL injection, cross-site scripting, malicious bots, credential stuffing, API abuse | Floods of fake traffic (DDoS), absorbed before they reach the data center |
| Where it sits | At the entry point of the data center or office network | Directly in front of the website and API | On distributed nodes closest to users |
Looks at the source address and port of a connection and decides whether to allow or block the whole thing. It doesn't look at content.
Understands the content of a web request: URL parameters, form fields, cookies, and API data, checking whether it carries attack payloads.
Puts website content on the node closest to the user, so visitors check in nearby; fake traffic gets absorbed here.
The firewall handles connections, the WAF handles content, and the CDN handles traffic volume. Most businesses already have a firewall; what they're missing is the layer that understands web page content.
For a website to operate, its public web port has to stay open to the whole world. An attacker doesn't need to force a door. They walk straight through the front entrance, using a web request that looks identical to any regular visitor's. To the firewall, that's just normal web traffic, so it lets it through.
The difference is hidden in the form fields. A firewall doesn't parse web page content and doesn't know which field feeds into a database; it can't tell whether the "product name" box contains "ballpoint pen" or a database command. The gate guard doesn't flip through the papers a visitor is carrying.
"I have an SSL certificate, so I'm safe": a certificate encrypts the transmission, protecting it from being intercepted along the way, but it doesn't check whether the content is good or bad. An attack payload can just as easily arrive encrypted.
"My site is too small for anyone to attack": most attacks aren't targeted at you specifically. Scanners knock on doors across the internet, checking which ones are unlocked.
"We already have a firewall": the two operate at different layers. The generic web rules bundled with a next-generation firewall aren't tuned to your website's specific fields.
"A CDN means I have a WAF": a CDN delivers content from nearby nodes and absorbs floods of fake traffic; inspecting request content takes WAF rules. Some CDN services let you add WAF features, but check that they are actually enabled and configured. Connecting a CDN doesn't give you them automatically.
"Once the WAF is installed, I can forget about it": after a site redesign or new APIs or form fields, the rules need to be adjusted too. A new deployment also usually needs an observation period to deal with legitimate users being blocked by mistake.
How to fit the three layers of protection into your existing architecture depends on where your traffic comes from and the state of your data center.
View Web & API Protection (WAF) How to choose among the three protection layers Ask about protection planning