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
feat(k8s): an admission policy pins the Jobs the roadmap Service may create #2696
The Role roadmap-service-jobs lets the Service create Jobs in namespace devops (#2667). Kubernetes cannot limit create to a name, so the Role can create any Job that Pod Security restricted admits. Such a Job can use any image, any ServiceAccount of the namespace, envFrom of Secret devops-cli, and any volume that restricted admits. The Service pod already holds Secret devops-cli, so the Role gives it no new secret today. That holds only while namespace devops holds only Secret devops-cli. If a second Secret is added there, a compromise of the Service reaches it through a Job.
Proposed Solution & Architectural Design
Add a ValidatingAdmissionPolicy (Kubernetes 1.30 and later, built in, no extra component) with a binding for namespace devops, applied to CREATE of jobs by the user system:serviceaccount:devops:roadmap-service. A CEL expression requires that the Job:
has exactly one container, with the image ghcr.io/dan-petty/devops-cli/runner (by prefix and digest or tag as the CronJob has it);
has serviceAccountName: devops-cli;
has envFrom equal to Secret devops-cli only;
uses only the volumes that the CronJob devops-cli-runner template names (tmp, home, config);
sets automountServiceAccountToken: false.
A test renders the policy and checks it against the CronJob template, so that a change to the template that the policy refuses fails in CI.
Target Subsystem
k8s/devops/ (a new admissionpolicy.yaml and its binding), k8s/README.md, tests/test_k8s_runner.py.
Existing Tool Considered
ValidatingAdmissionPolicy (built in). Kyverno and OPA Gatekeeper cover the same need but add a component to the cluster, so they are not chosen.
Activity
dan-petty commentedon Oct 29, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The change adds an admission policy to limit the blast radius of a compromised Service account.It mitigates a future risk that appears only if a second Secret is added to the namespace.It prevents a compromised Service from reaching new Secrets via an arbitrary Job, but no active exploit exists.It needs a CEL expression, a binding, and a CI test that renders the policy against the CronJob template.Both concern the Job the Service creates in namespace devops, but #2667 defines the Job while the candidate constrains what Jobs the Service may create.feat(roadmap): run the implement job as a cluster Job (#2698)
chore(main): release 0.22.0 (#2751)