ASSOCIATE-CLOUD-ENGINEER · Question #315
You are configuring service accounts for an application that spans multiple projects. Virtual machines (VMs) running in the web-applications project need access to BigQuery datasets in the…
The correct answer is D. Grant roles/bigquery.dataViewer role to crm-databases and appropriate roles to web-applications. To allow a service account in the web-applications project to access BigQuery datasets in the crm-databases project, grant the specific roles/bigquery.dataViewer role to the service account within the crm-databases project, following the principle of least privilege.
Question
Options
- AGrant "project owner" for web-applications appropriate roles to crm-databases.
- BGrant "project owner" role to crm-databases and the web-applications project.
- CGrant "project owner" role to crm-databases and roles/bigquery.dataViewer role to web-
- DGrant roles/bigquery.dataViewer role to crm-databases and appropriate roles to web-applications.
How the community answered
(13 responses)- B8% (1)
- C8% (1)
- D85% (11)
Why each option
To allow a service account in the `web-applications` project to access BigQuery datasets in the `crm-databases` project, grant the specific `roles/bigquery.dataViewer` role to the service account within the `crm-databases` project, following the principle of least privilege.
Granting "project owner" at either project level is too broad and violates the principle of least privilege, as it provides excessive permissions beyond just BigQuery data viewing.
Granting the "project owner" role to the `crm-databases` project would give the service account full administrative control over the entire project, which is excessive for merely viewing BigQuery datasets.
Granting "project owner" to `crm-databases` is too permissive, and `roles/bigquery.dataViewer` should be granted to the service account (principal), not the `web-applications` project itself as a resource, when defining access on `crm-databases`.
The recommended practice for cross-project access is to grant specific, minimal roles to the service account of the requesting project on the resource project. Granting `roles/bigquery.dataViewer` to the service account (implicitly part of the "appropriate roles" for web-applications) on the `crm-databases` project's BigQuery datasets adheres to the principle of least privilege, allowing data viewing without excessive permissions.
Concept tested: Cross-project service account access with least privilege
Source: https://cloud.google.com/iam/docs/understanding-roles#bigquery-roles
Topics
Community Discussion
No community discussion yet for this question.