An enterprise organization manages data across multiple Google Cloud projects. A data engineer needs to run automated BigQuery jobs in Project B (`analytics-prod`) that extract log files from a specific Cloud Storage bucket in Project A (`logs-archive`) and write the processed results into a dataset in Project B. The engineer must also be able to execute query jobs in Project B, but must not be granted permissions to modify bucket configurations in Project A or alter IAM access controls in either project. Which IAM role assignment strategy follows Google's recommended security practices and strictly adheres to the principle of least privilege?
- Grant `roles/storage.objectViewer` on the specific Cloud Storage bucket in Project A, and grant `roles/bigquery.dataEditor` on the target BigQuery dataset and `roles/bigquery.jobUser` at the project level in Project B.Answer
- BGrant `roles/editor` at the project level for both Project A and Project B.
- CGrant `roles/storage.admin` at the Project A level and `roles/bigquery.admin` at the Project B level, and attach an IAM Deny policy on the bucket in Project A to block object deletion.
- DGrant `roles/billing.admin` on the organization's billing account and `roles/bigquery.user` on Project B, relying on billing inheritance to access Cloud Storage objects in Project A.
Answer
Grant `roles/storage.objectViewer` on the specific Cloud Storage bucket in Project A, and grant `roles/bigquery.dataEditor` on the target BigQuery dataset and `roles/bigquery.jobUser` at the project level in Project B.
The optimal solution assigns predefined roles at the narrowest possible resource scope. Assigning `roles/storage.objectViewer` on the specific bucket grants read-only access to objects in Project A. Assigning `roles/bigquery.dataEditor` on the dataset in Project B allows table manipulation, while `roles/bigquery.jobUser` at the Project B level allows job execution. This combination perfectly satisfies all operational requirements while honoring the principle of least privilege.
Step-by-Step Solution
Key Concept
Least Privilege IAM Role Scoping Across Projects