Multiple rule add in cloudflare IP firewall via automation

Hi guys,
I was configure a script for added multiple ASN rule on IP firewall, it is successfully created rule, but few of the option is unable to do it.
Below is the script i do:

ASN_name=$(cat ASN_name.txt)

for ASN_name in ASN_name; do update=(curl -X POST “” -H “X-Auth-Email: $auth_email” -H “X-Auth-Key: $auth_key” -H
“Content-Type: application/json” --data “{ “mode”:“whitelist,“configuration”:{“target”:“asn”,“value”:”$ASN_name”},“notes”:“CHINANET-BACKBONE”}")

if [[ $update != ““success”:true” ]]; then
message="$ASN_name FAILED create domain. DUMPING RESULTS: $update"
log “$message”
echo -e “$message”
#exit 1
message="$ASN_name domain created"
log “$message”
echo “$message”


I need to configure the “mode : All websites in account.” Example : (Cloudflare.png), i was check the Cloudflare Api document but can’t find it.

Note: If you would like to create an access rule that applies across all of your owned zones, use the user or organization firewall endpoints as appropriate.

So I’d assume

This topic was automatically closed after 14 days. New replies are no longer allowed.