A cloud engineer is configuring a Google Cloud Storage bucket named `media-assets-prod` for a streaming application. Security policies require that access control must be managed uniformly across all objects using Identity and Access Management (IAM) rather than individual object ACLs. Additionally, a service account named `[email protected]` must be granted permission to read objects stored in the bucket using modern `gcloud storage` CLI commands. Which TWO commands should the engineer execute to achieve this configuration? (Select TWO.)
- gcloud storage buckets update gs://media-assets-prod --uniform-bucket-level-accessAnswer
- Bgsutil acl ch -u [email protected]:R gs://media-assets-prod
- gcloud storage buckets add-iam-policy-binding gs://media-assets-prod --member="serviceAccount:[email protected]" --role="roles/storage.objectViewer"Answer
- Dgcloud storage buckets add-iam-policy-binding gs://media-assets-prod --member="serviceAccount:[email protected]" --role="roles/owner"
Answer
Enabling uniform bucket-level access via `gcloud storage buckets update gs://media-assets-prod --uniform-bucket-level-access` and granting read permissions with `gcloud storage buckets add-iam-policy-binding gs://media-assets-prod --member="serviceAccount:[email protected]" --role="roles/storage.objectViewer"` fulfills all security requirements.
To satisfy uniform access control and principle of least privilege, Uniform Bucket-Level Access must be enabled using `gcloud storage buckets update --uniform-bucket-level-access`, and object read access must be granted using the predefined `roles/storage.objectViewer` IAM role via `gcloud storage buckets add-iam-policy-binding`.
Step-by-Step Solution
Key Concept
Deploying and configuring Cloud Storage buckets with Uniform Bucket-Level Access and IAM roles using gcloud storage CLI.