Lesson 18 of 35WAFWAF

What is WAF?WAF & API Security explained

Sits in front of web applications and APIs to block common attacks like SQL injection in real time, and — because so much traffic is now API calls instead of web pages — discovers and protects every API endpoint, including the ones nobody documented.

By Reviewed

Verified Sources: cloudflare.com, checkpoint.com, paloaltonetworks.com

The lesson

How a web app tells a real request from an attack

Every public website and API is probed around the clock by scripts hunting for one careless line of code. This lesson shows how a filter in front of the app decides which requests get through — and why the doors nobody documented matter most.

If it helps, think of it as… the receptionist and the side doors

A busy office has a receptionist who screens every visitor at the front entrance — checking who they claim to be and what they're carrying. But offices grow side doors: a loading dock, a back stairwell someone propped open for deliveries. The modern job isn't just screening the lobby; it's finding every unlisted door and putting a guard on each one.

Request arrives

From a browser, mobile app, or bot

Inspect the payload

Injection, scripting, known exploit patterns

Check shape & behavior

API schema, rate limits, bot signals

Forwarded to the app

Looks like legitimate use

Blocked & logged

Matches an attack or breaks the rules

Each incoming request is inspected for attack patterns, checked against the API's declared shape, and passed or blocked.

What it does

A web application firewall (WAF) sits directly in front of a website or API and inspects every incoming request before the application sees it. Where a network firewall decides which connections may reach a server at all, a WAF reads the content of web requests — the URL, the form fields, the data payload — and blocks the ones that look like attacks: database syntax stuffed into a login box, script planted in a comment, a known exploit pattern aimed at the software you run.

The "API security" half reflects how apps changed. Most web traffic is no longer people clicking pages — it's software calling APIs (application programming interfaces, the structured request formats apps use to talk to each other). Modern platforms therefore also discover every API endpoint in use, including forgotten ones, and police how each is used.

The attack it stops

Within hours of a serious flaw being published in a popular web framework, automated scripts begin sweeping the internet, firing the exploit at every server they can find. Your team may need days to patch. A WAF closes that gap: a rule matching the exploit's pattern blocks the attempts in the meantime — a stopgap called virtual patching.

The subtler save involves shadow APIs — endpoints running in production that nobody documented or remembers. A mobile app's old v1 API still answers requests years after the new version shipped, and it skips the new authorization checks. An attacker who finds it can page through customer records one ID at a time, politely and slowly, with requests that look individually legitimate. API discovery finds that endpoint and puts it behind the same scrutiny as the front door.

How it works, step by step

  1. Traffic to the application is routed through the WAF first — often as a cloud service sitting in front of your servers.
  2. Each request is checked against attack signatures covering the OWASP Top 10, the standard list of critical web application risks, plus rules for specific known exploits.
  3. API requests get an extra test: does this request match the API's declared schema — right endpoint, right fields, right types? Anything off-shape is rejected.
  4. Behavioral checks look beyond single requests: rate limits throttle clients making too many calls, and bot detection separates humans from automated tools scraping data or testing stolen passwords.
  5. Everything blocked and allowed is logged, and observed traffic continuously updates the API inventory — surfacing new and shadow endpoints.

What it doesn't do

A WAF shields vulnerabilities; it doesn't fix them. The flawed code is still there, and determined attackers try encodings and variations that slip past rules. Business-logic abuse — requests that are perfectly well-formed but shouldn't be allowed, like changing the price field in your own order — is largely invisible to signature-based inspection.

The common beginner misconception is treating a WAF as an alternative to secure code. It's a seatbelt, not a substitute for driving well: essential, and never sufficient on its own.

How it fits the stack

The flaws a WAF shields in production are the ones static testing and dynamic testing try to catch before release — the three form one pipeline, from code review to live defense. WAFs are also usually bundled with DDoS protection, since the same front-door position that inspects requests is the right place to absorb floods of them.

Terms you just met

Each links to its plain-language definition in the glossary.

The field guide

Evaluating this category

A second pass for buyers: market context, distinctions that matter, and what to weigh when tools in this category start looking alike.

A web application firewall sits directly in front of an application, inspecting every request before it reaches the code behind it, and blocks the ones that look like known attack patterns — in real time, with no code changes required. It's a compensating control: a shield in front of the application rather than a fix to it.

Traffic has shifted heavily toward APIs rather than rendered web pages, and APIs fail differently — the danger is as often a legitimate-looking request hitting an endpoint nobody documented as it is an obviously malicious payload, so this category has grown to cover discovering and protecting that whole API surface, not just blocking classic web attacks.

The problem it solves

Even a well-built application can be running a vulnerability nobody has found yet, and patching every application the moment a threat emerges isn't realistic across a large environment — a control that blocks known attack patterns at the edge buys time no patch schedule can.

APIs raise a distinct problem: they multiply fast, get built and deployed without a security review, and often go undocumented entirely. An API that isn't known to exist can't be protected by anything, and that shadow surface is exactly where a lot of real exposure now sits — not in the applications everyone remembers to secure, but in the ones nobody wrote down.

How it works

A WAF inspects incoming requests against rules and signatures tuned to known attack patterns — malicious SQL fragments, script injection, path traversal — blocking anything that matches before it reaches the application. Because attackers constantly vary their payloads, rule sets need frequent updates and enough tolerance to avoid blocking legitimate traffic that merely looks unusual.

API-focused protection starts by building an inventory: passively observing traffic to discover every endpoint actually in use, including ones never documented, then comparing that against whatever specification exists to flag gaps. Traffic can be validated against a declared schema, rejecting requests that don't match the API's own contract regardless of whether they match a known attack signature. Because APIs are often abused through legitimate-looking requests sent at abnormal volume rather than one malicious payload, this layer also distinguishes human from bot traffic, throttles excessive request rates, and watches live traffic for data leaving through oversized responses.

WAF vs API security

Traditional WAF logic is built around known attack signatures in individual requests — it's very good at blocking a payload that matches a known bad pattern. API security is built around the shape of legitimate use — discovering what exists, validating traffic against a declared contract, and noticing abuse that looks like normal requests sent the wrong way or too often. A signature-based WAF won't catch an authenticated user quietly scraping a dataset through an undocumented endpoint one legitimate-looking call at a time; API-aware protection is built specifically to catch that kind of abuse.

Choosing one

Start with deployment fit: protection needs to sit wherever traffic actually flows, whether in front of a public website, behind a CDN, or alongside internal service-to-service traffic. A tool that only covers the first misses most of what a modern architecture actually exposes.

Weigh API discovery quality heavily if the environment has grown organically — a stale, manually maintained inventory is close to useless, and this whole category's value depends on discovery actually finding what's really there. Finally, consider operational cost: aggressive blocking breaks real traffic and erodes trust in the tool, so look for how much tuning a candidate realistically requires before a team will leave it in blocking mode.

Capability taxonomy

What buyers typically evaluate when comparing tools in this category.

Attack signature blocking
Blocks OWASP Top 10 style attacks like SQL injection and XSS at the edge.
API discovery
Automatically inventories known and shadow API endpoints from observed traffic.
Schema validation
Enforces that requests match the declared API schema, blocking anything that doesn't.
Bot management
Distinguishes automated and malicious bot traffic from legitimate users.
Rate limiting
Throttles abusive request volumes per client or endpoint.
Runtime API protection
Detects and blocks data leakage and abuse in live API traffic.

Tools in this category

Now that you know what WAF does, see who does it.

Search Cyber Tool Stack

Jump to any tool, vendor, category, or glossary term.