Skip to main content

API Security

The controls available on an exposed API, layer by layer, and which threat each one addresses.

Security Layers​

A request crosses several controls before it reaches your service. Each layer stops a different kind of problem; none replaces the others.

LayerControlWhere
Network reachabilityExposure mode of the gateway: Public, Private, InternalAPI Gateways
TransportTLS on the access point; versions and ciphersClient Traffic Policy
SourceIP allowlist and denylistSecurity Policy
IdentityJWT, OIDC, API key, BasicSecurity Policy
DecisionAudience check, external authorizationSecurity Policy
Abuse and overloadRate limit, connection limit, circuit breakerBackend Traffic Policy
Backend linkTLS and mutual TLS towards the backendRoute Filters
EnvironmentNetwork policies between workloadsNetwork Policies

Threats and controls​

Read this table from the threat you are worried about to the control that addresses it.

ThreatControl
Anonymous accessAn authentication rule on the API
Token issued for another API replayed hereJWT audience check
Leaked API keyRotation of the key list; header transport with sanitize
Credential stuffing, scrapingRate limit; IP rules
Slow clients exhausting connectionsrequestReceivedTimeout, maxConnections
Downgrade to weak TLStlsMinVersion
Backend bypassing the gatewayNetwork policies: ingress to the integration from the gateway only
Header spoofing of identityRemove identity headers on the way in
Cascading failure of a slow backendTimeout, circuit breaker
An API without a security policy is open

A new API instance has no authentication. On a Public gateway it is reachable by anyone as soon as it is created. Add its security policy before publishing the host name.

Baseline for a production API​

  1. HTTPS access point, TLS 1.2 minimum.
  2. JWT authentication with the audience check, or OIDC for browser users.
  3. Rate limit and request timeout.
  4. Identity headers removed on the way in.
  5. Ingress to the backend restricted to the gateway.
Policy precedence

A security policy on an API instance replaces the gateway's for that API. See Policies.

Secrets used by security rules​

Keys, user lists and client credentials are stored configurations. Several are kept as fingerprints only and cannot be read back. See Configuration templates.