create_waf_rule_tool
Create a Cloudflare WAF custom rule to block, challenge, or log requests matching a filter expression, enforcing zone access policies without manual dashboard setup.
Instructions
Create a new WAF custom rule.
Free plans support up to 5 custom rules. Provide either zone_id or zone_name, not both.
Args: zone_id: Zone ID (32-character hex string) zone_name: Zone name (domain like example.com) expression: Cloudflare filter expression (e.g., '(http.request.uri.path contains "xmlrpc.php")') action: Action to take (managed_challenge, block, js_challenge, challenge, skip, log) description: Human-readable description of the rule enabled: Whether the rule is enabled (default: true)
Returns: Created rule details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | managed_challenge | |
| enabled | No | ||
| zone_id | No | ||
| zone_name | No | ||
| expression | No | ||
| description | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||