An organization needs to configure IAM permissions for an automated monitoring service account. The service account must be able to read log entries in Cloud Logging for a specific project and upload generated report files into a designated Cloud Storage bucket, without being able to read or modify existing files in that bucket. Adhering strictly to Google Cloud's principle of least privilege, which TWO role assignments should be granted? (Select TWO.)
- Grant the Logs Viewer role (roles/logging.viewer) to the service account at the project level.Answer
- Grant the Storage Object Creator role (roles/storage.objectCreator) to the service account on the specific Cloud Storage bucket.Answer
- CGrant the Editor role (roles/editor) to the service account at the project level.
- DGrant the Storage Admin role (roles/storage.admin) to the service account at the organization level and apply a project-level policy to revoke delete permissions.
Answer
Granting the Logs Viewer role (roles/logging.viewer) at the project level and the Storage Object Creator role (roles/storage.objectCreator) on the target Cloud Storage bucket.
To fulfill the principle of least privilege, specific predefined roles should be assigned at the narrowest appropriate resource level. Assigning the Logs Viewer role (roles/logging.viewer) at the project level grants read access to log entries without broader management rights. Assigning the Storage Object Creator role (roles/storage.objectCreator) on the specific Cloud Storage bucket allows uploading report files without permitting object deletion or viewing existing data.
Step-by-Step Solution
Key Concept
Managing least-privilege predefined IAM roles at appropriate resource hierarchy levels