Origin Firewall
Important distinction
Trusting proxies ≠ firewall allowlisting.
EdgeTrust configures which connecting IPs Laravel treats as trusted proxies for forwarded headers. It does not block traffic at the network edge. An open origin remains reachable by anyone who can route to it.
Why this matters
If clients can connect directly to your origin:
- They may send forged
X-Forwarded-For/X-Forwarded-Protoheaders - Those headers are ignored only if the connecting IP is not in the trusted proxy set
- Direct access still exposes your app, admin panels, and APIs without CDN protections (WAF, bot management, TLS policies)
Trusting Cloudflare (or any CDN) in Laravel does not force traffic to arrive through that CDN.
Recommended pattern
- Place the CDN / reverse proxy in front of Laravel
- Enable the matching EdgeTrust provider(s)
- Wire CIDRs into TrustProxies
- Restrict origin ingress to those same (or overlapping) ranges — or use private networking / tunnel / authenticated origin pulls
Examples of origin controls:
- Cloud security group / firewall allowlist for CDN egress IPs
- Cloudflare Authenticated Origin Pulls
- AWS CloudFront origin access (OAC / OAI) with private origins
- VPN / private link between edge and origin
Using EdgeTrust lists for firewall sync
You can export ranges for firewall automation:
bash
php artisan edge-trust:list --provider=cloudflareFeed that output into your firewall-as-code pipeline. Keep network allowlists and Laravel trust lists updated on a similar schedule.
Checklist
- [ ] Origin not world-open on HTTP/HTTPS unless intentionally public
- [ ] Firewall / security group limited to edge provider ranges (or private path)
- [ ] EdgeTrust providers match the edges you actually use
- [ ] TrustProxies explicitly configured (no silent middleware replace)
- [ ] Sync scheduled so both app and firewall stay current