fix(ci): strip unused CI-runner privileges - #4063
Merged
Merged
Conversation
Remove cluster-runner's cluster-admin ClusterRoleBinding (no workflow invokes kubectl; ARC's containerMode:kubernetes pod/PVC perms come from its own auto-generated manager Role, unrelated to this SA). Drop the Talos ServiceAccount from os:admin to os:reader since its only use is talosctl image pull. Gate the image-pull job with the same fork same-repo check used by agent-pr-review and labeler, so fork PRs can't run modified steps on the self-hosted runner.
@@ spec.roles.0 @@
# talos.dev/v1alpha1/ServiceAccount/actions-runner-system/cluster-runner
! ± value change
- os:admin
+ os:reader
@@ (root level) @@
# rbac.authorization.k8s.io/v1/ClusterRoleBinding/cluster-runner
! - one document removed:
- apiVersion: rbac.authorization.k8s.io/v1
- kind: ClusterRoleBinding
- metadata:
- name: cluster-runner
- labels:
- kustomize.toolkit.fluxcd.io/name: actions-runner-controller-runners
- kustomize.toolkit.fluxcd.io/namespace: actions-runner-system
- roleRef:
- name: cluster-admin
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- subjects:
- - name: cluster-runner
- kind: ServiceAccount
- namespace: actions-runner-system
|
AI Automated ReviewAnalysis engine: qwen-3.6-fast@http://litellm.ai.svc.cluster.local/v1 (openai) Recommendation: Approve — this PR correctly reduces the CI runner's privileges and hardens the workflow against fork abuse. Change-by-change findings
Standards Compliance
Must-Check Items
Tool Harness FindingsNo tool harness output was provided in the corpus. Unknowns or Needs Verification
|
Tanguille
added a commit
that referenced
this pull request
Jul 20, 2026
os:reader (set in #4063) lacks the ImagePull API; /machine.MachineService/ImagePull requires os:admin or os:operator, so every image-pull run failed with PermissionDenied. os:operator is the minimal role that includes it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the cluster-runner ServiceAccount's cluster-admin ClusterRoleBinding — confirmed no workflow in .github/ invokes kubectl, and ARC's containerMode:kubernetes pod/PVC permissions come from its own auto-generated cluster-runner-gha-rs-manager Role, not this binding. Drops the Talos ServiceAccount from os:admin to os:reader, since its only current use is talosctl image pull in image-pull.yaml. Also adds the same-repo gate (already used by agent-pr-review.yaml and labeler.yaml) to the image-pull pull job so fork PRs can't run modified steps on the self-hosted cluster-runner.
Verification: kustomize build --enable-helm on the runners/cluster dir renders cleanly with the cluster-admin binding gone and os:reader in place; confirmed via kubectl that the pod/secret/serviceaccount/role/rolebinding perms for containerMode:kubernetes live on a separate ARC-managed Role/SA. Post-merge: if talosctl image pull starts failing with os:reader, bump to os:operator (talos-mcp already runs fine on os:reader, so os:reader is expected to be sufficient).