Skip to content

docs(gcp): document required IAM permissions in GCP codebundle READMEs - #724

Open
theyashl wants to merge 1 commit into
mainfrom
docs/gcp-codebundle-permissions
Open

docs(gcp): document required IAM permissions in GCP codebundle READMEs#724
theyashl wants to merge 1 commit into
mainfrom
docs/gcp-codebundle-permissions

Conversation

@theyashl

@theyashl theyashl commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What

Scanned every GCP codebundle (those that actually invoke gcloud / gsutil / bq) and documented the granular IAM permissions each one needs to run, along with suggested least-privilege predefined roles, in a consistent ## Requirements section of each README.

Why

Permission requirements were inconsistent or missing across GCP codebundles: some had accurate granular lists (e.g. gcp-cloud-function-health), others said only "Viewer / Security Reviewer", carried stale TODO: update required GCP SA permissions placeholders, or (for the GMP bundles) referenced the wrong API entirely. Operators setting up service accounts had no reliable per-bundle least-privilege reference.

How

Each codebundle's scripts (*.robot, *.sh, *.py) were analyzed to extract every gcloud/gsutil/bq command and REST endpoint, then mapped to the minimal IAM permission(s) and a covering predefined role.

Codebundles updated (11)

Codebundle Suggested roles
curl-gmp-kong-ingress-inspection monitoring.viewer
curl-gmp-nginx-ingress-inspection monitoring.viewer (+ kubeconfig RBAC)
gcloud-log-inspection logging.viewer
gcp-bigquery-dataset-health bigquery.metadataViewer, iam.securityReviewer, logging.viewer
gcp-bucket-health iam.securityReviewer, storage.objectViewer, monitoring.viewer, serviceusage.serviceUsageViewer
gcp-cloud-function-health cloudfunctions.viewer, run.viewer, cloudbuild.builds.viewer, logging.viewer
gcp-cloud-loadbalancer-health compute.viewer, monitoring.viewer
gcp-project-cost-health bigquery.jobUser + bigquery.dataViewer, recommender.viewer, billing.viewer, compute.viewer, serviceusage.serviceUsageViewer, viewer
gcp-vertex-modelgarden-health monitoring.viewer, logging.privateLogViewer, serviceusage.serviceUsageConsumer, aiplatform.viewer (discovery)
gke-cluster-health container.viewer, compute.viewer, recommender.viewer, iam.securityReviewer, browser
k8s-ingress-gce-healthcheck compute.viewer, logging.viewer (+ kubeconfig RBAC)

Notable corrections

  • GMP bundles (curl-gmp-*): the old note claimed the SA needs "GCP logging API" access — they actually query Cloud Monitoring (monitoring.timeSeries.list). Fixed.
  • gcp-bucket-health: replaced vague "Viewer / Security Reviewer" and removed the stale TODO: Update required GCP SA permissions.
  • gcp-bigquery-dataset-health: dropped bigquery.dataViewer — the bundle runs no queries (metadata-only bq ls/bq show), so bigquery.metadataViewer suffices.
  • gke-cluster-health: clarified that the write permissions in sa_check.sh are permissions it audits on node-pool SAs, not permissions the runner SA needs.

Notes: access:read-only throughout — no write/mutate permissions are documented. Scope was limited to GCP per request; AWS/Azure/k8s codebundles are untouched.

🤖 Generated with Claude Code

Scanned all GCP codebundles (those invoking gcloud/gsutil/bq) and documented
the granular IAM permissions each one actually needs, plus suggested
least-privilege predefined roles, in a consistent "Requirements" section.

Covers 11 codebundles: curl-gmp-kong-ingress-inspection,
curl-gmp-nginx-ingress-inspection, gcloud-log-inspection,
gcp-bigquery-dataset-health, gcp-bucket-health, gcp-cloud-function-health,
gcp-cloud-loadbalancer-health, gcp-project-cost-health,
gcp-vertex-modelgarden-health, gke-cluster-health, k8s-ingress-gce-healthcheck.

- Derived permissions by analyzing every gcloud/gsutil/bq call and REST endpoint
- Added granular permissions + suggested roles (both) per README
- Fixed misleading "logging API" notes on the GMP bundles (they use Monitoring)
- Replaced vague "Viewer / Security Reviewer" guidance and removed the stale
  "TODO: update required GCP SA permissions" placeholders

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@theyashl
theyashl requested a review from a team as a code owner August 7, 2026 10:31
@theyashl theyashl self-assigned this Aug 7, 2026
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.

1 participant