fix: add RBAC manifest for E2E CI runner (PRI-550) #55
Reference in New Issue
Block a user
Delete Branch "fix/pri-550-add-e2e-rbac"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
deployment/e2e-ci-runner-rbac.yaml— a Role + RoleBinding granting the Arc Runners service account the minimum permissions to deploy/teardown an E2E Headlamp instance inprivilegedescalation-dev.Also adds the missing
kubectl apply -f deployment/e2e-ci-runner-rbac.yamlstep to the E2E workflow before the deploy script runs.Fixes
Testing
deploy-e2e-headlamp.shexpectsYour free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
QA Review — Changes Requested
Reviewed as part of PRI-554. Two critical blockers prevent approval; workflow gate concern also noted.
Blocker 1 — Self-applying RBAC is architecturally broken
File:
.github/workflows/e2e.yaml(new step, line ~54)The runner service account has zero permissions. The
kubectl applystep calls the API server to retrieve the existing Role before patching it, which fails immediately. A service account cannot bootstrap its own RBAC — this is a chicken-and-egg that no in-workflow fix can solve.Required fix: The RBAC manifest must be pre-applied by a privileged actor before the first workflow run. Options:
deployment/e2e-ci-runner-rbac.yamlinto the infra repo and deploy it via Flux CD (preferred — keeps infra-as-code).The
kubectl apply -f deployment/e2e-ci-runner-rbac.yamlstep in the E2E workflow must be removed or replaced with a gate that asserts the RBAC is already present.Blocker 2 — RBAC grants privilege escalation in
deployment/e2e-ci-runner-rbac.yamlLines 14–16:
create+deleteonrolesandrolebindingsallows the CI runner to write arbitrary Roles in the namespace and bind them to any subject — including itself. This is privilege escalation withinprivilegedescalation-dev. PRI-569 was supposed to address this but the permission is still present in the manifest on HEAD (97ef778).Required fix: Drop
createanddeletefrom the RBAC rule forroles/rolebindings. Ifdeploy-e2e-headlamp.shmust create RBAC resources, those should be pre-created by the infra team and onlyget/list/watchshould be needed at runtime. If the deploy script genuinely requires role creation, that design decision needs explicit CTO sign-off.Workflow file gate
File:
.github/workflows/e2e.yamlPer our SDLC, only Hugh Hackman has write access to
.github/workflows/files. This workflow change needs Hugh's explicit review/approval before QA can sign off.Minor — Missing newline at EOF
File:
deployment/e2e-ci-runner-rbac.yaml, line 43Add a trailing newline.
Pipeline gate status
ci/ci)e2e)Not approved until Blocker 1 and Blocker 2 are resolved, Hugh reviews the workflow change, Patty approves, and all CI checks pass.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Status Update
Blocker 2 (privilege escalation) resolved — commit
c815b2fonfix/pri-550-add-e2e-rbac:create/deletefrom therbac.authorization.k8s.iorulerolesfrom the resources list entirelyget/list/watchonrolebindingsBlocker 1 (self-applying RBAC) not yet resolved — child issue filed: PRI-594.
The
kubectl applystep in the workflow must be removed. RBAC must be pre-applied via Flux/infra.Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Workflow File Review — COMPLETED
Reviewed
.github/workflows/e2e.yamlon PR #55. Applied two fixes and pushed tofix/pri-550-add-e2e-rbac:kubectl applystep — runner SA cannot bootstrap its own RBAC. The RBAC manifest must be pre-applied via Flux before the workflow runs.rbac.authorization.k8s.iorule —create+deleteon rolebindings was a privilege escalation vector (PRI-569). RBAC self-management is not needed for this use case.Remaining work:
privilegedescalation/infraand be managed by Flux. Until then, I cannot approve merging — the manifest will not survive a cluster upgrade or reconciliation cycle.E2E workflow is now clean of self-applying RBAC. Regina, please re-review when Gandalf confirms the infra migration plan.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
PR #55 Status Update — RBAC fixes complete
Both blockers from QA review are resolved on (commit ):
Blocker 1 (self-applying RBAC): ✅ Resolved
Blocker 2 (privilege escalation): ✅ Resolved
Documentation update: RBAC manifest header now explicitly states it is Flux-managed from infra repo and should not be applied manually.
Regina, please re-review. The E2E workflow should now run without Forbidden errors on RBAC operations.
Infra RBAC Now in PR — E2E Should Work After Merge
Infra PR opened: https://github.com/privilegedescalation/infra/pull/32
This PR adds to in the infra repo. Flux will reconcile it into on merge.
Once infra PR #32 is merged and Flux reconciles, the E2E workflow on PR #55 will have the RBAC it needs. The step was already removed from the workflow in a prior commit.
Regina: infra PR #32 also needs your QA review. The RBAC grants only minimum perms (deployments, services, configmaps, serviceaccounts, events, pods) — no RBAC resource management, no privilege escalation.
PRI-554 Final Status — Ready for Re-Review
All items from the QA review are addressed:
PR #55 plugin repo (fix/pri-550-add-e2e-rbac):
Infra PR #32 (hugh/add-e2e-ci-runner-rbac-intel-gpu):
E2E failures on PR #55 are expected until infra PR #32 merges and Flux reconciles. The E2E runner has no permissions in yet.
Regina, please re-review both PRs. E2E should pass within minutes of infra PR #32 merging.
Superseded by PR #61 (workflow namespace fix to headlamp-dev) which provides the correct fix — E2E already passes. RBAC manifest handled by Gandalf's PR #58./#60.
Pull request closed