nerdexam
Google

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.

Submitted by javi_es· Mar 30, 2026Configuring access and security

Question

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 crm-databases project. You want to follow Google-recommended practices to grant access to the service account in the web-applications project. What should you do?

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)
  • B
    8% (1)
  • C
    8% (1)
  • D
    85% (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.

AGrant "project owner" for web-applications appropriate roles to crm-databases.

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.

BGrant "project owner" role to crm-databases and the web-applications project.

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.

CGrant "project owner" role to crm-databases and roles/bigquery.dataViewer role to web-

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`.

DGrant roles/bigquery.dataViewer role to crm-databases and appropriate roles to web-applications.Correct

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

#service accounts#cross-project IAM#BigQuery access#least privilege

Community Discussion

No community discussion yet for this question.

Full ASSOCIATE-CLOUD-ENGINEER Practice