Appearance
API protection
Symptoms of the core API protection: body limits, OpenAPI descriptions, schema checks, GraphQL, authentication, the endpoint inventory, gRPC, WebSocket, MCP and API settings. The advanced API modules have their own pages in this section.
API requests refused with api.json.* or api.xml.*
- Symptom: clients get 403 (block mode) on JSON or XML requests; events name an
api.rule. - Cause: API protection is on for the application and the body breaks a limit (too deep, too long, too many members), is malformed, repeats a JSON member name, or carries an XML DTD with entities.
- Check:
waap explain EVENT(rule, JSON pointer or element path, measured value and the limit);waap api get -app APP(current limits). - Fix: if the traffic is legitimate, raise the limit (
waap api set -app APP limits.json.string_length=256KiB -m why) or except the rule for that field (waap except -apply -m why EVENT). While tuning, runwaap api set -app APP mode=detect. Duplicate keys and DTDs with entities are attack techniques: fix the client rather than excepting them (api.xml.dtdcannot be excepted).
A description does not load ("waap api check" or apply refused)
- Symptom: "does not load", or apply refused with
api.specs NAME (...). - Cause: not OpenAPI 3.x (Swagger 2.0 must be converted), invalid OpenAPI (for example a missing
info.versionor a bad$ref), an external$ref(not fetched, by design), a file over 8 MiB, or schema patterns that Go's RE2 engine cannot run. - Check:
waap api check -f FILEprints the reason. - Fix: convert Swagger 2.0 (for example with swagger2openapi); bundle external references into one file (for example with
redocly bundle); rewrite lookaround patterns, or use-ignore-patterns(unsupported_patterns: ignore) to skip them.
Valid API calls refused with api.schema.*
- Symptom: calls that work without protection get 403 with
api.schema.unknown_path,method,parameterorbody. - Cause: the description does not match what clients send: a missing path or method, a trailing slash, a parameter typed too narrowly,
additionalProperties: falseon a body that clients extend, a media type with a different name (application/merge-patch+jsonversusapplication/json), or a base path that covers paths the description does not describe. - Check:
waap explain EVENT(operation, parameter or JSON pointer, value);waap api describe -app APP(what is enforced, and under which base path). - Fix: correct the description and upload it again; or set that check to
logwhile fixing (waap api spec set -app APP -name N -check parameters=log); or except the rule for that field (waap except EVENT, for example within: ["param:query.limit"]).
GraphQL requests refused with api.graphql.*
- Symptom: a GraphQL client gets 403; the event names
api.graphql.depth,cost,aliases,fields,batch,introspectionorsyntax. - Cause: the query is over a limit (large list sizes multiply the cost; fragments count where they are used), asks for introspection, is not valid GraphQL, or the body is not a GraphQL request (
{"query": ...}) on a path listed ingraphql.paths. - Check:
waap explain EVENT: the operation, the GraphQL path, and the query with the offending part between>>and<<;waap api get -app APPfor the limits. - Fix: raise that limit for the application (
waap api set -app APP graphql.cost=5000), remove a non-GraphQL path fromgraphql.paths, or except the rule for the path (waap except EVENT). For introspection from developer tools, use a staging application.
API calls refused with 401 (api.auth.*)
- Symptom: clients get 401 with
WWW-Authenticate; events name anapi.auth.rule. - Cause: by rule:
missing(wrong header, orAuthorizationwithoutBearer);key_id(the key set is not fetched yet, or the provider rotated keys before the next refresh);expired(client or server clock off by more thanclock_skew, or noexp);algorithm(the provider signs with an algorithm not in the rule's list);issueroraudience(the configured values differ from the token's, including a trailing slash);api_key(the key is revoked, expired, created for another application, or its consumer was removed). - Check:
waap explain EVENT;waap api auth -app APP(key set status and last fetch error);waap api-keys list -app APP. Decode the token's header and claims (not the signature) with a JWT debugger you trust offline. - Fix: correct the rule (
waap api list set -app APP -list auth.jwt -f ...); lowerrefreshif the provider rotates often; create a new key for the right application.
Key set never fetched or "last attempt failed"
- Symptom:
waap api authshows "not fetched yet" or an error; tokens getapi.auth.key_id. - Cause: the URL is unreachable from the active node (proxy, DNS or firewall), is not https, redirects to http, answers with something that is not a JWKS, or publishes a private key.
- Check: the error shown;
curl -sS URLfrom the active node. - Fix: allow outbound https from the active node to the provider, or use
jwks_filewith the public keys.
The endpoint inventory is empty or misses endpoints
- Cause: API protection is off or
discovery.enabled: false; counts are added every 10 seconds; refused requests are not counted; or the application reached 2,000 templates (seewaap_api_inventory_overflow_total{app}), often because path segments that are not IDs vary per request, such as slugs. - Check:
waap api get -app APP(discovery.enabled); the overflow metric. - Fix: turn discovery on; describe the varying paths in a description (templates then come from it); wait for the next flush.
gRPC calls refused (PERMISSION_DENIED, api.grpc.*)
- Symptom: clients get status 7 PERMISSION_DENIED with "refused by the web application firewall, reference ..."; events name
api.grpc.*or a signature rule on agrpc.field. - Cause:
method: the descriptor set is older than the service (a new method), orgrpc.methodsdoes not list it;syntax: the client uses another version of the message (field types changed), or the descriptor set lacks imports;encoding: the client compresses with something other than gzip;size: a large message. - Check:
waap explain REFERENCE;waap api grpc describe -app APP. - Fix: rebuild the descriptor set with
--include_importsfrom the current.protofiles and load it withwaap api grpc set; allow the method; configure the client for gzip or no compression; raisegrpc.message_size.
WebSocket connections closed after a message
- Symptom: the client sees the connection drop (code 1006) after sending a message; events have IDs ending in
/m<n>. - Cause: the message broke a rule (
api.websocket.size,format,encoding,protocol, a JSON limit, an MCP rule, or a signature on its content), or inspection failed (these paths fail closed). - Check:
waap explain <ID>/m<n>;waap api get -app APP(websocket.*). - Fix: raise the size, allow binary, or except a signature rule for the path. If clients use the compression extension, nothing needs changing: it is not offered, and they fall back.
WebSocket upgrade refused with 403
- Cause:
api.websocket.path(the path is not inwebsocket.paths), orapi.websocket.origin(the page's origin is not inwebsocket.origins; native clients often send no origin). - Fix: add the path or origin. For native clients without an
Originheader, leavewebsocket.originsempty and rely on authentication.
MCP tool calls refused (api.mcp.*)
- Cause: the agent calls a tool not in
mcp.tools, batches more thanmcp.batch, or the body is not JSON-RPC 2.0. - Fix: allow the tool if it is meant to be callable, or fix the agent's configuration.
Client-streaming gRPC messages are not inspected
- Cause: by design: their bodies are not buffered, because buffering would hold the stream. The method allow-list still applies. Message inspection for client streams is not supported yet.
A new API key is refused for a few seconds
- Cause: keys reach each inspection service on its next sync, every 2 seconds.
- Fix: wait and retry. If it persists, check the node's logs for "loading API keys".
waap api set: "unknown setting", "out of range", or refused with a conflict
- Symptom: exit code 2 with "unknown setting" or "out of range"; or exit code 1 saying the configuration changed meanwhile.
- Cause: a key not in the list from
waap api get, a value outside the shown range (sizes needKiBorMiB, notKBorMB), or another change was applied between reading and writing. - Check:
waap api get -app APP(keys and ranges). - Fix: correct the key or value. For a conflict, run the command again.
Legacy XML clients refused with rule 200002 (ISO-8859-1 or other non-UTF-8 encoding)
- Symptom: XML bodies declaring
encoding="ISO-8859-1"(or another non-UTF-8 encoding) are refused by rule 200002 (request body processor error), even though API protection accepts them. - Cause: the signature engine's XML body processor supports UTF-8 only. Rule 200002 is a protected rule and cannot be excepted.
- Check:
waap explain EVENTshows rule 200002, and the body declares a non-UTF-8 encoding. - Fix: have the client send UTF-8 (the usual default), or run the application in detect mode for that traffic. The upstream issue is corazawaf/coraza#1805; adopt the release that fixes it.