Skip to content

security(longhorn): clear the pre-opt-in C-0211 residual in longhorn-system without detaching volumes unintentionallyΒ #3918

Description

@devantler

πŸ€– Generated by the Agentic Engineer

Evidence

longhorn-system is opted in to pod-security.devantler.tech/baseline-context, and the mutation
works β€” but 26 of its 41 pods still carry neither fsGroupChangePolicy nor seLinuxOptions.
Measured against live prod specs 2026-09-20, the split is temporal and completely clean:

  • every clean pod was created on or after 2026-09-06T20:46:02Z
  • every residual pod was created on or before 2026-08-26T13:14:47Z

#3636 landed the opt-in on 2026-09-06. The rule matches CREATE only, so this is the documented
behaviour working as designed: pods created after the opt-in carry both fields, and pods created
before it keep their original spec until something recreates them.

Nothing in longhorn-system is going to recreate them on its own:

12x DaemonSet/engine-image-ei-*        three engine versions, oldest pod 2026-06-16
 4x DaemonSet/longhorn-csi-plugin
 4x InstanceManager/instance-manager-*
 6x ReplicaSet/csi-{attacher,provisioner,resizer}

Longhorn keeps an engine-image DaemonSet per engine version for as long as any volume references
that version, and an InstanceManager per node for as long as volumes are attached there.

Audience and problem

This is the last chunk of the C-0211 residual in an already opted-in namespace, so it will not
close by itself and it is invisible in the rollout state β€” the namespace looks done.

It is deliberately not folded into #3239's per-namespace opt-in work, because the risk class is
different. Opting a namespace in is a posture change with no runtime effect on running pods. Clearing
this residual means recreating storage-plane pods, and recreating an InstanceManager requires
detaching the volumes it serves. That is a storage availability decision, and it should not ride
along inside a security sweep.

Expected behaviour

Every pod in longhorn-system carries both fields, reached by a sequenced roll that never detaches a
volume without intent.

Acceptance criteria

  • The three workload classes are sequenced by disruption, least first: the CSI sidecar
    ReplicaSets and longhorn-csi-plugin DaemonSet roll normally; the engine-image DaemonSets
    are checked for whether any volume still references each engine version before touching them;
    the InstanceManager pods are handled last and explicitly, against attachment state.
  • Any engine-image DaemonSet whose version no longer backs a volume is retired rather than
    rolled β€” that removes the pods instead of recreating them.
  • Re-measured afterwards from live pod specs: 0 of the namespace's pods missing either field.
  • No volume left detached or degraded, verified after the roll rather than assumed.

Not in scope

The kube-system opt-in (34 pods missing fsGroupChangePolicy, 26 missing seLinuxOptions, not yet
opted in) is the larger remaining population and belongs to #3239's ordinary per-namespace rollout.

The pod-versus-workload-spec distinction on #3522 is also separate and unaffected: clean pods do not
by themselves move the Kubescape C-0211 score, because Kubescape reads the stored workload spec.

Size

Small in diff, medium in care β€” the sequencing and the post-roll verification are the work.

Part of #3239

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions