You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Management-cluster profile: Substrate and the install hooks read Secrets only where granted #1269
The Agent Platform's organizations run on Giant Swarm management clusters beside Cluster API, Flux and the workload clusters' credentials (epic giantswarm/giantswarm#38891). The plan's management-cluster profile names one blocker before any management-cluster rollout: Substrate's controller and its Kubernetes credential provider hold get on every Secret in the cluster, which includes every workload cluster's admin kubeconfig, while each reads only a few.
What to build
Substrate's controller reads one Secret in its own namespace: a namespaced Role on that Secret replaces its ClusterRole. The ClusterRole comes from a kubebuilder marker in Substrate, so this is an upstream pull request first; until a re-pin carries it, the Giant Swarm fork narrows it, with a ledger row and a dated exit.
Substrate's credential provider reads credentials in the namespaces actors run in and checks the grant in its own process: its ClusterRole loses secrets; agent-platform-operator binds its role by RoleBinding in each organization namespace and the chart binds it in the platform namespace. An upstream issue asks Substrate for Secret access scoped by namespace; the fork narrows it until then.
The connectivity chart's install hooks' ClusterRole on Secrets is narrowed to the namespaces and resourceNames the hooks write.
The management cluster's audit policy records writes by the Agent Platform's components and by people in organization namespaces: an addition requested from the team that owns it, linked from this issue.
Acceptance criteria
Substrate's controller is refused a Secret other than its own; the credential provider is refused a Secret outside the organization namespaces and the platform namespace; both proven in agentlab's management-cluster profile tests.
The install hooks are refused a Secret they do not write.
The upstream pull request and issue are filed and linked; the fork carries a ledger row with the exit for each narrowing.
The audit policy request is filed and linked.
This lands before the first management-cluster migration.
gazelle is still on 4.174.3 / Substrate 1.17.5, where all three are allowed in every namespace through ClusterRoleBindings. It changes when 4.175.0 is released as stable.
Left:
4.175.0 stable on gazelle, then the same check there.
The agentlab management-cluster proof (ate-controller, both providers with one agent fetching its credential in an organization namespace, and the install hooks refused a Secret they do not write).
The audit policy request (not filed yet).
Other cluster-wide Secret readers, to be filed separately: the kagent controller, the agentgateway controller, mcp-kubernetes (clusterWideSecrets).
Acceptance proof in agentlab: agent-platform 4.175.0-rc.20 (Substrate 1.18.0, Google access-token plugin 0.3.0), agentPlatformOrganizations.enabled, agentlab built from giantswarm/agentlab#1153. AgentPlatformOrganizations default (agents-default-5s7rp) and acme (agents-acme-dpzn5) Ready, plus a dummy org-acme/acme-kubeconfig Secret.
The operator bound both providers' readers in each organization namespace as soon as the organization was created:
agents-acme-dpzn5/k8s-credential-provider-secret-reader -> ClusterRole/k8s-credential-provider-secret-reader
agents-acme-dpzn5/google-access-token-credential-provider-secret-reader -> ClusterRole/google-access-token-credential-provider-secret-reader
kagent/...-secret-reader (both, from the chart)
ate-system/ate-controller -> Role/ate-controller (secrets: get,list,watch on egress-mitm-ca-pool only)
No ClusterRoleBinding gives any of them Secrets.
Real reads, as each ServiceAccount (kubectl create token <sa>, then kubectl --token with a kubeconfig that carries no client certificate; auth whoami returns system:serviceaccount:ate-system:<sa>):
k8s-credential-provider get secret org-acme/acme-kubeconfig -> Forbidden
k8s-credential-provider get secret kagent/kagent-anthropic -> secret/kagent-anthropic
k8s-credential-provider get secret agents-default-5s7rp/tenant-credential-anthropic -> secret/tenant-credential-anthropic
google-access-token-credential-provider get secret org-acme/acme-kubeconfig -> Forbidden
google-access-token-credential-provider get secret kagent/kagent-anthropic -> secret/kagent-anthropic
google-access-token-credential-provider get secret agents-default-5s7rp/tenant-credential-anthropic -> secret/tenant-credential-anthropic
ate-controller get secret org-acme/acme-kubeconfig -> Forbidden
ate-controller get secret kagent/kagent-anthropic -> Forbidden
ate-controller get secret agents-default-5s7rp/tenant-credential-anthropic -> Forbidden
ate-controller get secret ate-system/egress-mitm-ca-pool -> secret/egress-mitm-ca-pool
all three list secrets -A -> Forbidden (cluster scope)
An agent in an organization namespace fetches its credential.agentlab organizations-test: alice (editor of organization agentlab-a) and bob (editor of agentlab-b) each create an agent in their own organization as themselves and run a turn; both answer. Each turn's credential is read from its own organization namespace, for that Session's actor:
alice@lab.local's turn answered: ready
bob@lab.local's turn answered: ready
22:00:20.187 agents-agentlab-a-vgfhb tenant-credential-anthropic actor agents-agentlab-a-vgfhb/session-01a1adba-246c-7c5f-97b7-b476444d3308
22:00:23.126 agents-agentlab-b-b7pjs tenant-credential-anthropic actor agents-agentlab-b-b7pjs/session-01a1adba-3031-7ca6-8e92-3b1d7f004494
alice's CreateSession and A2A message on bob's agent are refused (PermissionDenied), and no Session is created for them. With giantswarm/agentlab@8932826 (the credential-read check counts only reads logged after it starts), organizations-test passes its credential-read and cross-organization checks. It stops later at Slack S3, because the chart does not yet turn on agent-manager's organization tools; that is the agent-platform chart follow-up, not this issue.
Connectivity install hooks. Their RBAC exists only during a hook event, so I applied the RBAC objects from helm get hooks agent-platform-connectivity (rc.20, hook annotations removed), read as agent-platform/agent-platform-connectivity-hooks, then deleted them:
get secret org-acme/acme-kubeconfig -> Forbidden
get secret kagent/kagent-anthropic -> Forbidden
get secret agents-default-5s7rp/tenant-credential-anthropic -> Forbidden
get secret ate-system/egress-mitm-ca-pool -> secret/egress-mitm-ca-pool
get secret kagent/kagent-pg-app -> secret/kagent-pg-app
list secrets -A -> Forbidden (cluster scope)
Its only Secret rules are by name: podcertificate-controller-system (service-dns-ca-pool, pod-identity-ca-pool), ate-system (actor-id-*, egress-mitm-ca-pool, kagent-pg-substrate-app), kagent (kagent-pg-app, kagent-pg-kagent-v2-app, kagent-pg-substrate-app), plus create, which RBAC cannot scope by name.
Left: 4.175.0 stable on gazelle and the same check there; the audit policy request; the other cluster-wide Secret readers (kagent controller, agentgateway controller, mcp-kubernetes) as separate issues.
Audit policy. The management clusters' policy (giantswarm/cluster, helm/cluster/files/etc/kubernetes/policies/audit-policy.yaml) already records, for every user and namespace: writes to the core, rbac.authorization.k8s.io, apps and batch groups at RequestResponse (RoleBindings in organization namespaces with their body), Secrets at Metadata, and every other resource (Agents, HelmReleases, AgentPlatformOrganizations) at Metadata. Those logs ship to Loki, so no request to another team is needed.
The automated Secret-refusal checks for agentlab's management-cluster profile are in a follow-up agentlab pull request. organizations-test can only run them once the chart turns on agent-manager's organization tools, because its turns now start through agent-manager's start_session.
4. Audit policy. Closed in the comment above: the management clusters' policy in giantswarm/cluster already records the writes (RBAC with its body, Secrets and the platform's resources at Metadata), and the logs ship to Loki. No request to another team is needed.
5. This lands before the first management-cluster migration. graveler and gazelle both run it, and gazelle has no organization namespaces yet.
kubectl --context teleport.giantswarm.io-gazelle get clusterrolebindings -o wide
ate-system/ate-controller -> ClusterRole/ate-controller (no rule on secrets)
ate-system/k8s-credential-provider -> no ClusterRoleBinding
ate-system/google-access-token-credential-provider -> no ClusterRoleBinding
agent-platform/agent-platform-connectivity-hooks -> no ClusterRoleBinding (its RBAC exists only during a hook)
no group binding (system:serviceaccounts, system:authenticated) grants secrets
kubectl --context teleport.giantswarm.io-gazelle get rolebindings -A -o wide
ate-system/ate-controller -> Role/ate-controller: secrets get,list,watch, resourceNames [egress-mitm-ca-pool]
kagent/k8s-credential-provider-secret-reader -> ClusterRole/k8s-credential-provider-secret-reader (secrets get)
kagent/google-access-token-credential-provider-secret-reader -> ClusterRole/google-access-token-credential-provider-secret-reader (secrets get)
So on gazelle ate-controller can read only ate-system/egress-mitm-ca-pool, and both providers only Secrets in kagent.
The other identities that still read Secrets in every namespace (the kagent controller, the ChatGPT login refresher, the agentgateway controller, mcp-kubernetes) are #1391.
Activity
security(hooks): the connectivity hooks read only the Secrets they write
security(hooks): the connectivity hooks read only the Secrets they wr…
fix(substrate): the credential providers read Secrets only where an a…
QuentinBisson commentedon Nov 5, 2026
Progress on the Secret narrowing.
Merged:
egress-mitm-ca-poolinate-system(cherry-pick of atecontroller: Limit the Secrets read to the egress MITM CA pool agent-substrate/substrate#3036, merged upstream).rbac.namespaces), ClusterRoleBinding only when the list is empty. Upstream: feat(helm): bind the credential provider's Secret reader only in the namespaces you list kagent-dev/substrate#131 (open), ledger row in docs(fork): record kagent-dev/substrate#131 for the credential provider's Secret reader substrate#555.serviceAccountBindings) in every organization namespace.graveler (agent-platform 4.175.0-rc.20, Substrate 1.18.0, Google plugin 0.3.0), SubjectAccessReview for
get secrets:k8s-credential-provider-secret-reader/kagent)google-access-token-credential-provider-secret-reader/kagent)egress-mitm-ca-poolonly (Roleate-controller)gazelle is still on 4.174.3 / Substrate 1.17.5, where all three are allowed in every namespace through ClusterRoleBindings. It changes when 4.175.0 is released as stable.
Left:
clusterWideSecrets).QuentinBisson commentedon Nov 5, 2026
Acceptance proof in agentlab: agent-platform 4.175.0-rc.20 (Substrate 1.18.0, Google access-token plugin 0.3.0),
agentPlatformOrganizations.enabled, agentlab built from giantswarm/agentlab#1153. AgentPlatformOrganizationsdefault(agents-default-5s7rp) andacme(agents-acme-dpzn5) Ready, plus a dummyorg-acme/acme-kubeconfigSecret.The operator bound both providers' readers in each organization namespace as soon as the organization was created:
No ClusterRoleBinding gives any of them Secrets.
Real reads, as each ServiceAccount (
kubectl create token <sa>, thenkubectl --tokenwith a kubeconfig that carries no client certificate;auth whoamireturnssystem:serviceaccount:ate-system:<sa>):An agent in an organization namespace fetches its credential.
agentlab organizations-test: alice (editor of organizationagentlab-a) and bob (editor ofagentlab-b) each create an agent in their own organization as themselves and run a turn; both answer. Each turn's credential is read from its own organization namespace, for that Session's actor:alice's CreateSession and A2A message on bob's agent are refused (PermissionDenied), and no Session is created for them. With giantswarm/agentlab@8932826 (the credential-read check counts only reads logged after it starts),
organizations-testpasses its credential-read and cross-organization checks. It stops later at Slack S3, because the chart does not yet turn on agent-manager's organization tools; that is the agent-platform chart follow-up, not this issue.Connectivity install hooks. Their RBAC exists only during a hook event, so I applied the RBAC objects from
helm get hooks agent-platform-connectivity(rc.20, hook annotations removed), read asagent-platform/agent-platform-connectivity-hooks, then deleted them:Its only Secret rules are by name:
podcertificate-controller-system(service-dns-ca-pool,pod-identity-ca-pool),ate-system(actor-id-*,egress-mitm-ca-pool,kagent-pg-substrate-app),kagent(kagent-pg-app,kagent-pg-kagent-v2-app,kagent-pg-substrate-app), pluscreate, which RBAC cannot scope by name.Left: 4.175.0 stable on gazelle and the same check there; the audit policy request; the other cluster-wide Secret readers (kagent controller, agentgateway controller, mcp-kubernetes) as separate issues.
QuentinBisson commentedon Nov 5, 2026
Acceptance criteria 3 and 4:
giantswarm/cluster,helm/cluster/files/etc/kubernetes/policies/audit-policy.yaml) already records, for every user and namespace: writes to the core,rbac.authorization.k8s.io,appsandbatchgroups atRequestResponse(RoleBindings in organization namespaces with their body), Secrets atMetadata, and every other resource (Agents, HelmReleases, AgentPlatformOrganizations) atMetadata. Those logs ship to Loki, so no request to another team is needed.The automated Secret-refusal checks for agentlab's management-cluster profile are in a follow-up agentlab pull request.
organizations-testcan only run them once the chart turns on agent-manager's organization tools, because its turns now start through agent-manager'sstart_session.feat(organizations-test): each component's Secret reads in the manage…
feat(organizations-test): each component's Secret reads in the manage…
fiunchinho commentedon Nov 13, 2026
Closing: every acceptance criterion holds.
1. Substrate's controller and the credential providers are refused Secrets outside their grant, proven in agentlab's management-cluster profile.
egress-mitm-ca-poolinate-system.organizations-test, management-cluster profile); the chart targetverify-secret-readers(Makefile.custom.mk:4480,tests/verify-secret-readers.py).2. The install hooks are refused a Secret they do not write.
agent-platform-connectivity-hooksin agentlab (comment above), feat(organizations-test): each component's Secret reads in the management-cluster profile agentlab#1161, and the chart targetverify-hooks-secrets(Makefile.custom.mk:4473,tests/verify-hooks-secrets.py).3. Upstream pull request and issue filed and linked; a ledger row with the exit for each narrowing.
fork/k8s-credential-provider-reads-secrets-only-where-bound.mdin giantswarm/substrate (fix(model-serving): the classic vLLM runtime runs its container through the llm-d template's argument grammar #555), exit "feat(helm): bind the credential provider's Secret reader only in the namespaces you list kagent-dev/substrate#131 merged, then the next re-pin drops it".4. Audit policy. Closed in the comment above: the management clusters' policy in giantswarm/cluster already records the writes (RBAC with its body, Secrets and the platform's resources at
Metadata), and the logs ship to Loki. No request to another team is needed.5. This lands before the first management-cluster migration. graveler and gazelle both run it, and gazelle has no organization namespaces yet.
gazelle check (agent-platform 4.179.2, Substrate 1.18.0, Google access-token plugin 0.3.7; 2026-11-13; RBAC objects only):
So on gazelle ate-controller can read only
ate-system/egress-mitm-ca-pool, and both providers only Secrets inkagent.The other identities that still read Secrets in every namespace (the kagent controller, the ChatGPT login refresher, the agentgateway controller, mcp-kubernetes) are #1391.