Chapter 40D — WAAP: bots, API discovery, and edge enforcement
In one sentence
Web Application and API Protection (WAAP) is the industry's name for combining a WAF with bot management, automated API discovery, schema enforcement, and Layer 7 DDoS mitigation into one platform, because a signature-based WAF alone has nothing to say about automated abuse, undocumented APIs, or traffic that is individually well-formed but collectively malicious.
Where we are
Chapter 40C's WAF stops malformed, signature-matching payloads. This chapter is everything a WAF structurally can't do: tell a human from a script, find the API endpoints nobody documented, and stop an attack that looks like thousands of perfectly legitimate requests.
How it works
Why WAF alone stops being enough for modern APIs:
A WAF reasons about individual requests against known-bad PATTERNS.
It has no answer for:
- CREDENTIAL STUFFING: valid-looking login requests, correctly
formatted, using STOLEN (but syntactically perfect) credentials --
there's no "attack signature" to match.
- SCRAPING: a script systematically pulling every product/profile
page at human-plausible request rates, spread across many
source IPs.
- SHADOW/ZOMBIE APIs: an old API version, a debug endpoint, or a
partner-only route that's still live in production but was never
inventoried, documented, or included in the WAF's own rule scope --
a WAF can only protect what it knows exists.
- GRAPHQL/gRPC-SHAPED ABUSE: a single, well-formed GraphQL query can
request an enormous, expensive result set (Part 6's complexity-
limit discussion) -- nothing about the REQUEST'S SYNTAX looks
malicious.
WAAP is the market's answer: fold BOT MANAGEMENT, API DISCOVERY, and
API-SCHEMA-AWARE enforcement into the same edge platform as the WAF.
The components:
BOT MANAGEMENT
- FINGERPRINTING: TLS/JA3/JA4 client fingerprinting (identifying the
TLS library/stack making the request, independent of the User-
Agent header, which is trivial to fake), HTTP/2 fingerprinting,
browser-execution challenges (does this client actually run
JavaScript like a real browser?).
- BEHAVIOURAL ANALYSIS: request timing/rhythm, navigation patterns,
mouse/touch telemetry on the client side -- distinguishing a human
from a script even when the script fakes a plausible User-Agent
and rate.
- CLASSIFICATION AND POLICY: allow known-good bots (search engine
crawlers, uptime monitors -- verified by reverse-DNS/IP-range,
not just a claimed User-Agent), CHALLENGE ambiguous traffic
(CAPTCHA, a JS proof-of-work), and BLOCK confirmed-bad traffic
(known botnet ranges, confirmed credential-stuffing signatures).
API DISCOVERY AND INVENTORY
- passively observes ALL traffic through the edge and builds a
CATALOGUE of every endpoint, method, and parameter actually being
called -- including ones NOBODY documented.
- flags DEPRECATED endpoints still receiving live traffic, and
UNDOCUMENTED endpoints with no matching entry in your OpenAPI
spec -- this is the direct, practical answer to OWASP
API9:2023 "Improper Inventory Management" (Ch 40E).
- can compare observed traffic AGAINST your published API spec and
flag drift (a field being sent that isn't documented, an endpoint
accepting a method it shouldn't).
SCHEMA ENFORCEMENT AT THE EDGE
- ingest your OpenAPI/GraphQL schema directly into the edge platform
and enforce it there -- the Ch 40A payload-validation discipline,
applied BEFORE traffic even reaches your gateway, catching
malformed/unexpected payloads at the network edge.
L7 (APPLICATION-LAYER) DDoS PROTECTION
- distinct from L3/L4 volumetric floods (raw packet/connection
volume, which a network-layer scrubbing service handles): an L7
attack sends a FLOOD OF VALID-LOOKING REQUESTS (e.g. a search
endpoint hit millions of times with varying, legitimate-looking
queries) that overwhelms application capacity while looking, to a
naive filter, like real traffic. Distinguishing this from a
genuine traffic spike needs the SAME bot-management/behavioural
signals as credential-stuffing detection.
CLIENT-SIDE / SUPPLY-CHAIN PROTECTION
- monitors the JAVASCRIPT actually running in users' browsers for
unauthorised changes -- catching FORMJACKING/MAGECART-style
attacks (a compromised third-party script skimming payment-form
data client-side) that live entirely outside your own server-side
WAF's view. This is G1 Ch 47's supply-chain concern, applied to
the BROWSER rather than the build pipeline.
Products, so the landscape is concrete: Cloudflare (WAF + Bot Management + API Shield as one integrated product), AWS (WAF + Shield + newer API-Gateway- native protections), Akamai (App & API Protector), F5 Distributed Cloud, Imperva, and API-security-specialist platforms that were built API-discovery- first (Salt Security, Noname Security — both later acquired into larger security platforms, reflecting the market consolidating around exactly this "WAF plus API-aware discovery" combination).
Worked example
The exposed test API that nobody was watching — the API9:2023 pattern, at real scale.
In 2022, a large Australian telecommunications provider (Optus)
experienced a breach affecting roughly 10 million current and former
customers' records (names, dates of birth, addresses, phone/passport/
driver's-licence numbers in various combinations depending on the
record). Widely reported details of the incident describe an
internet-reachable API that required NO AUTHENTICATION to query
customer records at scale -- an API that, by its exposure and lack of
basic access control, was clearly not being tracked, monitored, or
protected the way the organisation's OTHER, better-known customer-
facing APIs presumably were.
THIS IS THE TEXTBOOK "SHADOW API" FAILURE MODE: an endpoint that
exists, is reachable, and does real damage when abused -- but isn't in
anyone's inventory, isn't covered by the WAF's tuned rule set (because
nobody configured rules for an API they didn't know was live), and
isn't rate-limited or authenticated the way a properly-tracked,
security-reviewed endpoint would be.
WHAT A WAAP'S API-DISCOVERY CAPABILITY SPECIFICALLY ADDRESSES:
- passive traffic observation would have SURFACED this endpoint as
"receiving real production traffic" regardless of whether it was
in anyone's documentation.
- a policy of "every discovered endpoint must be explicitly
reviewed, classified, and either brought into the authentication/
rate-limiting baseline or decommissioned" turns "we didn't know it
existed" from a plausible excuse into an actively-caught finding.
- this is precisely Part 7 Ch 41's data-classification-and-inventory
discipline, applied to the API SURFACE ITSELF rather than to data
stores -- and it's why API9:2023 exists as its own numbered item in
the OWASP API Security Top 10 (Ch 40E) rather than being folded
into general misconfiguration.
THE FIX PATTERN: continuous API discovery (WAAP platform, or a
self-built traffic-observation pipeline feeding your Part 8 telemetry
stack) + a hard policy that NO endpoint goes live without being in the
inventory + a scheduled audit comparing "endpoints receiving traffic"
against "endpoints in the documented, security-reviewed inventory,"
with any drift treated as a P1 finding (Ch 59), not a documentation
backlog item.
Real-world scenario 2: automated abuse of a legitimate, under-throttled feature
In April 2021, a dataset covering roughly 533 million Facebook
accounts -- phone numbers linked to names, locations, and other
profile fields -- surfaced publicly, compiled from data scraped years
earlier. Facebook's own public statements traced the underlying
technique to a CONTACT-IMPORTER / "Find Friends"-style feature: a
perfectly legitimate capability (helping a real user find contacts
already on the platform by matching phone numbers) that had
insufficient throttling and bot detection on how many lookups a
single automated actor could perform. Attackers ran large-scale,
automated queries through this legitimate feature -- not by
exploiting a coding bug in the classic sense, but by using the
feature exactly as designed, at a volume and automation level no real
user would ever generate. Facebook stated the underlying issue had
been addressed by 2019, but the previously-harvested data continued
to circulate and resurface afterward.
WHY THIS IS A WAAP CHAPTER EXAMPLE, NOT A WAF ONE: every individual
request in this pattern was SYNTACTICALLY PERFECT -- a well-formed
call to a legitimate, intentionally-public API, with a valid phone
number and no injection payload anywhere in sight. Nothing about ANY
SINGLE request matches a WAF signature. What's anomalous is the
AGGREGATE PATTERN: an enormous request volume from automated,
non-human clients systematically working through phone-number space
-- precisely the shape of abuse this chapter's BOT MANAGEMENT layer
(fingerprinting non-browser clients, behavioural analysis, and
escalating challenges as volume grows from a single fingerprint or
fingerprint cluster) exists to catch, and precisely the shape of
abuse Ch 40B's basic per-IP/per-key rate limiting alone is generally
too coarse to stop at this scale without also incorporating bot-
classification signals.
Real-world scenario 3: credential stuffing against consumer apps
Two separate, publicly documented incidents illustrate the SAME
underlying pattern at consumer scale: Dunkin' Donuts disclosed (and
was later the subject of a 2020 New York Attorney General
settlement, following an earlier 2015 incident) that attackers used
CREDENTIAL STUFFING -- automated login attempts using username/
password pairs stolen from OTHER, unrelated breaches -- to take over
customer loyalty accounts and drain stored gift-card balances.
Chick-fil-A separately disclosed in 2019 that mobile-app accounts
were compromised through the same technique, again enabling
fraudulent use of stored payment/loyalty balances.
IN BOTH CASES, THE LOGIN REQUESTS THEMSELVES WERE UNREMARKABLE: a
correctly-formatted username and password submitted to a legitimate
login endpoint. There is no payload for a WAF signature to match and,
often, no SINGLE account's login attempts exceeded a naive per-
account rate limit (Ch 40B) if the attacker tried each stolen
credential pair only once or twice per account before moving on to
the next. What made the traffic recognisable as an attack was:
- the SOURCE pattern: a volume and velocity of LOGIN ATTEMPTS
across a huge number of DIFFERENT accounts, consistent with an
automated credential-stuffing tool rather than real users typing
passwords (bot fingerprinting and behavioural analysis, this
chapter).
- the SUCCESS-RATE signature of credential stuffing specifically:
a low but non-zero hit rate against a large batch of attempted
username/password pairs, because SOME fraction of any large
stolen-credential list is reused by real account holders on the
targeted site (a detectable pattern -- an unusually high volume
of DISTINCT-username login attempts from related bot
infrastructure, most failing, a small percentage succeeding --
very different from a real user's behaviour and from a targeted
brute force against ONE account).
Rate limiting alone (Ch 40B) reduces the RATE of an attack like this;
it doesn't recognise the ATTACK PATTERN itself. Bot management --
this chapter's actual answer to credential stuffing -- is what
distinguishes "many different real users logging in slowly" from
"one automated tool trying many stolen credential pairs slowly,
specifically to stay under a naive rate limit."
Practice (60 min)
- If you have access to a WAAP platform (or a trial), enable API discovery against a real or lab environment's traffic for a period; review what it surfaces that isn't in your documented API inventory.
- Without a commercial platform: build a minimal self-hosted equivalent — parse your access/gateway logs for every distinct (method, path) pair observed over a week, and diff it against your OpenAPI spec's documented routes. Anything in the traffic but not the spec is a finding.
- Set up a basic bot-detection signal (even a simple one: flag requests with
no
Accept-Languageheader, a non-browser TLS fingerprint if your edge exposes it, or a JavaScript challenge for a sensitive form) and measure what fraction of your traffic it flags as likely-automated. - Write the "every endpoint must be inventoried before going live" policy as an actual CI/deployment gate (Ch 58): a new route that isn't present in the committed OpenAPI spec fails the pipeline.
- Identify one endpoint in a real system you have access to that hasn't been reviewed in over a year — treat it as a live audit and confirm it's still authenticated, rate-limited, and actually needed.
Across the series
- Bot detection in Go: the Go plan's Week 14. DDoS and edge defences (SYN floods, Slowloris, proof-of-work challenges, UDP amplification): Week 13, with the server-side timeouts measured in the HTTPS guide, Chapter 19.
Common mistakes
- Assuming the WAF's rule coverage extends to endpoints nobody told it about. It can only protect what's in scope; an undiscovered API is unprotected by definition.
- Treating bot management as "just CAPTCHA." Modern bot traffic mimics browsers closely enough that fingerprinting and behavioural signals matter far more than a single challenge page.
- No policy tying API discovery findings to action. Finding a shadow API is only useful if there's a mandatory next step (inventory it, secure it, or kill it) with an owner and a deadline.
- Confusing L7 DDoS with L3/L4 volumetric attacks. They need different mitigations; a network-layer scrubbing service does nothing against a flood of individually-valid application requests.
- Ignoring client-side/JavaScript supply-chain risk. A server-side WAF has zero visibility into a compromised third-party script skimming data in the user's browser.
- Deploying a WAAP platform and never reviewing what it discovers. The discovery capability is only valuable if someone acts on the drift it surfaces.
Check yourself
- Name three abuse patterns a signature-based WAF structurally cannot detect, and why each evades pattern matching.
- What is TLS/JA3 fingerprinting, and why is it more reliable than checking the User-Agent header?
- What does an API-discovery capability actually do, and which OWASP API Security Top 10 item does it directly address?
- L7 DDoS vs L3/L4 volumetric DDoS — how do they differ, and why does one need behavioural detection while the other doesn't?
- In the Optus-style shadow-API scenario, what specific policy turns "we didn't know it existed" into a caught finding rather than a recurring risk?
Further reading
- Term origin: Gartner's "Web Application and API Protection (WAAP)" market-category research (search for the current Magic Quadrant/Market Guide for WAAP — the term and category are actively evolving).
- Incident: public reporting and the Australian government/regulatory response to the 2022 Optus data breach — read multiple sources, as some technical specifics were disputed publicly during the investigation.
- Products: Cloudflare API Shield, AWS API Gateway's API-protection features, Akamai App & API Protector — their public architecture docs describe the discovery/schema-enforcement mechanics concretely.
- Standard: OWASP API Security Top 10, specifically API9:2023 "Improper Inventory Management" (Ch 40E covers the full list).
- Incident: contemporary 2021 reporting on the 533-million-account Facebook dataset (Business Insider's initial report and Facebook's own public statements on the contact-importer technique and its 2019 fix) — read Facebook's own account alongside independent reporting.
- Incident/regulatory: the New York Attorney General's 2020 settlement announcement regarding Dunkin' Donuts' handling of credential-stuffing attacks, and Chick-fil-A's 2019-2020 public breach notifications — both searchable via their official press releases, good primary sources on the business impact of credential stuffing specifically.