You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2026/08/17 23:55:24 UTC
[PR] fix(controller): make reserved instance labels unforgeable on pods [superset-kubernetes-operator]
villebro opened a new pull request, #278:
URL: https://github.com/apache/superset-kubernetes-operator/pull/278
## Summary
The operator relies on `superset.apache.org/*` pod labels for isolation and lifecycle-task tracking (`superset.apache.org/parent` drives the per-instance NetworkPolicy ingress selector; `superset.apache.org/instance` tracks task pods). Two paths let a user holding only `supersets` write forge these labels and interfere across instances. This closes both and documents the guarantee.
## Details
**Task-pod health check trusted a spoofable label.** `taskPodStartupError` attributed pod state to a lifecycle task purely by `superset.apache.org/instance`, which is forced only on task-Job pods (it is not in `podOperatorLabels`). A wedged pod planted by another CR via `podTemplate.labels` could inject its attacker-chosen kubelet message into the victim CR's task status, `LifecycleComplete` condition, and Warning Events. Pod state is now attributed only when the pod is controller-owned by that task's Job (`metav1.IsControlledBy`) — an ownerReference a pod author cannot forge.
**Reserved labels were forgeable on pods.** `MergePodTemplate` now strips user-supplied `superset.apache.org/*`-prefixed labels before folding in the operator labels, so a component `podTemplate` cannot smuggle discovery/isolation labels onto its pods. The maintenance-page path builds its pod spec outside the resolver, so it did not benefit — it now forces `podOperatorLabels` (including `superset.apache.org/parent`) and strips reserved user labels via the shared `resolution.ForceOperatorPodLabels` helper. Without this, a maintenance `podTemplate` could carry a forged `parent` label and land inside another instance's per-instance NetworkPolicy ingress isolation.
Documents in `docs/reference/security.md` that reserved `superset.apache.org/*` pod labels are unforgeable, so instance ingress isolation holds against CR authors, not only against compromised workload pods. Also drops the now-dead `taskName` parameter of `handleStuckTaskPod`.
Adds regression tests for the foreign-pod ownerReference filter, reserved-label stripping in `MergePodTemplate`, and the maintenance-path label forcing.
## Testing
- `go build ./...`, `gofmt`, `golangci-lint run` clean
- `go test ./internal/controller/... ./internal/resolution/...` passes, including the new tests
---
Found via a Claude security scan. Part of a series of security follow-ups; opened as a draft.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(controller): make reserved instance labels unforgeable on pods [superset-kubernetes-operator]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro merged PR #278:
URL: https://github.com/apache/superset-kubernetes-operator/pull/278
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(controller): make reserved instance labels unforgeable on pods [superset-kubernetes-operator]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #278:
URL: https://github.com/apache/superset-kubernetes-operator/pull/278#issuecomment-5321673831
## [Codecov](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/278?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `84.61538%` with `4 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 89.91%. Comparing base ([`41c95d7`](https://app.codecov.io/gh/apache/superset-kubernetes-operator/commit/41c95d76da37110f6d4fa786e1ad1836ac4d0188?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`731310c`](https://app.codecov.io/gh/apache/superset-kubernetes-operator/commit/731310c27c3655c349588f67c5dccd27399c1794?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/278?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [internal/controller/lifecycle\_job.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/278?src=pr&el=tree&filepath=internal%2Fcontroller%2Flifecycle_job.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvY29udHJvbGxlci9saWZlY3ljbGVfam9iLmdv) | 71.42% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/278?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [internal/resolution/merge.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/278?src=pr&el=tree&filepath=internal%2Fresolution%2Fmerge.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvcmVzb2x1dGlvbi9tZXJnZS5nbw==) | 84.61% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/278?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/278?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org