Skip to content

Six flux-system controllers fail C-0013 on a missing runAsGroup, blocking the C-0013 narrowing #3223

Description

@devantler

🤖 Generated by the Agentic Engineer

Evidence

Measured in prod 2026-08-18 on the pre-exception scan surface
(workloadconfigurationscans, whose appliedIgnoreRules is null throughout, so the results are
what a scan sees before any ClusterSecurityException is applied).

All six Flux controllers in flux-system fail C-0013 (non-root containers) on a single missing
field:

Workload C-0013 C-0016 C-0055 Missing field
flux-operator failed passed passed securityContext.runAsGroup
helm-controller failed passed passed securityContext.runAsGroup
kustomize-controller failed passed passed securityContext.runAsGroup
notification-controller failed passed passed securityContext.runAsGroup
source-controller failed passed passed securityContext.runAsGroup
tofu-controller failed passed passed securityContext.runAsGroup

Kubescape's own suggested fix value is 1000. Each workload already sets runAsNonRoot, which is
why a runAsNonRoot-only check reads these as compliant — C-0013 also requires runAsGroup.

Why it matters now

flux-system is the only namespace excluded from the add-security-context mutation that is
both scanned in-cluster and not covered by another exception. That makes these six the entire
blocker to narrowing C-0013 in pod-security-mutations: narrowing it today would surface six
real findings with no fix behind them, which lowers the compliance score to absorb a gap instead of
closing it (#2824's third acceptance criterion says the floor is re-baselined upward).

C-0016 and C-0055 have no such gap and are narrowed already.

Expected behaviour

The six controllers set runAsGroup in their own spec, C-0013 passes for them genuinely, and
C-0013 then moves from pod-security-mutations-unscoped.yaml into the namespace-scoped
pod-security-mutations.yaml alongside C-0016 and C-0055.

Note on the mechanism

These are Flux components delivered by flux-operator/HelmRelease, so the field cannot be hand-set
on the Deployment — it needs a Flux postRenderers kustomize patch. There are existing precedents
for that pattern in this tree.

Acceptance criteria

  • All six flux-system controllers set securityContext.runAsGroup in their stored spec.
  • C-0013 reads passed for all six on the pre-exception scan surface.
  • C-0013 is moved into the namespace-scoped pod-security-mutations.yaml.
  • The compliance floor is re-baselined upward, never lowered.

Part of #2824

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    📥 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions