API Shield — Full Curriculum

Personal study reference, not customer-facing. Built to answer anything that could come up on a real call — what it actually does, how each feature works mechanically, the plan reality (Enterprise-only), and the single most important and most-missed fact: almost everything here only detects, it doesn't block, until you wire up a separate WAF rule. Every fact below is sourced from live Cloudflare docs (full list at the bottom).

Module 1Fundamentals — what API Shield actually is

API Shield is Cloudflare's API security and management product — discovery, a positive security model (schema, mTLS, JWT), and abuse/vulnerability detection, all at the same edge as your WAF and bot management. The single most important mental model to internalize before anything else:

Detection and mitigation are separate. Most of API Shield's features — Schema Validation, Schema Learning, BOLA detection, Authentication Posture, Zombie API detection — only flag a problem. They do not block a single request on their own. You always need a separate WAF Custom Rule (referencing a specific field the feature exposes) to actually act on what's been detected. This trips people up constantly: turning on Schema Validation and expecting bad requests to start getting blocked is the single most common wrong assumption on a first call.

Why API security is a distinct problem from WAF

Traditional WAFs catch payload-level attacks — SQL injection, XSS — inside a request. They don't catch a script enumerating /users/1, /users/2, /users/3 at machine speed, a malformed JSON body with an extra trusted field, or an endpoint nobody on the security team even knows exists. API Shield is built specifically for the shape and behavior of API traffic, not just payload content — both run in the same Cloudflare engine and are meant to complement each other, not replace one another.

The OWASP API Security Top 10 — what maps to what

OWASP API riskWhat addresses it
Broken Object Level Authorization (BOLA)BOLA vulnerability detection (Module 5)
Broken AuthenticationJWT Validation, mTLS, Authentication Posture (Modules 5 & 7)
Excessive Data ExposureSensitive Data Detection ruleset (separate subscription, Module 5)
Lack of Resources & Rate LimitingRate Limiting, Volumetric Abuse Detection (Module 4)
Mass AssignmentSchema Validation (additionalProperties: false, Module 3)
Improper Assets ManagementDiscovery, Zombie API detection (Modules 2 & 5)

Full feature list

Discovery · Schema Validation · Schema Learning · JWT Validation · mTLS · Sequence Analytics · Sequence Mitigation · Volumetric Abuse Detection · Authentication Posture · BOLA vulnerability detection · Vulnerability Scanner (DAST, open beta) · Zombie API detection. All of these live under the umbrella of Web Assets in the dashboard (Security → Web Assets → Operations) — Cloudflare's newer, consolidated inventory view that replaced the older per-feature dashboard pages.

Module 2Discovery & endpoint management

"You can't protect what you don't know exists." Most companies cannot list every API endpoint they expose — developers ship new ones weekly, old ones never get decommissioned, there's no central inventory. Discovery solves the inventory problem first, before anything else in this document makes sense.

How it actually works

Cloudflare applies heuristic path normalization to sampled, qualifying traffic — grouping requests by path structure and variable-like segments. api.example.com/profile/238 and api.example.com/profile/392 get grouped into one endpoint: /profile/{var1}. The {varN} placeholders are generated identifiers, not semantic names. Cloudflare can also consolidate the same normalized path across compatible subdomains — e.g. us-api./de-api./fr-api.example.com/api/v1/users/{var1} can collapse into {hostVar1}.example.com/api/v1/users/{var1}.

Operation states — this is the part people get wrong

StateMatched at the edge?What it supports
CandidateYesCan provide operation context for logs, rules, analytics, detections — but not full profile/risk features
ShadowNoDiscovered but not yet matched — lowest-confidence state
FullYesSaved by a human action ("Learn profile") — supports persisted API profiles, risk findings, and every protection that requires a known endpoint

You do not need to save every discovered operation — candidate operations already provide useful matching context on their own. Only promote an operation to full (via "Learn profile") when you actually want the deeper protections.

A real system limit to know: Cloudflare sends up to 3,000 operations per zone to the edge for matching. Full-state operations are prioritized first, then candidates. On a genuinely huge API surface, this is a real ceiling worth knowing about before promising unlimited endpoint coverage.

Discovery requirements (all must be true)

Discovery uses multiple signals including machine learning and any configured session identifiers (Module 4) — a session identifier is optional for Discovery to function, but improves its accuracy.

Once it's enabled — what to actually do, step by step

This is the practical day-1 checklist for a customer who just turned on API Shield. Everything below happens in one place: Security → Web Assets → Operations.

  1. Don't expect anything on day one. Discovery needs an endpoint to clear the requirements above (500+ requests in a continuous 10-day window, 2xx responses, outside /cdn-cgi) before it shows up at all. Set that expectation with the customer up front — "nothing populated yet" the first day is normal, not broken.
  2. Check the Discovery tab first. This is where newly-seen endpoints accumulate automatically — no action required to get them here. They arrive in shadow or candidate state (see the table above).
  3. Decide what's worth promoting to Full. You do not need to act on every discovered operation. Walk through the list with the customer and identify the endpoints that actually matter — auth, payments, anything handling per-user data — and promote those via "Learn profile" from the operation's overflow menu. This is also the prerequisite step for Schema Learning (Module 3) and for Bot/API-specific Custom Rules later.
  4. Check Security → Analytics for live data. Once operations are flowing, this is where you confirm API Shield is actually seeing traffic — request volume per operation, response codes, and (once a profile exists) conformance/violation trends.
  5. Check the Suspicious Activity card for BOLA findings — do this even before step 3. BOLA (Broken Object Level Authorization) detection runs automatically for any Enterprise account with an active API Shield subscription — no setup, no beta, no extra cost. It's easy to miss because it's not a toggle anyone has to flip. Worth checking on day one: a customer with existing per-user endpoints (profile IDs, order IDs, account IDs in the URL) may already have findings waiting, which is a strong, concrete "here's value you didn't know you had" moment in a QBR or check-in call.
If nothing shows up after a few days, walk back through the Discovery requirements list above in order: is API Shield entitled at both account and zone level (not just account)? Is traffic actually hitting this zone with 2xx responses? Is volume realistically above 500 requests/10 days for the endpoints in question? Is the customer testing from a Cloudflare Worker (which doesn't count)? This order matches the most common real-world misses, roughly most-to-least likely.

Module 3Schema Validation & Schema Learning

Both of these feed the same underlying profile type — a Schema Profile, under the broader "Application Profiles" framework. They're two different ways of getting there.

Schema LearningSchema Validation
SourceLearned automatically from observed trafficYou upload an OpenAPI schema file
EffortZero — select "Learn profile" on an operationRequires you to maintain an accurate spec
Detection fieldcf.schema_validation.learned.violatedcf.schema_validation.uploaded.violated

Multiple uploaded schemas can be active simultaneously. If a new schema covers an operation already covered by an existing one, it replaces the validation definition for that operation only — everything else keeps its prior definition.

Turning detection into an actual block — the real WAF rule

Neither Schema Learning nor Schema Validation blocks anything by default — per Module 1's core point, this is pure detection until you add a Custom Rule:

// Block anything that violates a learned schema, scoped to one path
cf.schema_validation.learned.violated and http.host eq "api.example.com" and starts_with(http.request.uri.path, "/v1/orders/")
// Combine an uploaded-schema violation with Bot Score for extra confidence
cf.schema_validation.uploaded.violated and cf.bot_management.score lt 10

Cloudflare's own rollout guidance: review production traffic and sampled violation reasons in Security Analytics first, then create the Custom Rule once you're confident it only catches what you expect.

The fallthrough rule — protecting the endpoints you don't know about yet

A fallthrough rule is a WAF Custom Rule that matches any request that doesn't match a saved operation — i.e., genuinely unknown/undocumented traffic. Requests matching a candidate operation still count as matching the fallthrough rule (candidates aren't "known" in the full sense). This is the real answer to "what happens to the APIs we don't even know exist yet" — a fallthrough rule gives you a deliberate catch-all policy for them instead of silence.

Mass assignment, concretely

Classic attack: a login schema expects {"username", "password"}, attacker sends {"username","password","role":"admin"} hoping the backend trusts the extra field. A schema with additionalProperties: false rejects it at the edge — this is a positive-security model, so the request fails because it doesn't match the expected shape, not because anyone wrote a rule specifically about the word "role."

How to actually set this up

Upload a schema (Schema Validation):

  1. Go to Web Assets page.
  2. Go to the Schema validation tab.
  3. Select Add validation.
  4. Upload an OpenAPI schema file.
  5. Select Add schema and endpoints — this adds the schema's operations to Web Assets automatically. Changes can take several minutes depending on operation count.

To manage schemas afterward: Web Assets → Schema validation tab → Schema settings → filter by "API abuse" → Active schemas. From the overflow menu on any schema you can download or delete it — deleting stops its profile evaluation but leaves the operations themselves in your inventory.

Learn a schema instead (Schema Learning) — covered step-by-step in Module 2's "Once it's enabled" section above.

Turn either one into an actual block (the Custom Rule):

  1. Go to the Security rules page.
  2. Select Create rule → Custom rules.
  3. Enter a descriptive Rule name.
  4. Under When incoming requests match, paste or build the expression — e.g. cf.schema_validation.learned.violated and http.host eq "api.example.com".
  5. Under Then take action, choose the action.
  6. Select Deploy (or Save as Draft if not ready).
Best practice, straight from Cloudflare's own rollout guidance: start with Log as the action (Enterprise plans only — on other plans, start with Managed Challenge instead), review what actually matches in Security Events/Analytics for a few days, confirm it only catches what you expect, then switch the same rule to Block. Going straight to Block on a brand-new schema or learned profile is the single most common way to cause a self-inflicted outage.

Module 4Rate Limiting & Volumetric Abuse Detection

Two different things: standard Rate Limiting Rules (fixed thresholds you set yourself) and Volumetric Abuse Detection (adaptive, per-session recommendations API Shield generates for you).

Session identifiers — the foundation almost everything else depends on

A session identifier uniquely tracks one client across requests — usually the Authorization header, a cookie, or a specific JWT claim (e.g. sub or email, since the raw token value itself changes over time). You can configure up to 10 session identifiers per zone. Session identifier cookies must comply with RFC 6265 or they're rejected.

Auto-detection you should know about: if no session identifier is configured and the Authorization header appears on more than 1% of eligible sampled 2xx requests, Cloudflare automatically configures that header as the session identifier for you. It will never overwrite an existing configuration you've already set.

How to actually set one up

  1. Go to the Security → Settings page.
  2. Filter by API abuse.
  3. On Session identifiers, select Configure session identifiers, then Manage identifiers.
  4. Choose the type: cookie, HTTP header, or JWT claim. (A JWT claim requires a Token Configuration to already exist — see Module 7 — then specify the claim with a JSONPath expression.)
  5. Name it, then select Save.

Do this early, even before you have a specific rate-limiting or Sequence Analytics need — Discovery, Volumetric Abuse Detection, Sequence Analytics, Authentication Posture, and BOLA enumeration detection all consume this same setting. One correct setting here pays off across five different features.

Session identifiers feed into far more than rate limiting — they're used by Discovery (optional signal), Sequence Analytics, Sequence Mitigation, Authentication Posture, and rate limit recommendations. Getting this one setting right early pays off across the whole product.

Volumetric Abuse Detection — how the recommendation engine actually works

Uses unsupervised learning to build a separate traffic baseline per endpoint (your /login and /reset-password endpoints naturally see very different normal volumes, and the same endpoint's "normal" can shift after a marketing campaign). It groups requests into 10-minute periods per session and uses the resulting distribution to recommend one per-session threshold per eligible operation. Needs a 7-day analysis window of sufficient eligible traffic to produce a reliable number, and at least 24 hours after adding/changing a session identifier before recommendations start appearing.

Rate limits generated this way are per-session, not per-IP — this directly reduces false positives during legitimate traffic spikes, since the limit tracks individual sessions rather than a shared IP address multiple real users might sit behind. A configured session identifier alone does not guarantee a recommendation — there must also be enough eligible traffic and a successfully calculated threshold. Actually enabling session-based rate limiting requires an Advanced Rate Limiting subscription.

Example rate limiting rules worth having ready

// Credential stuffing: tight limit on login
POST /login -> 5 requests / minute per session

// BOLA-style enumeration: moderate limit on object lookups
GET /users/:id -> 20 requests / minute per session

// Legitimate high-volume partner traffic
GET /products -> 1000 requests / minute per session

For APIs with no usable session cookie, a JA3/JA4 TLS fingerprint can serve as the counting characteristic instead — available to Bot Management customers, identifies a client across requests independent of anything in the headers.

How to actually create a rate limiting rule

  1. Go to the Security rules page.
  2. Select Create rule → Rate limiting rules.
  3. Enter a descriptive Rule name.
  4. Build the match expression (Field / Operator / Value) — e.g. URI Path equals /api/auth/login.
  5. Under With the same characteristics, add what defines a unique counter — IP, a header like x-api-key, a cookie, or a JWT claim. This is the counting characteristic from Module 1's variables.
  6. Under When rate exceeds, set the request threshold and period.
  7. Under Then take action, pick the action and duration.
  8. Select Deploy.
Best practices:
• Use separate rules for authenticated vs. unauthenticated endpoints — login, registration, and password-reset need much tighter limits since they're the primary targets for credential stuffing.
• If API Shield already generated a Volumetric Abuse Detection recommendation for an operation, use its overall recommendation value, not a single percentile (p50/p90/p99) — the overall number already accounts for variance across all sessions, a single percentile invites false positives from outliers.
• If the dashboard marks a recommendation low confidence, still implement it — just start the rule in Log mode, watch for false positives for a few days, then switch to Block.
• Rate limiting counters have a small propagation delay across data centers — expect a handful of requests above the threshold to slip through before enforcement kicks in. This is normal, not a bug.

Module 5Vulnerability & risk detection

A cluster of detection-only features that label risky endpoints. None of these block anything by themselves — same rule from Module 1 applies throughout.

BOLA vulnerability detection

A Broken Object Level Authorization bug lets an attacker access data they shouldn't by manipulating object identifiers (user IDs, order IDs) — as dangerous as an account takeover. Cloudflare flags BOLA risk from two distinct signals:

Findings surface in three places: Security Overview, Endpoint details (with affected sessions, IPs, and JA4 fingerprints — exportable as CSV), and Security Analytics. Confirm actual unauthorized access by cross-referencing your own API origin logs for the flagged IPs/fingerprints before assuming the worst.

Vulnerability Scanner — real DAST, not just passive detection

Launched as Open Beta: a stateful Dynamic Application Security Testing (DAST) platform that builds API call graphs simulating both attacker and legitimate-owner contexts, then sends real HTTP requests to actually test for BOLA. Set up requires your target environment, owner and attacker credentials, and an OpenAPI file with response schemas. API-only access for now — not yet in the dashboard, intended for CI/CD and programmatic integration. This is meaningfully different from everything else in this module: it's active testing, not passive traffic observation.

Zombie API detection

Automatically flags saved endpoints that haven't received traffic in 32+ days with a cf-risk-zombie label — the scan runs daily alongside other risk scans. A zombie endpoint often means deprecated, forgotten API surface that's unpatched and unmonitored. Recommended response: review and consider removing it from Endpoint Management, or use a fallthrough rule (Module 3) to actively block traffic to anything removed.

Authentication Posture

Does not validate credentials — it only reports whether your configured session identifier is present on successful requests, to catch the gap between "we think this endpoint requires auth" and "it actually enforces it." Labels update roughly once a day:

LabelMeaning
cf-risk-missing-authAll successful requests lack the configured session identifier entirely
cf-risk-mixed-authSome successful requests have it, some don't — inconsistent enforcement

A large spike in unauthenticated-but-successful traffic on an endpoint expected to be 100% authenticated is a real signal worth escalating to your dev team immediately, not just logging.

Sensitive Data Detection (separate subscription)

Integrates with the WAF's Sensitive Data Detection ruleset to flag endpoints whose responses contain things like SSNs or credit card numbers — applies the cf-risk-sensitive label. Requires its own subscription on top of API Shield; confirm with the account team rather than assuming it's bundled in.

Module 6Sequence Analytics & Sequence Mitigation

Some attacks aren't one bad request — they're an unusual sequence of otherwise-normal-looking requests. A real user checks their balance, then transfers funds. An attacker scrapes products in random order, or hits checkout 100 times in 30 seconds. Looking at requests in isolation misses this category entirely.

Sequence Analytics

Identifies common request-order patterns automatically, ranked by a precedence score — how likely a given request is to be preceded by the other operations in that sequence. High-scoring sequences represent the normal, expected flow through your API. This requires a configured session identifier to track sequences per client over time.

Sequence Mitigation — the enforcement layer

Unlike Sequence Analytics (pure observation), Sequence Mitigation actually enforces expected request order for authenticated clients. The real workflow: use Sequence Analytics to identify your high-scoring (normal) sequences, verify the expected order with your own dev team (don't assume — confirm), then apply API Shield protections — rate limiting, Schema Validation, JWT Validation, mTLS — specifically to the endpoints inside those sequences.

Module 7mTLS & JWT Validation

The positive-security / auth-enforcement layer — reject bad actors before your application code ever has to think about them.

Important and commonly misunderstood: mTLS does NOT require API Shield at all. It's a separate SSL/TLS feature (Client Certificates) that works independently. Many teams use it alongside API Shield, but you can turn on mTLS for a hostname with zero API Shield entitlement. Don't position it as an API-Shield-exclusive capability.

mTLS — how it actually works

Standard TLS only verifies the server's identity to the client; mTLS adds the reverse — the server verifies the client too, via a client certificate. By default, certificates come from a Cloudflare-managed CA at the account level (same certs work across every domain in your account, as long as mTLS is enabled per-hostname). Validation result is exposed as cf.tls_client_auth.cert_verified (true/false) plus detailed certificate fields.

Cloudflare-managed CABYOCA (bring your own CA)
Default limit100 active certs per zone (expandable to 100,000 with Enterprise + API Shield entitlement)5 CA certs per Enterprise account (shared quota across API Shield, Workers mTLS, Gateway)
Best forSmall, stable client set, infrequent authHigh-volume/high-churn issuance, or you already run an internal CA
AvailabilityAny plan with Client CertificatesEnterprise only

Origin server wildcard certificates (*.example.com) are not supported for mTLS — the origin cert must match the specific client-certificate hostname.

How to actually set up mTLS

  1. Go to the SSL/TLS → Client Certificates page.
  2. Select Add Certificate (Cloudflare-managed CA is the default).
  3. Either generate a private key + CSR with Cloudflare, or bring your own CSR (needed if you want to label client certificates later).
  4. Choose a Certificate Validity period and continue.
  5. Copy the certificate and private key immediately — they are not shown again after this step.
  6. (Optional but usually required) Specify the hostnames where this cert should be accepted, in FQDN format matching your zone.
  7. Select Save.

Creating the cert doesn't finish the job — you still need to install it on the actual client devices/scripts that will present it, and separately enable mTLS enforcement for each hostname that should require it.

JWT Validation — the two-part process

Always two separate pieces: a token configuration (tells Cloudflare how to find and verify JWTs — source location, JWKS/keys) and a rule that acts on the result. You do not need an operation in Endpoint Management or any rule at all just for raw validation to happen — Cloudflare checks every request in the zone at the configured source regardless; rules only control what happens with the result.

Cloudflare's current recommendation: use WAF Custom Rules to act on JWT results for new policies (supports zone-wide or endpoint-scoped policies, and can combine JWT results with other signals like Attack Score) — legacy "token validation rules" still work but aren't the forward path.

// Reference a custom claim in a rule
lookup_json_string(http.request.jwt.claims["<TOKEN_CONFIG_ID>"][0], "claim_name")

Special cases worth knowing: validating two JWTs from different identity providers on one request requires two separate token configurations, selecting "Validate all configurations." Migrating between identity providers similarly needs two configs and two validation rules, so you can flip actions independently as the migration progresses.

How to actually set up a token configuration

  1. Go to the Security → Settings page.
  2. Filter by API abuse.
  3. On Token configurations, select Configure tokens.
  4. Name the configuration.
  5. Choose where Cloudflare should look for the JWT on incoming requests — a specific header or cookie, and its name.
  6. Paste in your issuer's verification keys (JWKS) — asymmetric public keys, or a symmetric HMAC credential. If you don't know where to get these, that's an identity-admin question on the customer's side, not something to guess at.

Then act on the result with a WAF Custom Rule (Module 1 list, same Custom Rule flow as Module 3/4) referencing http.request.jwt.claims.

Gotcha worth flagging proactively: token configurations do not auto-refresh keys from a JWKS URL. If the customer's identity provider rotates keys and nobody updates the configuration, validation silently starts failing for legitimate users. Either plan for someone to update keys manually, or set up a Worker to sync automatically — don't let a customer find out about key rotation the hard way.

Module 8Decision framework — detection vs. mitigation, and what to actually block

Given Module 1's core point, here's the practical mapping: what's pure detection (needs a rule to act), and exactly what field/mechanism turns it into real enforcement.

FeatureDetection only?How to actually enforce it
Schema LearningYesCustom Rule on cf.schema_validation.learned.violated
Schema Validation (uploaded)YesCustom Rule on cf.schema_validation.uploaded.violated
BOLA vulnerability detectionYesNo direct block field — review findings, fix at the application/auth layer, or rate-limit/block the offending session/IP manually
Authentication PostureYesNot a blocking signal — fix the underlying auth policy with your dev team
Zombie API detectionYesFallthrough rule, or remove the endpoint from Endpoint Management entirely
Volumetric Abuse DetectionRecommendation onlyCreate the actual Rate Limiting Rule using the recommended threshold (requires Advanced Rate Limiting)
JWT ValidationNo — always pairedAlways requires a rule (WAF Custom Rule or token validation rule) to act on validity/claims
mTLSNo — enforces directlyBlocking is built into enabling mTLS for the hostname itself
Sequence MitigationNo — enforces directlyEnforces order once configured, unlike Sequence Analytics which only observes

Notice the pattern: anything with the word "Detection" or "Posture" or "Analytics" in its name is almost certainly observation-only. Anything named "Validation" or "Mitigation" is built to actually act. When in doubt on a call, default to assuming detection-only and confirm the enforcement path before promising a customer it blocks anything automatically.

What to actually block vs. allow vs. just log — real criteria, not "it depends"

Module 8's table above tells you the mechanism. This is the part that's actually missing from most API Shield conversations: once you've wired up the Custom Rule, what should it do? Unlike Bot Management's continuous 1-99 score, most API Shield signals are binary (matches the expected shape, or doesn't) — which makes people assume the answer is always "just Block it." It isn't, for exactly one reason: the false-positive cost of a legitimate client is a broken API integration for a real customer, not an annoying CAPTCHA.

SignalDefault actionWhen to deviate
Schema violation (learned or uploaded)Block, once confirmed cleanRun Log for at least a few days after any new schema or app release before trusting it — a backend deploy that adds a field, or a mobile app update still rolling out to users, will generate violations that are not attacks. Never go straight to Block on day one of a new profile.
BOLA finding (enumeration or parameter pollution)Do not auto-block — there is no block field for this signal by designThis is a human-review flag, not an enforcement trigger. Confirm against your own origin logs first (Module 5). If confirmed malicious, enforce manually: rate-limit or block the specific flagged session/IP/JA4 fingerprint, and separately get the underlying authorization bug fixed in the application — blocking traffic treats the symptom, not the vulnerability.
JWT validation failureLog-only during initial rollout, Block once stableA brand-new token configuration is a common source of false failures — wrong claim path, an unexpected algorithm, a key that doesn't match yet. Confirm real traffic validates cleanly for a few days before switching the Custom Rule from Log to Block, or you risk locking out every legitimate user at once the moment the rule goes live.
Rate limit exceededChallenge for consumer-facing/uncertain traffic, Block for confirmed abuse patternsCredential-stuffing-shaped traffic on a login endpoint (Module 4's examples) → Block. A legitimate partner integration that occasionally bursts above a newly-set threshold → Challenge or just widen the limit, don't Block first. Low-confidence Volumetric Abuse Detection recommendations (Module 4) → start in Log regardless of endpoint sensitivity.
Zombie API (32+ days no traffic)Don't "block a user" — there isn't oneThis labels a forgotten endpoint, not active malicious traffic. Either decommission it with your dev team, or apply a fallthrough-style block to prevent anyone from (re)discovering and abusing it — the decision is about the endpoint's fate, not a per-request enforcement call.
Authentication Posture gap (missing-auth/mixed-auth)Not a rule at all — an application bug reportThere's nothing to Block here; the finding means the endpoint isn't enforcing the auth it's supposed to. Escalate to the dev team as a bug, not a security-rule configuration task.
The one-line version to give a customer who asks "so what should we actually block?": deterministic, confirmed-clean signals (a stable schema, a working JWT config) earn a real Block. Anything newly deployed, anything that's a finding about your own application rather than the traffic itself (BOLA, Auth Posture, Zombie APIs), or anything with real legitimate-traffic overlap (rate limits) starts in Log or Challenge and only tightens once you've watched it for a few days.

Module 9Plans, positioning & competitive context

Unlike Bot Management's multi-tier structure (Free/Pro/Business/Enterprise), API Shield doesn't have a comparable ladder.

API Shield is an Enterprise-only paid add-on, full stop. There is no Free/Pro/Business version of the core product. Enterprise customers can preview it as a non-contract service (full access, no metered usage fees or limits, per Cloudflare's preview-services program) before committing. Some individual pieces have their own separate gating on top of the base add-on — Discovery, Volumetric Abuse Detection, and BOLA detection are each independently confirmed Enterprise-only; Advanced Rate Limiting and Sensitive Data Detection are each their own additional subscriptions layered on top.

What's available on lower plans without API Shield at all: basic Rate Limiting Rules, WAF Custom Rules, bot detection, and SSL/TLS/mTLS client certificates (per Module 7's callout) — genuinely useful building blocks for API protection, just without Discovery, Schema Validation, Sequence Analytics, or the vulnerability-detection suite.

GraphQL and gRPC

GraphQL malicious query protection is available to all API Shield customers (not a separate subscription) — it scans GraphQL traffic and blocks queries that could overload the origin, via three Custom Rule fields: cf.api_gateway.graphql.query_size (number of terminal fields/leaves requested, not byte size), cf.api_gateway.graphql.query_depth (nesting depth), and cf.api_gateway.graphql.parsed_successfully. Cloudflare's own documented example rule: query_size > 30 and query_depth > 7 and parsed_successfully → Block.

Real limitations worth knowing before a demo: parsing is capped at 20 KiB per GraphQL POST body; only POST requests with application/json or application/graphql content types are inspected; queries using fragments or multiple operations aren't supported; and rules only apply to paths with the exact, case-sensitive /graphql suffix. Also — parsing is best-effort, so parsed_successfully must always be ANDed into the rule, or you risk the rule matching on a query Cloudflare couldn't actually parse correctly.

gRPC: Cloudflare can proxy and protect gRPC services with the same core controls (rate limiting, mTLS, etc.).

Why Cloudflare over point products (Salt, Noname, 42Crunch, Traceable, etc.)

  1. Same edge as everything else — no separate inline component, no traffic mirroring to a third-party pipeline
  2. Network-scale advantage — Cloudflare observes a huge share of global internet traffic, including API attack patterns no single-customer point product can ever see
  3. One policy language — combine API-specific rules with WAF, bot score, and identity signals in the same Custom Rule
  4. No agents, no SDKs, no traffic re-routing — if you're already proxied through Cloudflare, the data is already there
  5. Built-in mTLS managed CA — most competitors require you to bring external PKI

Module 10Live demo & test commands

Real, tested curl commands against a live demo API (api.tarheel.us), each cross-linked to the module that explains why it works.

Always add -i (or -is) to show response headers, including cf-ray. That Ray ID is what you paste into Security Analytics to prove Cloudflare made the decision — without it you only have a bare status code and no receipt.

Schema Validation tests (Module 3)

// TEST 1 — Valid login → 200
curl -is -w "\nStatus: %{http_code}\n" \
  -X POST https://api.tarheel.us/login \
  -H "Content-Type: application/json" \
  -d '{"username":"demo","password":"hunter2"}'
// TEST 2 — Missing required field → 403 (blocked by schema, never reached the app)
curl -is -w "\nStatus: %{http_code}\n" \
  -X POST https://api.tarheel.us/login \
  -H "Content-Type: application/json" \
  -d '{"username":"demo"}'
// TEST 3 — Extra field / mass assignment attempt → 403
// Schema has additionalProperties: false — the "role" field alone triggers the reject
curl -is -w "\nStatus: %{http_code}\n" \
  -X POST https://api.tarheel.us/login \
  -H "Content-Type: application/json" \
  -d '{"username":"demo","password":"hunter2","role":"admin"}'
// TEST 4 — Wrong data type (SQLi payload in an integer field) → 403
// Caught because the shape is wrong, not because of a SQLi-specific rule
curl -is -w "\nStatus: %{http_code}\n" \
  -X POST https://api.tarheel.us/orders \
  -H "Content-Type: application/json" \
  -d '{"product_id":"DROP TABLE products;--","quantity":1}'

Rate Limiting / Volumetric Abuse tests (Module 4)

// TEST 5 — Credential stuffing → 429 after 5 tries
for i in {1..10}; do
  RESP=$(curl -sD - -o /dev/null -w "STATUS=%{http_code}" \
    -X POST https://api.tarheel.us/login \
    -H "Content-Type: application/json" \
    -d "{\"username\":\"victim\",\"password\":\"guess$i\"}")
  STATUS=$(echo "$RESP" | grep '^STATUS=' | cut -d= -f2)
  RAY=$(echo "$RESP" | grep -i '^cf-ray:' | awk '{print $2}' | tr -d '\r')
  echo "Attempt $i:  status=$STATUS  cf-ray=$RAY"
done

First 5 attempts return 401 (wrong password, from your origin — Cloudflare proxied them through). Sixth onward returns 429 from Cloudflare itself, before ever reaching the origin.

// TEST 6 — BOLA enumeration → 429 after 20 tries
for i in {1..30}; do
  RESP=$(curl -sD - -o /dev/null -w "STATUS=%{http_code}" \
    https://api.tarheel.us/users/$i)
  STATUS=$(echo "$RESP" | grep '^STATUS=' | cut -d= -f2)
  RAY=$(echo "$RESP" | grep -i '^cf-ray:' | awk '{print $2}' | tr -d '\r')
  echo "User $i:  status=$STATUS  cf-ray=$RAY"
done

Twenty requests succeed, then 429 — an attacker can't enumerate every user ID. This is the live version of exactly the enumeration signal BOLA vulnerability detection looks for (Module 5), just demonstrated as a hard rate-limit block rather than a passive detection label.

GraphQL malicious query protection, live (Module 9)

// Benign → 200
curl -X POST https://cf-demo-app.dustinburke23nc.workers.dev/graphql \
  -H 'Content-Type: application/json' \
  -d '{"query":"{ user(id: \"42\") { id name } }"}'

// Deeply-nested → 403 (simulated block, matches query_depth > 7)
curl -X POST https://cf-demo-app.dustinburke23nc.workers.dev/graphql \
  -H 'Content-Type: application/json' \
  -d '{"query":"{ a { b { c { d { e { f { g { h { i { j } } } } } } } } } }"}'

This endpoint is on workers.dev — there's no real Cloudflare WAF in front of it, so it simulates the block response shape for safe scripting/screenshots. For a demo with a real edge decision and real Security Analytics event, the identical logic runs behind an actual Enterprise zone with API Shield enabled at graphql.tarheel.us/graphql — use that one when you want to show the WAF block itself, not just the response shape.

Proving it: filter Security Analytics by any cf-ray from a 403/429 above. You get one row — the exact request, the exact rule that fired, the exact field or threshold that failed. That's the difference between "I got blocked by something" and a receipt you can attach to a ticket or compliance audit with zero extra work.

Module 11Rapid-fire Q&A

"We turned on Schema Validation — why are bad requests still getting through?"

Schema Validation only detects violations (sets cf.schema_validation.uploaded.violated); nothing is blocked until you add a Custom Rule on that field. This is the single most common point of confusion with this product.

"Do we need an OpenAPI spec to get value from this?

No — Schema Learning builds a profile directly from observed traffic with zero spec required. An OpenAPI file is only needed if you want Schema Validation specifically (uploaded, human-authored schema) rather than the auto-learned version.

"Is mTLS part of API Shield?"

No — it's a separate SSL/TLS feature (Client Certificates) that works with or without API Shield. API Shield customers commonly layer it in alongside JWT validation and schema validation, but it has no API Shield dependency.

"How does Discovery find APIs without an agent or SDK?"

Pure traffic analysis — Cloudflare already sees every proxied request. It applies heuristic path normalization and machine learning to group and surface endpoints from real traffic, no code changes or instrumentation required.

"We already have an API gateway (Kong, Apigee). Why would we also need this?"

Cloudflare sits in front of the gateway as the first line of defense — DDoS, bot, schema, rate limit, JWT — while the gateway continues handling business logic: routing, transformation, developer portal. Many customers run both; they're complementary, not competing.

"What if a rule blocks a legitimate request by mistake?"

Set Schema Validation's associated Custom Rule (or any rate limiting rule) to Log mode first — observe what would have been blocked without actually blocking it, tune based on real violation reasons in Security Analytics, then flip to an enforcing action once confident.

Self-testQuiz

Click a question to reveal the answer. No peeking before you commit to one.

1. A customer turns on Schema Validation and uploads their OpenAPI spec. Does this start blocking malformed requests automatically?

No. Schema Validation only sets the detection field cf.schema_validation.uploaded.violated. Nothing is blocked until a separate WAF Custom Rule acts on that field. This is the single most important fact in the whole product.

2. What's the actual difference between Schema Learning and Schema Validation?

They produce the same underlying profile type (a Schema Profile) through two different sources: Schema Learning derives it automatically from observed traffic (no spec needed), Schema Validation requires you to upload an OpenAPI schema. Both are equally detection-only.

3. A discovered endpoint shows as "candidate" — do you need to save it to "full" state for it to be useful at all?

No. Candidate operations are already matched at the edge and can provide context for logs, rules, analytics, and detections. You only need "full" state for persisted API profiles, risk findings, and protections that specifically require a known endpoint.

4. True or false: Volumetric Abuse Detection rate-limits by IP address.

False — it's per-session, not per-IP. This is deliberate: tracking individual sessions instead of a shared IP address significantly reduces false positives when legitimate traffic to your API spikes.

5. What two signals does BOLA vulnerability detection actually look for?

Enumeration (unusually high distinct path-parameter combinations requested by one session, vs. the normal distribution for that endpoint) and parameter pollution.

6. Does mTLS require an API Shield subscription?

No — mTLS is a separate SSL/TLS (Client Certificates) feature that works independently. Many API Shield customers layer it in, but it has zero dependency on the API Shield add-on.

7. A customer asks if they need an active rule or saved endpoint for JWT validation to actually run. True or false: validation only happens if you create a rule first.

False. Cloudflare checks every request in the zone for a JWT at the configured source and validates it regardless of whether any rule exists. The rule only controls what happens with the result (block, log, etc.) — not whether validation itself occurs.

8. What's a "fallthrough rule" for?

A WAF Custom Rule that matches any request not matching a saved operation — i.e., genuinely unknown/undocumented traffic. It gives you a deliberate policy for endpoints you don't know about yet, instead of silent pass-through.

9. Zombie API detection flags an endpoint after how long without traffic?

32 days. The scan runs daily and applies the cf-risk-zombie label once that threshold is crossed.

10. A customer says "we're on Business plan, can we get Discovery and Schema Validation without the full add-on?" What's the honest answer?

No. API Shield is Enterprise-only, full stop — there's no Free/Pro/Business tier for the core product, unlike Bot Management's multi-tier structure. Enterprise customers can preview it as a non-contract service before committing.

11. What does Authentication Posture's cf-risk-mixed-auth label actually mean?

Some successful requests to that endpoint contain the configured session identifier, and some don't — inconsistent enforcement. It does not mean credentials were validated or invalid; Authentication Posture never checks credential validity, only whether the identifier is present.

12. What's the real difference between Sequence Analytics and Sequence Mitigation?

Sequence Analytics only observes and ranks common request-order patterns by precedence score. Sequence Mitigation actually enforces expected order for authenticated clients — it's the enforcement layer that acts on what Analytics identified.

13. Vulnerability Scanner is described as DAST (Dynamic Application Security Testing). How is that different from the other detection features in this curriculum?

Every other detection feature passively observes real traffic. Vulnerability Scanner actively sends real HTTP requests to test your API, simulating both attacker and legitimate-owner contexts to find BOLA vulnerabilities before anyone else does. It's active testing, not passive observation.

14. If no session identifier is configured, will API Shield ever pick one automatically?

Yes — if the Authorization header appears on more than 1% of eligible sampled 2xx requests, Cloudflare auto-configures it as the session identifier. It will never overwrite one you've already set yourself.

15. A customer wants to block requests that fail schema validation on their learned profile, but only on /v1/orders. What's the actual rule expression?

cf.schema_validation.learned.violated and http.host eq "api.example.com" and starts_with(http.request.uri.path, "/v1/orders/") — combining the detection field with a host/path scope.

Sources API Shield overview Get started Security features index API Discovery Manage operations Schema Validation Enforce profiles with Custom Rules Volumetric Abuse Detection Rate limiting best practices BOLA vulnerability detection Vulnerability Scanner changelog API Shield changelog Authentication Posture Sequence Analytics Sequence Mitigation JWT Validation JWT Validation API Client certificates (mTLS) Configure mTLS for API Shield Bring your own CA Discover and secure API endpoints Reference architecture — Security