Skip to main content
Five Steps for Cloud Compliance Readiness·A practical playbook for security teamsDownload
CIS Google Cloud Platform Foundation v5.0.0 · 2.3

A log sink should export a copy of all log entries

  • Level 1
  • Logging and Monitoring

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.objectCreator

Add --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

BenchmarkCIS IDProfile
CIS Google Cloud Platform Foundation v5.0.02.3Level 1

Check this on your Google Cloud

ConfigCobra runs this check with every other control of the CIS Google Cloud Platform Foundation Benchmark, read-only.

Get in touch

Let's talk.

Whether you're evaluating ConfigCobra, running an audit, or managing a client fleet — we respond within one business day.

Free trial