【问题标题】:Google Cloud: deny access to a single file in a given bucketGoogle Cloud:拒绝访问给定存储桶中的单个文件
【发布时间】:2018-03-05 18:47:39
【问题描述】:

假设我有:

  • 一个 Google Cloud Storage 存储桶 bucketxyz 和两个用户组:group1group2
  • 额外的第三组allusers,包括group1group2 中的所有用户。

然后:

  • bucketxyz 的 IAM 策略授予对allusers只读访问权限和读/写(但没有所有权,以避免文件删除)@987654329 @。

考虑bucketxyz 的两个文件:file_shared.txtfile_resticted.txt 以及这两种情况:

  1. file_shared.txt 可以由 group1 中的某人写,但也 group2 中的用户可以访问 - 只需使用上述 IAM 策略即可。
  2. file_restricted.txt 只能由group1 中的用户编写和访问。

是否可以通过在bucketxyz 中为file_restricted.txt 使用专用ACL 规则 来实现场景#2?如果是,如何?

【问题讨论】:

    标签: google-cloud-platform google-cloud-storage google-cloud-iam


    【解决方案1】:

    IAM 中的权限是同心的,并且没有“拒绝”的概念 - 如 IAM Policy Hierarchy documentation“子策略不能限制父级授予的访问权限”中所述。

    要实现group1group2 可以访问file_shared.txt 但只有group2 可以访问file_restricted.txt 的情况,您需要将每个对象的访问权限授予group1group2。或者,您可以在bucketxyz 级别授予group2 读/写访问权限,并将每个对象的读访问权限授予group1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-04
      • 2019-02-03
      • 2020-04-01
      • 1970-01-01
      • 2018-01-10
      相关资源
      最近更新 更多