Cloudflare
Cloudflare WAF and API Access Issues
Practical notes for investigating API access issues caused by WAF rules, bot controls and rate limiting.
Find the right layer first
An API request passing through Cloudflare can be affected by DNS, TLS, WAF, bot management and rate limiting. The first step is to determine whether the request reached the origin. Comparing Cloudflare events with origin access logs over the same time window shows where the request was interrupted.
A controlled review sequence
- Confirm the hostname, path and HTTP method.
- Record the response status and any Cloudflare error code.
- Check the matching rule in Security Events.
- Search for the same request in origin logs.
- Test a rule adjustment on a narrow path or test IP first.
curl -i https://api.example.com/health \
-H "Accept: application/json"
Disabling an entire security rule may look quick, but identifying the condition that caused a false positive is safer and easier to maintain.
WAF versus rate limiting
A WAF normally evaluates request content and known attack patterns. Rate limiting evaluates request volume over time. A 403 response alone does not identify the cause; event records and response headers should be reviewed together.
| Control | Data to review | Typical approach |
|---|---|---|
| WAF | Matched rule and payload | Narrow exception |
| Bot | Client signals | Correct service identity |
| Rate limit | Window and threshold | Endpoint-specific limit |
Keep the origin protected from direct access, and do not rely on Cloudflare rules as the application's only authorization mechanism. Cloudflare is a security layer, not a replacement for application-level access control.