Repository navigation
fix(security): supply the C-0211 baseline context to descheduler - #3733
Conversation
kube-system is excluded from the add-security-context mutation, so the descheduler's stored controller template — the surface Kubescape scores for C-0211 — carries neither fsGroupChangePolicy nor container seLinuxOptions. Supply both through the chart's own values, the source-owned route the baseline rollout doc names for Helm-templated workloads. Both fields are inert for this workload and neither relaxes the chart's hardening. The pod has no fsGroup and its only volume is a configMap, so the ownership policy governs nothing; the empty seLinuxOptions object satisfies the control while leaving SELinux type and MCS category selection to the runtime. Rendering the real pinned chart 0.36.0 shows the two additions as the entire delta: allowPrivilegeEscalation, the dropped ALL capabilities, privileged, readOnlyRootFilesystem, runAsNonRoot and runAsUser 1000 are all preserved verbatim, and the rendered resource inventory is identical. Part of #3239 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
| Overlay | Result |
|---|---|
providers/hetzner/apps |
byte-identical |
providers/hetzner/infrastructure |
byte-identical |
providers/hetzner/infrastructure/controllers |
+112 bytes |
clusters/prod/bootstrap |
byte-identical |
clusters/prod |
byte-identical |
Complete hunk list — one hunk, four added lines, inside the descheduler HelmRelease's values:
podSecurityContext.fsGroupChangePolicy, securityContext.seLinuxOptions. No other hunk anywhere.
Grant-bearing membership, both directions, by two independent extractions:
- structural selection of
ClusterRole/Role/ClusterRoleBinding/RoleBinding/
ServiceAccountidentities — 86 either side, identical; - digest over the
ClusterRole/Rolerule bodies —6a52babc727cc081…identical either side.
A first pass of the structural extraction returned 171 per side; 85 of those were document-separator
artifacts rather than identities. Both sides carried them symmetrically so the comparison held, but
the count was wrong, so the filtered form above is what is reported.
Negative control — injecting one synthetic ClusterRole into the green surface makes both
extractions report the difference, so "identical" here is a finding rather than a blind read.
Document census across the whole surface is unchanged: 560 documents over 63 kinds, identical.
A HelmRelease is a controller-RBAC emitter, so supplying the descheduler's baseline security context through the chart's values moves the aggregate rendered-authorization fingerprint even though nothing is granted. The conservation evidence is recorded beside the constant: all five authorization roots rendered from both trees under one renderer, 86 grant-bearing identities identical in both directions, identical ClusterRole and Role rule bodies, 560 documents over 63 kinds unchanged, and a complete hunk list of one hunk of four added lines inside the descheduler HelmRelease's values. A synthetic ClusterRole injected into the rendered surface makes both independent extractions report the difference, so that identity result is a finding rather than a blind read. The digest itself is taken from CI, because this host's renderer is not the approved one and the validator fails closed rather than producing a local value. The previous aggregate is preserved in the comment history. Part of #3239 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
All required checks are green at this head, including @coderabbitai review |
|
✅ Action performedReview finished.
|
|
Warning Review limit reachedNext included review available in 26 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🔇 Additional comments (2)
📝 WalkthroughWalkthroughThe descheduler HelmRelease now sets Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The security-context values and corresponding rendered-surface fingerprint update are ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…seline-context-3239 # Conflicts: # scripts/validate-eks-ci-role-policy/main.go
Merging main brought in the Kubescape 1.40.4 repair (#3731), which had already moved this aggregate to bc95f7ee. Stacking the descheduler values change on top moves it again, so the constant is re-read from CI's own failure on run 34698439645 under the approved SHA256-verified toolchain. Both predecessors stay recorded in the comment history above. The conservation evidence for the descheduler change is unchanged by the merge: it compares two trees under one renderer, so it does not depend on which aggregate precedes it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Head advanced to @coderabbitai review |
|
|
CodeRabbit was requested first at this head and refused: its reply ( All 26 checks are green at @codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Readiness at
|
Post-merge verification: C-0211 satisfied on the deployed deschedulerThis is the verification I committed to when this merged. Checked against the live cluster rather The fix is enacted. The descheduler's stored controller template now carries the field:
One thing worth recording, because it looks like a gap and is notThere is no The scanner itself is alive ( Carry-forward discharged; no follow-up needed. |
Motivation
Kubescape scores the C-0211 security-context controls against each workload's stored controller template.
kube-systemis excluded from the cluster-wide security-context mutation because the workloads there need elevated privileges — but two of the controls it suppresses, volume-ownership policy and the SELinux options object, are not privilege settings. The descheduler has been failing both for no reason anyone chose.Description
Supplies the two fields through the descheduler chart's own values, which is the source-owned route the baseline rollout doc names for Helm-templated workloads. Both are inert for this workload: it has no group-ownership setting and its only volume is a configuration map, so the ownership policy governs nothing, and the empty SELinux object satisfies the control while leaving the runtime's own label selection untouched.
Rendering the real pinned chart shows the two additions are the entire change — every existing hardening setting on the container is preserved and the rendered resource list is identical. Removing the two values restores the previous output exactly, so the rollback is a one-line revert.
This is one workload of the remaining population; the issue stays open for the rest.
Part of #3239
🤖 Generated with Claude Code