Skip to content

feat(gcp): add image metadata and GKE workload read permissions#50

Merged
vik-nullify merged 1 commit into
fix/gcp-custom-role-project-scopefrom
feat/gcp-add-image-and-gke-workload-perms
May 11, 2026
Merged

feat(gcp): add image metadata and GKE workload read permissions#50
vik-nullify merged 1 commit into
fix/gcp-custom-role-project-scopefrom
feat/gcp-add-image-and-gke-workload-perms

Conversation

@vik-nullify
Copy link
Copy Markdown
Member

@vik-nullify vik-nullify commented May 11, 2026

Summary

Extends the read-only custom role with two additive capabilities:

  1. Artifact Registry image metadatadockerimages.{get,list}, tags.{get,list}, versions.{get,list} so deployed images can be correlated back to their tag
  2. GKE workload read via the control-plane proxy — Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, Pods, Services, Ingresses, NetworkPolicies, ServiceAccounts, Roles/RoleBindings, ClusterRoles/ClusterRoleBindings, ConfigMaps, Namespaces, Nodes (all get/list only).

docs/permissions.md is updated with a per-permission justification and the explicit exclusions for security review.

Excluded by design

Excluded permission Reason
artifactregistry.repositories.downloadArtifacts Image layer bytes (data plane).
container.secrets.* Kubernetes Secret values.
container.events.* Runtime event stream — noisy, may contain sensitive payloads.
container.bindings.*, container.tokenReviews.*, container.subjectAccessReviews.* Write / data-plane verbs.
container.persistentVolumes.*, container.persistentVolumeClaims.* Volume-mount analysis can be added in a follow-up if needed.
container.customResourceDefinitions.*, container.thirdPartyObjects.* CRD instance reads (e.g. Istio VirtualService, ArgoCD Application) can be added in a follow-up if needed.

The role still honours the "strict allowlist of *.get / *.list only — no mutations and no data-plane reads" discipline stated in the existing code comments.

Stacking

This PR is stacked on top of fix/gcp-custom-role-project-scope because the custom_role_permissions_common local that this PR extends is introduced by that fix. Once that lands, retarget the base branch to main and rebase.

Test plan

  • terraform validate passes for gcp-integration-setup/terraform
  • terraform plan in examples/single-project shows only the additive permissions as a diff against fix/gcp-custom-role-project-scope
  • terraform plan in examples/organization shows the same additive permissions (these new perms are valid at both project and org custom-role scope)
  • Spot-check: a gcloud iam roles describe of the rendered custom role lists the new permissions and does not list container.secrets.* or artifactregistry.repositories.downloadArtifacts

🤖 Generated with Claude Code

Extends the read-only custom role with two capabilities:

1. Artifact Registry image metadata
   - artifactregistry.dockerimages.{get,list}
   - artifactregistry.tags.{get,list}
   - artifactregistry.versions.{get,list}
   Resolves image digests, tag history, and version metadata so deployed
   images can be correlated back to their source repository. Layer bytes
   (artifactregistry.repositories.downloadArtifacts) are intentionally
   not included.

2. GKE workload read via the control-plane proxy
   - Workloads: deployments, statefulSets, daemonSets, jobs, cronJobs, pods
   - Networking: services, ingresses, networkPolicies
   - RBAC: serviceAccounts, roles, roleBindings, clusterRoles,
     clusterRoleBindings
   - Config: configMaps, namespaces, nodes
   All get/list only. ConfigMap values are read; Kubernetes Secret values
   (container.secrets.*) are intentionally not requested. PersistentVolume
   data, runtime events, custom resource definitions, and write/data-plane
   verbs are excluded.

docs/permissions.md is updated to justify each new permission and call out
the explicit exclusions for security review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vik-nullify vik-nullify added minor Minor version updates (features) type:feature [MINOR] Backwards-compatible feature labels May 11, 2026
@vik-nullify vik-nullify marked this pull request as ready for review May 11, 2026 11:53
@vik-nullify vik-nullify merged commit a9b6936 into fix/gcp-custom-role-project-scope May 11, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Minor version updates (features) type:feature [MINOR] Backwards-compatible feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants