Files
ea56ebe648 fix(agent): restrict clientCertificateRefs to same-namespace secrets (#826)
AgentEndpoint.spec.clientCertificateRefs used K8sObjectRefOptionalNamespace,
which allowed callers to specify an arbitrary namespace. The controller honored
this field and read the referenced Secret from whatever namespace was given,
using the operator's service account — which holds a ClusterRole with
secrets:[get,list,watch] cluster-wide in the default install.

This was a confused deputy vulnerability: any user who could create or update
an AgentEndpoint could direct the operator to read secrets from namespaces they
themselves cannot access.

Fix by changing clientCertificateRefs to K8sObjectRef (name-only). The
controller now unconditionally reads certificate secrets from the AgentEndpoint's
own namespace. The namespace field is also removed from the CRD schema so
Kubernetes prunes it at admission time if supplied.

Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 17:53:36 +00:00
..