Skip to content

feat(helm): bind the credential provider's Secret reader only in the namespaces you list - #131

Open
QuentinBisson wants to merge 1 commit into
kagent-dev:mainfrom
QuentinBisson:chart-credential-provider-rbac-namespaces
Open

QuentinBisson wants to merge 1 commit into
kagent-dev:mainfrom
QuentinBisson:chart-credential-provider-rbac-namespaces

Conversation

@QuentinBisson

Copy link
Copy Markdown

The Kubernetes Secrets credential provider's reader is bound with a ClusterRoleBinding, so it can read every Secret in the cluster. On a cluster where other workloads keep Secrets the provider must not read, there is no way to narrow that without patching the chart.

credentialProvider.rbac.namespaces binds the same ClusterRole by RoleBinding in each listed namespace instead. Empty (the default) keeps today's ClusterRoleBinding, so existing installs render the same objects. The ClusterRole is always rendered, so namespaces created later can bind it themselves. The provider reads one Secret per request in the namespace the ate-secret:// URI names (cmd/credential-provider/kubernetes-secrets/kubeprovider.go:152) and answers a 403 with PermissionDenied (:160-162), so no code change is needed. The key and its semantics follow kagent's chart (rbac.namespaces).

AI use: AI-assisted, including the commit message and this description. I reviewed the change, the tests and the text, and ran helm unittest charts/substrate.

  • Tests pass
  • Docs updated

The k8s-credential-provider-secret-reader ClusterRole is bound with a
ClusterRoleBinding, so the provider can read every Secret in the
cluster.

credentialProvider.rbac.namespaces binds the ClusterRole by RoleBinding
in each listed namespace instead. Empty, the default, keeps the
ClusterRoleBinding. The ClusterRole is always rendered so other
namespaces can bind it.

Signed-off-by: QuentinBisson <quentin@giantswarm.io>
@QuentinBisson
QuentinBisson force-pushed the chart-credential-provider-rbac-namespaces branch from 4b91239 to bc17755 Compare November 9, 2026 11:25
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