Skip to content

Troubleshooting Cloudflare action #3162

Answered by neil-verus
neil-verus asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Sebres, sorry for the delay.

I eventually ended up using the Firewall Access Rules API for a zone: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-create-access-rule

I created a token scoped to the zone I was working with in Cloudflare and with zone:firewall services:edit privileges, then used the API token generated in actionban like this:

actionban = curl -X POST "https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/firewall/access_rules/rules" -H "Authorization: Bearer <TOKEN>" -H "Content-Type: application/json" --data '{"mode":"block","configuration":{"target":"ip","value":"<IP>"},"notes":"Fail2Ban carding"}'

The action is working great now.

Thanks for your help with t…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sebres
Comment options

Comment options

You must be logged in to vote
2 replies
@sebres
Comment options

@sebres
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by neil-verus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants