Add a dedicated node pool for credentialed Prow jobs - #89
Conversation
The periodic e2e jobs which carry Venafi credentials currently share nodes with presubmit jobs, which run unreviewed PR code in privileged (dind) pods. A container escape from a presubmit would let the attacker read the credentials of any co-scheduled pod via the node's kubelet credentials. Give jobs with credentials their own tainted node pool so they never share a node with a presubmit. Kubernetes' own Prow build cluster uses the same mechanism; permalinks are in the clusters.tf comment. A follow-up in cert-manager/testing will add the matching nodeSelector and toleration to the Venafi periodics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Richard Wall <richard@the-moon.net>
Give the credentialed pool its own node service account so the trust boundary also exists at the GCP IAM layer: a container escape from a presubmit can read the worker pool's node SA token from the metadata server, so any IAM later granted for credentialed jobs must not be attached to that SA. Grant the new SA the same logging/monitoring roles. Collapse the two node pools into a single for_each resource so node hardening settings cannot drift between the pools; a moved block keeps the worker pool's existing state address. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Richard Wall <richard@the-moon.net>
|
I ran Summary: 2 to add, 1 to change, 0 to destroy. All changes are confined to the tofu plan output |
|
Applied. Post-apply checks:
Verification commands and outputNo other projects ( |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: inteon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Any periodic carrying a credential preset now gets a nodeSelector and toleration for the dedicated=credentialed-jobs node pool, injected in Periodics — the single point through which every generated periodic passes — so no generator can accidentally schedule a credentialed job onto the shared worker pool, where presubmits run unreviewed PR code in privileged (dind) pods and can poison the node-local hostPath build caches. The pool itself is added by cert-manager/infrastructure#89. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Richard Wall <richard@the-moon.net>
The periodic e2e jobs which carry Venafi credentials currently share nodes with presubmit jobs, which run unreviewed PR code in privileged (dind) pods. A container escape from a presubmit would let the attacker read the secrets of any co-scheduled pod via the node's kubelet credentials, and the shared node-local hostPath build caches give a presubmit a second path into a co-scheduled periodic. This PR gives jobs with credentials their own node pool in the untrusted cluster, tainted and labelled
dedicated=credentialed-jobs, so they never share a node — or its caches — with a presubmit.The pool nodes also get their own service account (
k8s-node-credentialed) rather than reusing the worker pool'sk8s-node, so the trust boundary exists at the GCP IAM layer too: a container escape onto a worker-pool node can read the node SA token from the VM metadata server, so any IAM later granted for credentialed jobs must not be attached to that shared SA. Both pools are generated from a singlefor_eachresource so node hardening settings cannot drift between them; amovedblock keeps the worker pool's existing state address.Kubernetes' own Prow build cluster uses the same mechanism — dedicated tainted node pools which jobs opt into with a toleration:
Kubernetes draws its credential trust boundary at the cluster level (prow-build vs prow-build-trusted), which cert-manager already mirrors with the prow-trusted cluster; this pool adds node-level separation for the credentialed periodics that remain in the untrusted cluster.
Verified with
tofu validateandtofu fmt -check -recursive(both clean); I have not runtofu planagainst the real state. Note for whoever applies this:max_count = 2raises the untrusted project's ceiling by up to 32 e2-highcpu-16 vCPUs / 300GB pd-ssd — check regional quota headroom at the first plan/apply, since a quota failure on scale-from-zero would only surface when a credentialed job first needs a node.Companion PR: cert-manager/testing#1228 makes prowgen inject the matching
nodeSelectorand toleration for any periodic carrying a credential preset, at the same choke point that already strips credential presets from presubmits — so nothing relies on hand-editing individual jobs. That PR is held until this one is merged and applied.with claude fable-5