A database compliance auditor needs to inspect table schemas and execute read-only queries against a Cloud Spanner database named `inventory-db` within the production project `retail-prod`. The auditor must not have permissions to modify data, alter schemas, or access unrelated GCP resources in the project. Adhering to the principle of least privilege, which IAM role configuration should you grant to the auditor?
- Grant the Cloud Spanner Database Reader role (roles/spanner.databaseReader) on the specific project or database resource.Answer
- BGrant the Primitive Viewer role (roles/viewer) at the project level.
- CGrant the Cloud Spanner Database Reader role (roles/spanner.databaseReader) at the parent Folder level containing the project.
- DGrant the Primitive Editor role (roles/editor) on the Cloud Spanner instance.
Answer
Grant the Cloud Spanner Database Reader role (roles/spanner.databaseReader) to the auditor for the specific database or project scope.
Granting the Cloud Spanner Database Reader role (roles/spanner.databaseReader) at the project or database scope adheres strictly to the principle of least privilege. It enables read access to database data and schema definitions without granting access to write data or manage other GCP resources.
Step-by-Step Solution
Key Concept
Selecting granular predefined roles bounded to specific project resources according to the Principle of Least Privilege.