A cloud security administrator needs to grant an automated compliance service permission to read metadata and configuration settings for both Cloud SQL instances and Cloud Pub/Sub topics within a target Google Cloud project named `prod-data-pipeline`. The solution must enforce the Principle of Least Privilege and restrict access strictly to the target project. Which two IAM role bindings should you grant to the service account? (Select TWO.)
- Grant the Cloud SQL Viewer (roles/cloudsql.viewer) role to the service account on the prod-data-pipeline project.Answer
- Grant the Pub/Sub Viewer (roles/pubsub.viewer) role to the service account on the prod-data-pipeline project.Answer
- CGrant the Editor (roles/editor) primitive role to the service account on the prod-data-pipeline project.
- DGrant the Cloud SQL Admin (roles/cloudsql.admin) role to the service account at the parent Folder level.
Answer
The correct role bindings are granting Cloud SQL Viewer (roles/cloudsql.viewer) and Pub/Sub Viewer (roles/pubsub.viewer) to the service account scoped specifically to the target project.
To satisfy least privilege for a read-only metadata compliance audit on specific services within a single project, you must assign resource-specific predefined viewer roles—specifically Cloud SQL Viewer (roles/cloudsql.viewer) and Pub/Sub Viewer (roles/pubsub.viewer)—bound directly to the target project. These roles provide exact read visibility into the target services without permitting data modification or inheriting permissions across other projects.
Step-by-Step Solution
Key Concept
Principle of Least Privilege with Predefined Roles and Resource Hierarchy Scope