---
name: "cloudflare-waf-custom-firewall-rules"
description: "Design Edge WAF rules to block malicious bots, scraper networks, and targeted exploits."
metadata:
  author: "Cloudflare"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create cloudflare waf rule"
  - "block malicious bots cloudflare"
  - "configure managed ruleset waf"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Cloudflare WAF Custom Firewall Rule Designer

Configures Cloudflare Web Application Firewall rules: expression engine syntax (http.request.uri, ip.geoip.country), Managed Rulesets, Bot Fight Mode, rate limiting, and challenge actions.

## When to Invoke
Invoke this skill whenever you need to:
- create cloudflare waf rule
- block malicious bots cloudflare
- configure managed ruleset waf

## Execution SOP & Rules
1. Write expressions using Cloudflare Wirefilter syntax: (cf.threat_score gt 20 and not cf.bot_management.verified_bot).
2. Use Managed Challenge action rather than hard Block to avoid alienating legitimate false positives.
3. Configure rate-limiting rules on sensitive authentication and payment API endpoints.
4. Monitor blocked and challenged request telemetry in Cloudflare Analytics before finalizing rules.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
