Score:0

Which is the appropriate service to allow an ip range to access API Gateway + Cloud Storage on Google Cloud?

mx flag

I'm trying to identify the appropriate service to allow only a certain IP range to make requests to API Gateway and Cloud storage. This is because we only want to accept request coming from cloudflare. We found services such as Cloud NAT, and VPC Firewall rules but it is hard to tell if they apply to API Gateway and Cloud storage. And since we have a small budget we don't want to enable and disable all services. Ideally we want all ou services also to only accept request from the same IP range. Is there a google cloud service that can achieve this?

James S avatar
it flag
Hello, what will be the backend of your API gateway?
anonymous-dev avatar
mx flag
We have cloudrun containers
Score:1
it flag

For Cloud Storage, a feature request is currently presented which will enable access restriction to Google Cloud Storage by IP address. Since this is yet to be confirmed nor implemented, a workaround will be by using VPC Service Controls which you may follow through this documentation.

Another workaround is to set up an HTTPS Load Balancer with your bucket as the backend and a Cloud Armor Policy that will filter the ingress IP address trying to connect to Cloud Storage. This is discussed in another post.

Unfortunately for API Gateway, it does not support ingress filters such as Internal or Internal and Cloud Load Balancing ingress restriction settings. This is an API Gateway’s behavior, as it is not part of the VPC Network in which the Cloud Run service is located. You should be able to use the API Gateway as a backend for your Load Balancer but you will not be able to filter ingress traffic from the Load Balancer by their incoming IPs as the ingress restriction is set to All which allows all requests, including requests directly from the internet to the run.app URL. A feature request is also presented for this through this link. An alternative that you can explore would be Identity Aware Proxy for Cloud Run as discussed from this document.

To keep track of the status/progress of the feature request(s) mentioned, please follow the respective feature request links and click the +1 and the star button to get notified about their updates.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.