A software developer needs to inspect the configuration parameters and operational status of Cloud Run services within a Google Cloud project named `prod-services` to troubleshoot performance issues. The developer must not be allowed to deploy new services, modify existing configurations, or view underlying source code and secrets. Following Google Cloud recommended security practices and the principle of least privilege, which IAM role assignment should you grant to the developer?
- Grant the `roles/run.viewer` role to the developer at the `prod-services` project level.Answer
- BGrant the `roles/viewer` role to the developer at the `prod-services` project level.
- CGrant the `roles/run.viewer` role to the developer at the Organization level and revoke access at the project level.
- DGrant the `roles/editor` role to the developer at the `prod-services` project level.
Answer
Granting the predefined role `roles/run.viewer` at the `prod-services` project level provides read-only access to Cloud Run resources without granting excessive permissions on other project resources.
Assigning the predefined role `roles/run.viewer` at the `prod-services` project level specifically limits the developer's permissions to viewing Cloud Run resources, fulfilling the task requirements while strictly honoring the principle of least privilege.
Step-by-Step Solution
Key Concept
Principle of Least Privilege and Predefined Roles in GCP IAM