A cloud administrator needs to grant a developer permissions to view Compute Engine virtual machine details and inspect Cloud Logging entries in a Google Cloud project. Following Google Cloud best practices and the principle of least privilege, which of the following predefined roles should be assigned to the developer? (Select TWO.)
- Compute Viewer (roles/compute.viewer)Answer
- Logs Viewer (roles/logging.viewer)Answer
- CEditor (roles/editor)
- DOwner (roles/owner)
Answer
Assign the Compute Viewer (roles/compute.viewer) and Logs Viewer (roles/logging.viewer) predefined roles.
Google Cloud IAM best practices dictate assigning granular predefined roles instead of broad primitive roles. The Compute Viewer role grants read-only access to inspect VM instance details, and the Logs Viewer role grants read-only access to view logs in Cloud Logging. Assigning both fulfills the requirements under the principle of least privilege.
Step-by-Step Solution
Key Concept
Applying Least Privilege using GCP Predefined IAM Roles