fix(cilium): run the cilium-operator as non-root#2437
Merged
Conversation
The cilium-operator Deployment ran as root (the operator-generic image ships no USER) and failed Kubescape control C-0013 (non-root containers). It is a pure control-plane controller — it reads a read-only config-map and the read-only SPIRE agent socket, has no host filesystem access and binds only high ports — so it runs fine as non-root. Add operator.securityContext (runAsNonRoot + runAsUser/runAsGroup:1000, re-stating the chart-default drop-ALL capabilities and allowPrivilegeEscalation:false because the chart helper replaces the map wholesale rather than merging it) and operator.podSecurityContext (runAsNonRoot + RuntimeDefault seccomp). This touches ONLY the cilium-operator Deployment; the agent, envoy, hubble, clustermesh and spire securityContexts (privileged by design) are unchanged. readOnlyRootFilesystem is intentionally omitted (unverified for the distroless operator image). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis change adds security hardening configuration to the cilium-operator HelmRelease, introducing ChangesCilium Operator Security Hardening
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
|
🎉 This PR is included in version 1.97.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Why
The Kubescape dashboard flags the cilium-operator as running as root (control C-0013, non-root containers). It's a control-plane controller with no host access and no need for root — its image just ships no USER, so it defaults to root.
What
Runs the cilium-operator only as a non-root user via the chart's operator securityContext values, so it passes C-0013. The cilium agent, envoy, hubble, clustermesh and spire (privileged by design) are untouched.
Promote with care: this is on the pinned pre-release CNI chart (1.20.0-pre.3), and an operator crash-loop would degrade the CNI control plane and SPIRE mTLS resync.
readOnlyRootFilesystemwas intentionally left off (unverified for the distroless operator image). Worth a live check that the operator pods come up healthy after rollout.Part of #2435