Question for being able to better use curl with cloudflare's ddos protection

Hello! I noticed that often times curl is prevented from being able to access websites and, subsequently, download files because of the ddos protection page.

Is there a way to give curl a key that you can use to bypass this protection? I’d love to be able to use curl to download files from my own website without having to disable the protection.

Hello,
Depending on your configuration you might be able to achieve that by creating a “bypass” Firewall Rules on your zone:
https://developers.cloudflare.com/firewall/cf-firewall-rules/actions

A Firewall Rules can be triggered based on different combination of fields:
https://developers.cloudflare.com/firewall/cf-firewall-language/fields

1 Like

What I do with curl requests I know I can trust is to setup a CF Firewall rule to allow a specific IP and/or custom user agent name only I know. Then pass that custom user agent name with your curl requests :smiley:

Or you can setup a separate HTTP forward proxy and use curl with --proxy flag to make curl requests from that HTTP forward proxy and allow that IP in firewall rules.