GCP:IAM 和 BigQuery

GCP: IAM and BigQuery

能否分享一下您对这个问题的看法?

您正在为跨多个项目的应用程序配置服务帐户。 web-applications 项目中的虚拟机 (VM) 运行 需要访问 crm-databases-proj 中的 BigQuery 数据集。您希望遵循 Google 推荐的做法来授予对 web-applications 项目中服务帐户的访问权限。你该怎么办?

一个。将 web-applications 的项目所有者授予 crm-databases-proj 适当的角色。

乙。将项目所有者角色授予 crm-databases-projweb-applications 项目。

C.将项目所有者角色授予 crm-databases-proj,将 bigquery.dataViewer 角色授予 web-applications

D.将 bigquery.dataViewer 角色赋予 crm-databases-proj,将适当的角色赋予 web-applications

这里是 discussion thread.

正如 guillaume 所建议并在 public documentation 中概述的那样,不应在生产环境中使用基本角色(包括所有者):

Caution: Basic roles include thousands of permissions across all Google Cloud services. In production environments, do not grant basic roles unless there is no alternative. Instead, grant the most limited predefined roles or custom roles that meet your needs.

因此,D是正确答案。