cflare firewall

WAF & Custom Firewall Rules

Firewall

Manage Web Application Firewall (WAF) custom rules, rate limiting, and IP access rule lists.

$ cflare firewall <list|create|delete> <domain> [options]

📖 Full Explanation

\1 empowers security teams to inspect and create sophisticated edge filtering rules using Cloudflare's Wirefilter syntax (e.g. \1).

⚙️ Command Options & Flags

Option / Flag Description Default
-a, --action <action> Firewall action: block, challenge, js_challenge, log, bypass block
-e, --expression <expr> Cloudflare Wirefilter rule expression -
-d, --description <desc> Descriptive rule name -

🔬 Technical Corollary & Edge Mechanics

Interfaces with Cloudflare's Rulesets API (\1). Rules execute at the edge before requests reach Worker scripts or origin servers.

🎯 Real-World DevOps Use Cases

Lock Down Administrative Portals

Block all access to \1 unless originating from office IP ranges.

$ cflare firewall create namishkumar.in -d "Protect Admin" -e 'http.request.uri.path contains "/admin" and ip.src ne 203.0.113.50' -a block

Mitigate Bad User-Agent Bots

Block scrapers pretending to be web browsers with invalid User-Agent strings.

$ cflare firewall create example.com -d "Block Scraper" -e 'http.user_agent contains "Scrapy"' -a block

💻 Live Output Simulation

$ cflare firewall list namishkumar.in
┌──────────────────────────┬─────────────────────────────┬────────┬────────┐
│ Rule ID                  │ Description                 │ Action │ Status │
├──────────────────────────┼─────────────────────────────┼────────┼────────┤
│ 8f12a3b4c5d6e7f8a9b0c1d2 │ Protect Admin Portal        │ block  │ active │
│ 1a2b3c4d5e6f7a8b9c0d1e2f │ Challenge Rogue Scrapers    │ chall. │ active │
└──────────────────────────┴─────────────────────────────┴────────┴────────┘