A junior administrator needs to check the status and configuration details of Compute Engine virtual machine instances within a specific Google Cloud project. The administrator must not be allowed to perform administrative tasks, create new instances, or stop running virtual machines. To comply with the principle of least privilege, which IAM role should you grant to the administrator at the project level?
- Compute Viewer (roles/compute.viewer)Answer
- BViewer (roles/viewer)
- CCompute Admin (roles/compute.admin)
- DEditor (roles/editor)
Answer
Grant the Compute Viewer (roles/compute.viewer) role at the project level.
Granting the Compute Viewer (roles/compute.viewer) role at the project level adheres strictly to the principle of least privilege by providing read-only access to Compute Engine resources while withholding read access to unrelated services and preventing any modification or lifecycle control.
Step-by-Step Solution
Key Concept
Selecting predefined service roles to enforce the principle of least privilege.