【问题标题】:GCP: what are the permissions of viewer role has?GCP:查看者角色有哪些权限?
【发布时间】:2021-07-15 00:14:44
【问题描述】:

我正在研究 GCP 中的角色。我有一个用例来阅读 GCP 中的所有内容。因此,当我查看查看者角色时,文档说它是只读角色,但似乎有很多限制。查看者角色的确切权限是什么?

【问题讨论】:

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


    【解决方案1】:
    推荐的答案 Google Cloud

    要列出角色包含的权限,请使用 CLI:

    gcloud iam roles describe roles/editor
    

    gcloud iam roles describe

    Editor 是一个预定义的角色,目前拥有 4,078 个权限。 Google Cloud 管理预定义角色的权限。这意味着分配给这些角色的权限会随着时间而改变。

    【讨论】:

      【解决方案2】:

      您可以将以下 gcloud 命令用于角色/查看器。

      gcloud iam 角色描述角色/查看者

      您可以使用 gcloud 命令行工具的 add-iam-policy-bindingremove-iam-policy-binding 命令添加或撤消单个角色。 授予访问权限:

      要快速向成员授予角色,请运行以下 gcloud ‘add-iam-policy-binding’ 命令:

      gcloud 项目 add-iam-policy-binding my-project --member=user:my-user@example.com --role=roles/viewer

      gcloud 项目 add-iam-policy-binding my-project --member=user:my-user@example.com --role=roles/editor

      撤销访问权限:

      gcloud 项目 remove-iam-policy-binding my-project --member=user:my-user@example.com --role=roles/viewer

      更多信息,也可以参考gcloud iam roles describe,角色Granting changing and revoking获取资源。

      【讨论】:

        【解决方案3】:

        您还应该牢记适用于基本角色的“便利价值”的概念。

        对于查看者角色,默认情况下,授予此角色的身份将被授予比运行 gcloud 命令时列出的权限更多的权限;

        gcloud iam roles describe roles/viewer
        

        除了列出的权限外,他们还可以通过便利值读取授予角色的资源下的所有对象 - 请参阅 Google 文档中的 this link。例如,bucket ACL 上的 roles/storage.legacyObjectReader 或 READER 默认会被授予(这取决于是否配置了 Uniform Bucket Level Access)。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2013-01-18
          • 1970-01-01
          • 1970-01-01
          • 2022-12-12
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多