Skip to main content
compliance · gcp

GCS buckets with an empty CORS configuration

resource types
1
rule IDs covered
1
severity
low

What does ZopNight detect here?

Missing CORS configuration on a GCS bucket only matters when browsers call the bucket cross-origin; ZopNight reports it as a low-severity RC-1230 finding, not a vulnerability. Detection fires solely on the discoverer's explicit cors_configured=false flag, so buckets that were never enriched are skipped rather than accused.

Signal and threshold

How ZopNight evaluates GCS buckets with an empty CORS configuration.
Field Value
Rule IDsRC-1230
Categorycompliance
Severitylow
Metricnone — pure configuration read
Sourcebucket_cors.go

A finding about browsers, not attackers

Honesty first: an absent CORS configuration is not an exposure. CORS is the mechanism by which a bucket tells browsers which foreign origins may read its responses from JavaScript; with no configuration, browsers simply block those cross-origin reads. Server-side clients, gcloud, and signed-URL downloads opened directly are unaffected. So the rule describes a functionality gap with a compliance-hygiene edge, and ZopNight rates it low accordingly. The gap bites in one specific shape: a web app starts fetching objects from storage.googleapis.com via XHR or fetch, requests fail with CORS errors, and someone “fixes” it under deadline pressure with a wildcard * origin, which is the actual misconfiguration worth preventing. Flagging unconfigured buckets early is a nudge to decide the origin list deliberately instead of in an outage.

When leaving it unconfigured is correct

Most buckets never serve a browser. For backups, data-lake zones, build artifacts, and log sinks, no CORS entries is the right end state, and adding permissive entries would only widen the surface. If a flagged bucket is in that category, resolve the finding by confirming the bucket has no browser consumers, not by adding configuration for its own sake.

Inspect and set the CORS entries

Terminal window
gcloud storage buckets describe gs://BUCKET --format="json(cors_config)"

null reproduces the finding. For a bucket that does serve web apps, write a minimal policy with named origins, narrow methods, and a sane cache time:

Terminal window
cat > cors.json <<'EOF'
[{"origin": ["https://app.example.com"], "method": ["GET"], "maxAgeSeconds": 3600}]
EOF
gcloud storage buckets update gs://BUCKET --cors-file=cors.json

Avoid "origin": ["*"] anywhere credentials or non-public data are involved.

How the rule decides, and when it abstains

The discoverer computes cors_configured as a boolean (whether the bucket’s CORS array has at least 1 entry) and writes it into resource metadata. The rule fires only on the explicit string false; an absent key means the bucket was never enriched, and the rule skips it rather than firing on unknown state. Historically this was the only one of the six GCS bucket rules still reading the legacy tags mirror of that value; it now reads metadata directly like its siblings. Everything involved is a read (storage.buckets.get for enrichment, discovery under roles/cloudasset.viewer). ZopNight never writes CORS policy for you.

See it fire on your bill.

Connect an account read-only. The first findings land in minutes.

417 rule families across 353 resource types on 22 platforms. Every threshold, metric, and IAM action is documented on these pages before you grant anything.

417 rule families documented
353 resource types covered
read-only default access level
Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console·