Architecture
Web Application Firewall (WAF)
Managed Rulesets
Cloudflare’s managed WAF rulesets are enabled:| Ruleset | Coverage |
|---|---|
| Cloudflare Managed Rules | OWASP Top 10, known CVEs, common web exploits |
| Cloudflare OWASP Core Ruleset | SQL injection, XSS, path traversal, file inclusion |
| Cloudflare Exposed Credentials Check | Detects use of compromised credentials |
Custom WAF Rules
Custom rules are configured for the application’s specific risk profile:| Rule | Action | Rationale |
|---|---|---|
Rate limit /api/auth/signin | Block after 5 req/IP/min | Brute force protection |
Rate limit /api/auth/forgot-password | Block after 3 req/IP/5min | Email enumeration prevention |
Block requests without User-Agent | Block | Basic bot fingerprinting |
| Challenge non-browser clients on sensitive paths | JS Challenge | Reduces automated scanning |
Bot Management
Cloudflare Bot Management scores every request. Requests with a bot score below the configured threshold are either challenged (JS Challenge) or blocked. Verified bots (Googlebot, etc.) are allowed through.DDoS Protection
Cloudflare’s DDoS protection is always-on at the network layer (L3/L4) and application layer (L7). Volumetric attacks are absorbed at Cloudflare’s edge before reaching Vercel. No additional configuration is required.Cloudflare Zero Trust
Cloudflare Zero Trust (Access) is used to protect administrative access to infrastructure dashboards — these systems are not accessible from the public internet without Cloudflare Access authentication.Protected Resources
| Resource | Access Policy |
|---|---|
| Vercel dashboard | Named users + IdP MFA |
| Neon PostgreSQL web console | Named users + IdP MFA |
| Sentry dashboard | Named users + IdP MFA |
| Internal tooling / admin UIs | Named users + IdP MFA |
Access Policy Structure
TLS Configuration
Cloudflare enforces:- Minimum TLS version: TLS 1.2
- TLS mode: Full (Strict) — origin certificate validation is enforced
- Automatic HTTPS Rewrites: enabled — HTTP requests are upgraded to HTTPS
- HSTS: enabled via application headers (see Security Headers)
Cloudflare Tunnel (Optional)
For origin server protection, a Cloudflare Tunnel (cloudflared) can be used to connect Vercel to Cloudflare without exposing a public IP. In the current deployment, Vercel’s edge network serves as the origin and Cloudflare proxies via DNS.
Monitoring
Cloudflare Analytics provides:- Real-time WAF block events and rule match details
- Bot score distribution
- Origin error rates (5xx responses from Vercel)
- Bandwidth and request volume trends
- Spike in WAF block rate (possible attack)
- Origin error rate exceeding 5% (application health issue)
- DDoS attack detection