Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Cloudflare firewall bulk IP whitelist
IPADDRESS=("" "456.456.456.457" "890.890.890.891")
echo "Adding IP addresses to Cloudflare Firewall..."
echo ''
for i in "${IPADDRESS[@]}"
# do whatever on $i
echo $i
curl -X POST "" \
-H "X-Auth-Email:" \
-H "Content-Type: application/json" \
--data '{"mode":"whitelist","configuration":{"target":"ip","value":"'$i'"},"notes":"Why this IP was added"}'
echo ''
echo ''
echo "Done adding IP addresses to Cloudflare Firewall"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.