An application developer needs to access and retrieve configuration secrets stored in Google Cloud Secret Manager for a single project named `prod-config-service`. The developer should be able to read secret values and list secret versions, but must not be allowed to modify secret payloads, delete secret versions, or alter IAM access policies. Additionally, enterprise security policy requires following the principle of least privilege and avoiding unnecessary access across the resource hierarchy. Which IAM role assignment strategy should be implemented?
- Grant the predefined Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) to the developer on the prod-config-service project.Answer
- BGrant the primitive Viewer role (roles/viewer) to the developer on the prod-config-service project.
- CGrant the predefined Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) to the developer at the parent Folder level containing the project.
- DGrant the primitive Editor role (roles/editor) to the developer at the Organization level.
Answer
Grant the predefined Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) to the developer on the prod-config-service project.
The Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) provides read access to secret payloads and secret version metadata. Binding this predefined role specifically at the project resource level fulfills the developer's operational need while adhering strictly to the principle of least privilege.
Step-by-Step Solution
Key Concept
Applying least-privilege predefined IAM roles at the specific project scope