Skip to content

GCP provider setup: least-privilege roles and checks for CIS v5.0 configuration reads - #448

Open
maximelb wants to merge 3 commits into
masterfrom
cis-wp-perm
Open

maximelb wants to merge 3 commits into
masterfrom
cis-wp-perm

Conversation

@maximelb

@maximelb maximelb commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Updates the Google Cloud provider setup page:

  • Required roles now match the web app's grant. The page asks for roles/browser, roles/compute.viewer and roles/iam.securityReviewer, the same least-privilege set as the in-app Permissions required list and its generated gcloud script. Until now the page asked for roles/viewer, which grants much more than the collector reads. roles/viewer stays documented as an alternative, with what it still lacks:

    • resourcemanager.organizations.get / folders.get, needed by the auth check for org and folder scopes, so add roles/browser;
    • bigquery.tables.get, so add roles/bigquery.metadataViewer.
  • New optional roles for the configuration reads behind the CIS Google Cloud Foundation Benchmark checks: roles/bigquery.metadataViewer (metadata only, no table data), roles/accessapproval.viewer, roles/appengine.appViewer and roles/orgpolicy.policyViewer.

  • APIs to enable: Organization Policy, Logging, Monitoring, Cloud DNS, Essential Contacts, Access Approval, App Engine Admin and Dataproc.

  • New provider test checks added to the table: sa_keys, audit_config, essential_contacts, log_sinks, log_metrics_alerts, dns, network_config, service_usage, access_approval, app_engine, cloud_sql, kms, api_keys, bigquery_metadata, dataproc. The page explains that these use testIamPermissions and name the missing permission and the role to add.

  • APIs checked on the service account's project. For API Keys, Essential Contacts, Access Approval, Organization Policy, Access Context Manager and Policy Analyzer, Google checks enablement on the project that owns the calling service account. If one is off there, every read fails with SERVICE_DISABLED naming that project, and the dependent controls read as not assessed. The page now says so, gives a gcloud services enable command for that project, adds accesscontextmanager.googleapis.com to the enable list, notes which provider test checks catch it (Organization Policy, Access Context Manager, Policy Analyzer) and which do not (API Keys, Essential Contacts, Access Approval are IAM-only checks), and replaces the stale activity_ciem troubleshooting row with the generic "enable this API in the project this message names" failure. Verified live against each API with a service account whose own project had them disabled.

Role contents were verified with gcloud iam roles describe. The permissions used by the new checks were verified to be accepted by testIamPermissions on a project, a folder and an organization.

Merge timing: the new check ids appear once the matching service release is deployed. Please merge this when that release ships.

Self-review

This repository has no automated review, so I reviewed the diff myself. Fixed before opening: a miscounted "three things" sentence, and a claim about how unread controls are graded that describes behaviour not yet released. markdownlint: 0 issues. Second pass (caller-checked APIs): narrowed the troubleshooting row to the three checks that actually probe those APIs, and softened a claim that enabling in scanned projects is irrelevant for every API (only shown for API Keys and Essential Contacts).

🤖 Generated with Claude Code

…S v5.0 configuration reads

Aligns the required roles with the web app's grant (roles/browser,
roles/compute.viewer, roles/iam.securityReviewer), keeps roles/viewer as a
documented alternative with what it lacks, adds the optional
roles/bigquery.metadataViewer, roles/accessapproval.viewer,
roles/appengine.appViewer and roles/orgpolicy.policyViewer, the APIs the new
reads use, and the new provider test checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
lcbill
lcbill previously approved these changes Sep 24, 2026
…destination buckets

The retention lock check on the Cloud Storage buckets that log sinks export to
reads each bucket with storage.buckets.get, which none of the required roles
carries. roles/storage.bucketViewer holds only storage.buckets.get and
storage.buckets.list (bucket metadata, no object data). Adds it to the optional
roles table, the gcloud script, the roles/viewer tip, and the new
log_sink_destinations preflight check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@maximelb

Copy link
Copy Markdown
Contributor Author

Added b33da7e: optional roles/storage.bucketViewer for the log sink destination bucket retention-lock check (CIS GCP 2.4), with a new log_sink_destinations preflight check. Verified with gcloud iam roles describe roles/storage.bucketViewer: it contains only storage.buckets.get and storage.buckets.list, so no object access. roles/viewer and roles/iam.securityReviewer do not carry storage.buckets.get, which is why the roles/viewer tip now mentions it. testIamPermissions accepts storage.buckets.get on a project, a folder and an organization (checked live).

Self-review: the role, permission and check names match the collector and preflight code. The check is marked optional (—). No private repo references.

lcbill
lcbill previously approved these changes Sep 24, 2026
…'s project

Google checks API Keys, Essential Contacts, Access Approval, Organization
Policy, Access Context Manager and Policy Analyzer enablement on the
calling service account's project. Document that, add Access Context
Manager to the enable list, and replace the stale activity_ciem
troubleshooting row with the generic "enable this API in the project this
message names" failure.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@limacharlie-refractionpoint

Copy link
Copy Markdown

LimaCharlie Cloud Security — code scan

No new code findings were introduced by this pull request.

This check reports and never fails: no gating.fail_on is set on the code_scanning policy.

Scanned refractionPOINT/documentation 278f605…e9a402a — only findings new in the head commit are listed; anything already on the base branch is the repository's own finding set, on the Cloud Security Code page.

This comment is updated in place on every push to this pull request.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants