A log sink should export a copy of all log entries
This check looks at the Cloud Logging sinks in your projects and whether at least one has no filter that narrows it, so every log entry is copied to a destination you control. The safe setting is a sink that exports all entries to a storage bucket, dataset or topic.
Why it matters
Cloud Logging keeps entries in its own log buckets for a limited time. If you want to look back further, investigate an incident after the retention period or keep logs where an attacker with project access cannot easily delete them, you need a copy somewhere else. A sink without a restrictive filter creates that copy for every entry.
Google explains sinks and how routing works in Routing and storage overview and shows how to create one in Configure and manage sinks.
How to check it yourself
In the Google Cloud console open Logging, then Log Router. The table lists each sink with its destination and its inclusion filter. A sink with an empty filter exports everything. The commands below only read configuration:
gcloud logging sinks list --project=PROJECT_ID
gcloud logging sinks describe SINK_NAME --project=PROJECT_ID \
--format="value(destination, filter, disabled)"If the list shows only the built-in _Required and _Default sinks, no copy leaves Cloud Logging. A sink that has a filter value only exports the entries that match it, and a sink with disabled set to True exports nothing. For a whole organization, add --organization=ORG_ID to the commands.
How to fix it
In Logging, Log Router, choose Create sink, give it a name, choose the destination (a Cloud Storage bucket, a BigQuery dataset or a Pub/Sub topic), and leave the inclusion filter empty. For many projects it is simpler to create one aggregated sink at the organization or folder.
Scripted version for a storage bucket. It changes your environment, so ConfigCobra never runs it for you:
gcloud logging sinks create all-logs-sink \
storage.googleapis.com/EXAMPLE_LOG_BUCKET --project=PROJECT_ID
# the command prints a writer identity; give it write access to the bucket
gcloud storage buckets add-iam-policy-binding gs://EXAMPLE_LOG_BUCKET \
--member=WRITER_IDENTITY --role=roles/storage.objectCreatorAdd --organization=ORG_ID and --include-children to cover every project under an organization instead.
What changes when you fix it
The people affected are the owners of the destination and whoever pays for it. Applications and users in the project notice nothing, because routing happens inside Cloud Logging.
- Storage costs grow with log volume, so size and set a lifecycle on the destination before turning it on.
- The sink only copies entries written after it exists. Older entries are not backfilled.
- The destination now holds sensitive operational data. Restrict who can read it, ideally in a separate project.
- If the writer identity lacks permission, entries are not delivered, so test with a fresh log line.
Decide who owns the log destination and how long to keep the data before you create the sink.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Google Cloud Platform Foundation v5.0.0 | 2.3 | 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.