A DevOps engineer is investigating a potential data leak from a sensitive BigQuery dataset hosted in project `corp-analytics-prod`. The engineer runs a `gcloud logging read` command to inspect read operations recorded in Cloud Audit Logs. Although the engineer has been granted the Logs Viewer (`roles/logging.viewer`) role at the project level, the command execution returns no log entries for data read operations, returning only system Admin Activity logs. Which IAM role assignment adheres to the principle of least privilege while enabling the engineer to view these Data Access audit logs?
- Grant the engineer the Private Logs Viewer (`roles/logging.privateLogViewer`) role on project `corp-analytics-prod`.Answer
- BGrant the engineer the Project Viewer (`roles/viewer`) primitive role at the project level.
- CRevoke the Logs Viewer role at the project level and grant the Logs Viewer role at the organization level.
- DGrant the engineer the Logging Admin (`roles/logging.admin`) role at the project level.
Answer
Granting the Private Logs Viewer (`roles/logging.privateLogViewer`) role at the project level allows reading Data Access audit log entries while maintaining least privilege.
Data Access audit logs contain sensitive resource access information and are classified as private logs in Google Cloud Logging. The standard Logs Viewer role lacks the `logging.privateLogEntries.list` permission. Granting the Private Logs Viewer role fulfills the requirement using the least privilege principle.
Step-by-Step Solution
Key Concept
Cloud Audit Logs Access Control and Private Log Viewing
Estimated Time:2m 0s