How to write a waf rule on cloudflare

from cloudflare document I know use API to create a ruleset ,add waf rule to ruleset , deploy the ruleset .
but I want to know how to write to a waf rule ?
do you give a sample or document ?
thank you!

Where are you seeing that this is possible? The API calls you mention are for existing WAF rules.

It’s possible to make your own Firewall Rule. That’s listed in the WAF section of dev docs.
https://developers.cloudflare.com/waf/custom-rules/custom-firewall/create-dashboard

2 Likes

OK ,thank you for your reply.
The mean that Cloudflare API can create ruleset and add waf rule into ruleset.
but want to create a waf rule use the follow doc ,then a firewall rule == a waf rule.
https://developers.cloudflare.com/waf/custom-rules/custom-firewall/create-dashboard
Is my understanding correct ?

I just stick to calling it a Firewall Rule since there’s a specific place in the dashboard for that, and it’s separate from where WAF rules are.

If I was going to use the API to create a Firewall Rule, I’d use this API syntax:
https://api.cloudflare.com/#firewall-rules-create-firewall-rules

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.