I want to create a WordPress plugin to manage WAF custom rules for a specific zone ID. Can we use the Cloudflare API endpoint https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets to create custom rules in the free version of Cloudflare?
For Workers & Pages, what is the name of the domain?
devscript.cloud
What is the issue or error you’re encountering
I want to create a WordPress plugin to manage WAF custom rules for a specific zone ID. Can we use the Cloudflare API endpoint https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets to create custom rules in the free version of Cloudflare? In the free version, we cannot create custom rulesets. How can we create a custom WAF rule for the zone ID?
The Custom Rulesets (e.g. collections of rules) requires Enterprise.
You can create “Custom rules” on each individual zone, which CAN be done with the Free plan.
If you’re having a rule, such as e.g. blocking all traffic that appears to originate from outside the European continent, then you will have to apply that rule individually, - once for “example.com”, and once for “example.eu”, if you want the rule to apply to both domains.
The confusion above seems to caused by mixing together individual “Custom rules” (Free) and account-level “Custom rulesets” (Enterprise).
When you list all the rulesets using API, you will get one with a ruleset ID for WAF custom rules. You can create up to 5 custom rules for a zone ID in Cloudflare’s free version using this ruleset ID. For example: