Add a Cloudflare firewall rule
cf_firewall_addAdd one firewall rule or rate limit to a Cloudflare zone. What it matches comes from ip or ips (addresses or CIDR), asn, country or countries, path (starts with), user_agent (contains), host and not_verified_bot, combined with and; or a raw expression in Cloudflare's rule language. A rule can block real visitors, so it is undone with cf_undo or cf_firewall_remove.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | ||
| asn | No | ||
| ips | No | ||
| host | No | ||
| path | No | ||
| rule | Yes | block; challenge (a managed challenge most bots fail); js_challenge; allow (skip the other custom rules); log; rate_limit (block an address making more than requests_per_period requests in period_seconds). | |
| zone | No | The zone (domain) at Cloudflare, or any host inside it. Not needed when the user has one zone. | |
| country | No | ||
| enabled | No | ||
| countries | No | ||
| expression | No | A raw Cloudflare expression instead of the fields above. | |
| user_agent | No | ||
| description | No | ||
| period_seconds | No | rate_limit: default 10 (the only value on Free). | |
| not_verified_bot | No | Leave verified search engines (Googlebot, Bingbot) out of the rule. | |
| blocked_for_seconds | No | rate_limit: default 10 (the only value on Free). | |
| requests_per_period | No |