'Cloudflare gives access denied when accessing a website from GCP instance
I have written a Python script using Selenium to automate a workflow on a third-party website. It works fine on my machine.
But when I try to run the same script on a GCP instance, I get Cloudflare's 1020 Access Denied error. I am using Google Chrome headless as the Selenium webdriver.
I am guessing the website owner has put a blanket firewall restriction on GCP instance external IPs.
My questions:
- Does my assumption makes sense? It is even possible to put such a restriction?
- How do I bypass the firewall? What if I set static IP to the GCP instance? Or some way to use VPN through the headless Chrome?
- Would changing the cloud provider help? Any less well know cloud provider which won't be blocked?
Any other suggestions?
Solution 1:[1]
- Yes, the Cloudflare firewall can block IP ranges amongst other options so this in entirely possible.
- Not sure you should ask how to circumvent security. A static IP might work or it might not, it depends entirely on the unknown restrictions set by the website operator. Again, VPN may or may not work depending on what restrictions the website operator set up.
- Since we can't know what restrictions are in place another cloud provider might work or it might not. It could also stop working if the website operator decides to block that IP range as well.
The only way to be sure is to ask the website operator.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | PeteP |
