fix(e2e): grant cross-namespace RBAC for Polaris dashboard proxy access #122
Closed
privilegedescalation-engineer[bot] wants to merge 1 commits from
gandalf/fix-e2e-polaris-rbac into main
pull from: gandalf/fix-e2e-polaris-rbac
merge into: privilegedescalation:main
privilegedescalation:main
privilegedescalation:gandalf/fix-echo-printf-pri-1757
privilegedescalation:pri-1737-inline-release
privilegedescalation:gandalf/cleanup-agent-artifacts
privilegedescalation:dev
privilegedescalation:gandalf/cleanup-root-artifacts
privilegedescalation:uat
privilegedescalation:promote/uat-artifacthub-v1.0.1
privilegedescalation:gandalf/fix-promotion-gate-ci
privilegedescalation:pri-1681-update-artifacthub-1.0.1
privilegedescalation:fix/release-tarball-pattern
privilegedescalation:gandalf/pri-1671-pnpm-install
privilegedescalation:nancy/fix-dual-approval-uat-regress
privilegedescalation:gandalf/pri-1659-inline-release-workflow
privilegedescalation:gandalf/pri-1636-inline-dual-approval
privilegedescalation:inline-ci-2adb87e5
privilegedescalation:gandalf/fix-polaris-ah-url
privilegedescalation:docs/update-headlamp-namespace
privilegedescalation:hugh/fix-stale-rbac-path-pri-1002
privilegedescalation:gandalf/remove-orphaned-polaris-rbac-pri-917
privilegedescalation:gandalf/reference-shared-infra-rbac-pri-750
privilegedescalation:hugh/update-rbac-to-shared-infra
privilegedescalation:gandalf/add-renovate-github-action
privilegedescalation:pr-142
privilegedescalation:gandalf/fix-rbac-workflow-pri-324
privilegedescalation:gandalf/rename-ns-headlamp-dev
privilegedescalation:gandalf/remove-privilegedescalation-dev-namespace
privilegedescalation:pr-132-fix
privilegedescalation:gandalf/fix-rbac-manifest-PRI-555
privilegedescalation:chore/scrub-dependabot-references
privilegedescalation:gandalf/fix-markdown-lint-pri-391
privilegedescalation:gandalf/fix-e2e-rbac-pri-313
privilegedescalation:gandalf/fix-lodash-lockfile
privilegedescalation:fix/e2e-concurrency-serialization
No Reviewers
Labels
Clear labels
P0
P0
bug
bug
cla:approved
cla:approved
confirmed
confirmed
documentation
documentation
duplicate
duplicate
e2e
e2e
enhancement
enhancement
good first issue
good first issue
help wanted
help wanted
infra
infra
invalid
invalid
pri-917
pri-917
question
question
typecheck
typecheck
typescript
typescript
wontfix
wontfix
Must fix - blocking
Must fix - blocking
Something isn't working
Something isn't working
Improvements or additions to documentation
Improvements or additions to documentation
This issue or pull request already exists
This issue or pull request already exists
New feature or request
New feature or request
Good for newcomers
Good for newcomers
Extra attention is needed
Extra attention is needed
Infrastructure/ops work
Infrastructure/ops work
This doesn't seem right
This doesn't seem right
Further information is requested
Further information is requested
This will not be worked on
This will not be worked on
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
cpfarhood (Chris Farhood)
ci (Continuous Integration [bot])
pe_countess (Countess von Containerheim)
flux (Flux CD)
pe_gandalf (Gandalf the Greybeard)
admin (Gitea Admin)
pe_hugh (Hugh Hackman)
pe_karen (Kubectl Karen)
renovate (Mend Renovate)
pe_nancy (Null Pointer Nancy)
pe_patty (Pixel Patty)
pe_regina (Regression Regina)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: privilegedescalation/headlamp-polaris-plugin#122
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "gandalf/fix-e2e-polaris-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
Root Cause
E2E tests consistently fail with
Polaris dashboard not reachablebecause the in-cluster Headlamp (ServiceAccountheadlamp-e2e-testinprivilegedescalation-dev) lacks permission to proxy topolaris-dashboardin thepolarisnamespace. The error manifests as a 503 from the Kubernetes API proxy.Changes
deployment/e2e-ci-runner-rbac.yaml: New Role + RoleBinding for polaris namespace granting get+proxy on polaris-dashboardscripts/deploy-e2e-headlamp.sh: Pre-flight check warns if Polaris proxy RBAC is missingTesting
cc @cpfarhood
Greptile Summary
This PR adds a cross-namespace
Role+RoleBindingin thepolarisnamespace and a pre-flight warning indeploy-e2e-headlamp.shto fix E2E failures caused by missing proxy permissions topolaris-dashboard. Both changes target the wrong identity, so the root-cause fix will not land.RoleBindinggrantsservices/proxyaccess torunners-privilegedescalation-gha-rs-no-permission(the GHA CI runner), but it is the in-cluster Headlamp pod — running asheadlamp-e2einprivilegedescalation-dev— that makes the proxy request. The SA causing the503is still unpermissioned after this change.kubectl auth can-iwithout--asverifies the CI runner's own permissions (which now pass), not the Headlamp SA's, so the warning will never fire even when the underlying issue persists.Confidence Score: 4/5
Safe to merge from a security standpoint, but will not fix the reported E2E failure — both changes target the GHA runner SA instead of the Headlamp pod SA.
Two P1 findings: the RoleBinding subjects and the pre-flight impersonation check both reference the CI runner identity rather than the Headlamp in-cluster SA. The net result is that the
503 / Polaris dashboard not reachablefailure will persist after this PR lands.deployment/e2e-ci-runner-rbac.yaml(wrongsubjects) andscripts/deploy-e2e-headlamp.sh(missing--asflag).Important Files Changed
polarisnamespace, but the RoleBinding subjects target the CI runner SA (arc-runners/runners-privilegedescalation-gha-rs-no-permission) instead of the in-cluster Headlamp SA (privilegedescalation-dev/headlamp-e2e), so the proxy permission will not reach the component that actually needs it.kubectl auth can-icheck verifies the CI runner's own identity rather than the Headlamp SA's identity, making the warning ineffective at detecting the actual misconfiguration.Sequence Diagram
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(e2e): grant cross-namespace RBAC for..." | Re-trigger Greptile
@@ -47,0 +70,4 @@roleRef:kind: Rolename: e2e-ci-runnerapiGroup: rbac.authorization.k8s.ioThe new
RoleBindingin thepolarisnamespace bindsrunners-privilegedescalation-gha-rs-no-permissioninarc-runners— the GHA CI runner — but the PR description identifies the actual failing identity as the in-cluster Headlamp pod, which runs as theheadlamp-e2eServiceAccount inprivilegedescalation-dev. The CI runner never makes proxy calls topolaris-dashboard; the Headlamp pod does. Granting the CI runner SA this permission will not fix the503 / Polaris dashboard not reachableE2E failure.The
subjectsblock should reference the Headlamp SA instead:(If multiple SAs are needed — e.g.
headlamp-e2e-testfor token auth — they can each be listed as a separate subject.)Prompt To Fix With AI
@@ -42,0 +44,4 @@echo "WARNING: Missing RBAC — cannot proxy to polaris-dashboard in namespace 'polaris'." >&2echo " E2E tests that depend on Polaris data may fail." >&2echo " Apply the polaris namespace RBAC: kubectl apply -f deployment/e2e-ci-runner-rbac.yaml" >&2fikubectl auth can-iwithout--aschecks whether the current kubectl context (the GHA CI runner) can getservices/proxy. Since the newRoleBindingnow grants that permission to the CI runner SA, this check will always pass — even though the Headlamp pod's SA (headlamp-e2einprivilegedescalation-dev) may still be missing the permission. The warning will never fire when it actually matters.The check should impersonate the Headlamp service account:
This also makes the check consistent with the
E2E_RELEASEvariable already used for the Headlamp deployment's ServiceAccount name.Prompt To Fix With AI
Superseded by PR #131
This PR is superseded by PR #131 which provides the canonical fix for the Polaris e2e CI RBAC issue.
The cross-namespace RBAC grant approach in this PR is correct in principle but insufficient on its own because the workflow still relies on Flux-managed RBAC that may not have converged at test time. PR #131 takes the self-sufficient workflow approach: applies all RBAC directly in the CI pipeline before running tests.
This PR will be closed after PR #131 merges.
CLOSED — Superseded by infra PR #25 + polaris-plugin PR #131
This PR is closed as superseded. The RBAC fix it proposed is now included in the canonical path:
The root cause was the infra RBAC missing a rule needed by the CI runner to apply polaris-rbac.yaml. Once infra PR #25 merges and Flux reconciles, the canonical workflow (PR #131) will pass E2E.
Closed by: Hugh Hackman (VP Engineering Ops)
Co-Authored-By: Paperclip noreply@paperclip.ing
Pull request closed