PROFESSIONAL-CLOUD-SECURITY-ENGINEER · Question #5
You will create a new Service Account that should be able to list the Compute Engine instances in the project. You want to follow Google-recommended practices. What should you do?
The correct answer is B. Create a custom role with the permission compute.instances.list and grant the Service Account. Google's principle of least privilege recommends granting only the minimum permissions required for a task. To list Compute Engine instances, the only permission needed is compute.instances.list. Creating a custom role with exactly that permission and assigning it to the…
Question
Options
- ACreate an Instance Template, and allow the Service Account Read Only access for the Compute
- BCreate a custom role with the permission compute.instances.list and grant the Service Account
- CGive the Service Account the role of Compute Viewer, and use the new Service Account for all
- DGive the Service Account the role of Project Viewer, and use the new Service Account for all
How the community answered
(49 responses)- A8% (4)
- B76% (37)
- C4% (2)
- D12% (6)
Explanation
Google's principle of least privilege recommends granting only the minimum permissions required for a task. To list Compute Engine instances, the only permission needed is compute.instances.list. Creating a custom role with exactly that permission and assigning it to the Service Account is the most restrictive, correct approach. Option C (Compute Viewer) grants read access to all Compute Engine resources, which is broader than necessary. Option D (Project Viewer) is far too broad, granting read access across all project resources. Option A (Instance Template) is unrelated to the access control requirement.
Topics
Community Discussion
No community discussion yet for this question.