Enforcement can occur at an application programming interface (API) gateway, web application firewall (WAF), content delivery network (CDN), reverse proxy, or application. Policy identifies the caller or operation, measures activity, and delays or rejects excess requests. Distributed services need coordinated enforcement when a limit is intended to apply across instances.
The Open Worldwide Application Security Project (OWASP) API4:2023 category, Unrestricted Resource Consumption, highlights why request counts alone are insufficient: one permitted operation can consume substantial processing, storage, bandwidth, or paid downstream services.
Key points
Policy keysSeparate limits may apply to accounts, credentials, sessions, network sources, endpoints, or tenants. Address-only rules can penalize shared networks while distributed attackers evade them.
Capacity thresholdsLimits should reflect legitimate demand, operation cost, permitted bursts, and critical service capacity, with observed outcomes informing adjustments.
Client behaviorHypertext Transfer Protocol (HTTP) status 429 indicates too many requests; a Retry-After header may communicate when to retry. Clients need bounded retry behavior.
Important limitationA low request rate can still exhaust resources or abuse business logic. Execution-time, payload-size, concurrency, and spending controls address different dimensions; rate limiting does not establish authorization or stop every denial-of-service attack.