I've got this code which produces a JSON response with a lot of IP addresses in it, which I suspect are the most recent IP block rules in my CloudFlare account. I think it's ignoring my request to filter for a specific IP. What am I doing wrong?
Note that this is run with the global 'account' level API key because I have multiple domains sharing the same global IP blocking rules.
curl -s -X GET "; -H "X-Auth-Email: CLOUD_FLARE_ACCOUNT_EMAIL" -H "X-Auth-Key: CLOUD_FLARE_ACCOUNT_API_KEY" -H "Content-Type: application/json" --data '{ "filter": { "ip": { "eq": "123.123.123.123" } } }'
It responds with a page of IP addresses even if 123.123.123.123 is NOT a blocked IP rule.
I presume the filter option is not being respected at all.
I've got this code which produces a JSON response with a lot of IP addresses in it, which I suspect are the most recent IP block rules in my CloudFlare account. I think it's ignoring my request to filter for a specific IP. What am I doing wrong?
Note that this is run with the global 'account' level API key because I have multiple domains sharing the same global IP blocking rules.
curl -s -X GET "https://api.cloudflare/client/v4/user/firewall/access_rules/rules" -H "X-Auth-Email: CLOUD_FLARE_ACCOUNT_EMAIL" -H "X-Auth-Key: CLOUD_FLARE_ACCOUNT_API_KEY" -H "Content-Type: application/json" --data '{ "filter": { "ip": { "eq": "123.123.123.123" } } }'
It responds with a page of IP addresses even if 123.123.123.123 is NOT a blocked IP rule.
I presume the filter option is not being respected at all.
Share Improve this question asked Mar 20 at 17:03 ClaudClaud 9971 gold badge12 silver badges28 bronze badges1 Answer
Reset to default 0This command format works:
curl -s -X GET "https://api.cloudflare/client/v4/user/firewall/access_rules/rules?configuration.target=ip&configuration.value=$IP" -H "X-Auth-Email: $CLOUDFLARE_EMAIL" -H "X-Auth-Key: $CLOUDFLARE_API_KEY" -H "Content-Type: application/json"