Google Storage access based on IP Address

陌路散爱 提交于 2020-02-01 16:10:28

问题


Is there a way to give access to a Google Cloud Storage bucket based on the IP address it is coming from.

On Amazon s3, you can just set this in the access policy like this:

"Condition" :  {
       "IpAddress" : {
          "aws:SourceIp" : ["192.168.176.0/24","192.168.143.0/24"]
      }
}

I do not want to use a signed url.


回答1:


UPDATE: This is now possible using VPC Service Controls


No, this is not currently possible.

There's currently a Feature request to restrict google cloud storage bucket by IP Address.




回答2:


The updated answers on this page are only partially correct and should not be recommended for the use case of access control to Cloud Storage Objects.

Access Context Manager (ACM) defines rules to allow access (e.g. an IP address).

VPC Service Controls create an "island" around a project and ACM rules can be attached. These rules are "ingress" rules and not "egress" rules meaning "anyone at that IP can get into all resources in the project with the correct IAM permissions".

The ACM rule specifying an IP address will allow that IP address to access all Cloud Storage Objects and all other protected resources owned by that project. This is usually not the intended result. You cannot apply an IP address rule to an object, only to all objects in a project. VPC Service Controls are designed to prevent data from getting out of a project and are NOT designed to allow untrusted anonymous users access to a project's resources.




回答3:


The VPC Service Controls [1] allow users to define a security perimeter around Google Cloud Platform resources such as Cloud Storage buckets (and some others) to constrain data within a VPC and help mitigate data exfiltration risks.

[1] https://cloud.google.com/vpc-service-controls/



来源:https://stackoverflow.com/questions/27291342/google-storage-access-based-on-ip-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!