A reporting service account needs to read objects from a single Cloud Storage bucket that holds nightly exports. It must never write, delete, or change bucket configuration. Following least privilege, which predefined role should be granted on that bucket?
- AGrant roles/editor at the project level so the service account inherits object read access to the bucket along with the other permissions the reporting job may later require.
- BGrant roles/storage.objectViewer on the bucket so the account can read and list objects there without any permission to modify or remove them. Correct
- CGrant roles/storage.objectAdmin on the bucket so the account can list and read the exported objects while Cloud Storage handles the reporting access it needs.
- DGrant roles/storage.admin on the bucket so the account has a role dedicated to Cloud Storage rather than a broad basic role at the project level.
Why A is wrong: Tempting because Editor certainly includes reading objects, but it is a basic role spanning almost every service in the project, which massively over-grants for a read-only bucket task.
Why B is correct: Correct: objectViewer grants exactly get and list on objects for that bucket, matching the read-only need with no write, delete, or admin capability.
Why C is wrong: Tempting because it is scoped to the bucket, but objectAdmin also allows creating, overwriting, and deleting objects, which exceeds the stated read-only requirement.
Why D is wrong: Tempting because it is a service-specific role, but storage.admin confers full control over buckets and objects including deletion and IAM changes, far beyond reading exports.