An organization is configuring access for an automated data pipeline in a Google Cloud project named `analytics-prod`. A dedicated service account used by a Cloud Run service requires read access to objects stored in a specific Cloud Storage bucket named `raw-data-vault`. Simultaneously, a data analyst requires access to create query jobs and view table data within BigQuery in the `analytics-prod` project. Security policies mandate strict adherence to the principle of least privilege while preventing unnecessary permission inheritance across the resource hierarchy. Which TWO IAM role assignments should the cloud engineer configure?
- Grant the service account the Storage Object Viewer role (`roles/storage.objectViewer`) bound directly on the `raw-data-vault` bucket.Cevap
- BGrant the service account the Storage Object Viewer role (`roles/storage.objectViewer`) at the parent Organization level.
- Grant the data analyst the BigQuery Data Viewer (`roles/bigquery.dataViewer`) and BigQuery Job User (`roles/bigquery.jobUser`) roles on the `analytics-prod` project.Cevap
- DGrant the data analyst the Editor primitive role (`roles/editor`) on the `analytics-prod` project.
Cevap
Grant the service account the Storage Object Viewer role (`roles/storage.objectViewer`) bound directly on the `raw-data-vault` bucket, and grant the data analyst the BigQuery Data Viewer (`roles/bigquery.dataViewer`) and BigQuery Job User (`roles/bigquery.jobUser`) roles on the `analytics-prod` project.
To comply with the principle of least privilege, permissions should be granted at the narrowest relevant resource scope using predefined roles tailored to specific tasks. Binding the Storage Object Viewer role directly to the specific bucket limits the service account's read access strictly to objects in that bucket. Combining BigQuery Data Viewer and BigQuery Job User at the project level provides the analyst with exact rights to run queries and view data without broader project modification capabilities.
Adım Adım Çözüm
Anahtar Kavram
Applying Least Privilege IAM Role Scope and Predefined Roles