Changes to audit configuration should raise an alert
This check looks for a log-based metric that counts changes to a project's audit configuration, and an alerting policy attached to it. The safe setting is that both exist, so someone is told when audit logging is altered.
Why it matters
Audit logs are the record of who did what in a project. The audit settings live in the project's IAM policy, so anyone able to edit that policy can narrow what is logged. An attacker, or a well-meaning admin, switching logging off for a service leaves a gap exactly where you would later want evidence.
Google Cloud lets you turn log entries into a metric and alert on it. A user-defined log-based metric counts only entries received after it was created, so it has to be in place before the change happens.
Sources: Google Cloud documentation on log-based metrics and on configuring Data Access audit logs.
How to check it yourself
Console: Logging > Log-based Metrics, look for a user-defined metric whose filter matches audit configuration changes; then Monitoring > Alerting and confirm a policy uses that metric. Read-only commands:
gcloud logging metrics list --project=
gcloud alpha monitoring policies list --project= Inspect the metric filter and the policy condition to confirm they refer to audit configuration changes.
How to fix it
Create a counter metric with a filter on SetIamPolicy calls that change auditConfigs (for example protoPayload.methodName="SetIamPolicy" AND protoPayload.serviceData.policyDelta.auditConfigDeltas:*), then in Monitoring create an alerting policy on that metric with a notification channel your team reads. Script (run by an admin, not by ConfigCobra):
gcloud logging metrics create audit-config-changes \
--description="Audit configuration changes" \
--log-filter='protoPayload.methodName="SetIamPolicy" AND protoPayload.serviceData.policyDelta.auditConfigDeltas:*'Then add the alerting policy in the console. ConfigCobra itself never changes your Google Cloud projects; it reports the finding and suggests these steps. Check the filter against your own log entries before relying on it.
What changes when you fix it
Nothing about access or workloads changes. The change is that audit configuration edits now notify a channel, so the people on that channel get a new type of message and should know what to do with it. Legitimate edits, such as enabling a new data access log, will also alert, which is the intended effect. Metrics and alerting policies are billed under Cloud Monitoring and Logging like other usage, so check the projects involved. Security and platform owners are the audience.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Google Cloud Platform Foundation v5.0.0 | 2.6 | Level 1 |
More checks in Logging and Monitoring
Go further
- Logging and Monitoring17 controls in this section
- CIS Google Cloud Platform Foundation v5.0.093 controls
- CIS Google Cloud Platform Foundation checklistEvery control in one list, as CSV
- RemediationSee what a fix changes in your tenant before you apply it, then use the generated script
- Monitoring & DriftScheduled scans, drift detection and email alerts when a control regresses
Check this on your Google Cloud
ConfigCobra runs this check with every other control of the CIS Google Cloud Platform Foundation Benchmark, read-only.