A newly hired database administrator needs read-only access to view Cloud SQL instance configuration details within a single project named `db-dev-app`. The administrator does not require access to read database table contents or modify any resources. Adhering to the principle of least privilege, which IAM role assignment should you select?
- Grant the Cloud SQL Viewer role (`roles/cloudsql.viewer`) on the `db-dev-app` project.Answer
- BGrant the primitive Viewer role (`roles/viewer`) on the `db-dev-app` project.
- CGrant the Cloud SQL Admin role (`roles/cloudsql.admin`) on the `db-dev-app` project.
- DGrant the Cloud SQL Viewer role (`roles/cloudsql.viewer`) at the parent Folder level containing the project.
Answer
Grant the Cloud SQL Viewer role (`roles/cloudsql.viewer`) on the `db-dev-app` project.
Granting the predefined `roles/cloudsql.viewer` role directly on the target project (`db-dev-app`) provides the exact read-only access necessary for Cloud SQL resources without granting permissions to other services or other projects.
Step-by-Step Solution
Key Concept
Principle of Least Privilege and Resource Hierarchy Scope in IAM
Estimated Time:45s