#13546·containerd

[SIG-Node]: KEP-6061 - OCI Artifact-Based Security Profile Distribution

Author: saschagrunertCreated Jun 8, 2026Updated Sep 24, 2026
Labelskind/featurearea/criarea/distributiontarget/kubernetes/v1.38

KEP/SIG-Node References

What is the SIG-Node problem you are trying to solve

Kubernetes needs native support for pulling security profiles from OCI-compatible registries. Today, profiles must be pre-installed on every node (Localhost type), creating operational burden. KEP-6061 adds an OCI profile type to SeccompProfile (AppArmor follows in beta) and a PullSecurityProfile RPC to the CRI ImageService. The runtime merges every pulled profile with its configured baseline (and an optional pod-spec base profile) via intersection at apply time, so an OCI profile can never be more permissive than the node baseline. References are digest-pinned; mutable tags are a non-goal.

Describe the solution you would like

containerd work for alpha (design details in the KEP PR):

  • ImageService.PullSecurityProfile: request mirrors PullImage (ImageSpec with runtime_handler, AuthConfig, PodSandboxConfig) plus profile_kind; response carries cached. Pull-if-not-present: no registry contact when the digest is already present. profile_kind must match the artifact's config media type (mismatch is SecurityProfileInvalid); SecurityProfileKindUnspecified and, until beta, AppArmor are rejected with InvalidArgument.
  • Artifact validation at pull time: config media type application/vnd.cncf.seccomp-profile.config.v1+json (or artifactType with the OCI 1.1 empty config), exactly one layer, raw JSON blob (not tar; do not require a specific layer media type), size limit (1 MiB default), and content validation: decode with the merge library's UnmarshalStrict (refuses repeated, unknown and case-misspelled members, invalid UTF-8, and trailing data), then ValidateArtifact (rejects SCMP_ACT_NOTIFY, the listener settings listenerPath, listenerMetadata and SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV, errno values above 4095, argument values above 32 bits when a 32-bit architecture is covered, rules for one syscall that libseccomp refuses to load together, and profiles past its four limits (128 entries per syscall, 256 rules per syscall, 1024 names per entry, 16384 rules per profile)).
  • Well-known errors from k8s.io/cri-api/pkg/errors: reuse RegistryUnavailable and SignatureValidationFailed, return the new SecurityProfileInvalid for permanent rejection.
  • SecurityProfile.profile_type = OCI with oci_ref and optional base_profile in RunPodSandbox/CreateContainer; merge order is runtime baseline, then base profile, then OCI profile via seccomp.Intersect, which handles the native architecture itself (no caller preparation); load the merge result, never the artifact as pulled. oci_ref carries the pod spec reference; accept it even when a mirror served the content.
  • Baseline configuration (RuntimeDefault or a profile on disk), validated at config load.
  • Report security_profile_oci in RuntimeFeatures.
  • Storage: eviction is a runtime decision (it costs a re-pull, not a failed pod), but keep profiles referenced by an existing sandbox or container, since the kubelet re-pulls on every sync; never list profile artifacts in ListImages; expose artifact count and size metrics (no kubelet-driven GC until beta).
  • Observability: warning log with a well-known message identifier when the merge constrains an OCI profile, plus a metric counting constrained merges.
  • Signature policy applied to profile pulls like image volumes.
  • Snapshotter ImageService proxies (stargz, nydus, overlaybd) need to forward the new method; until then they answer Unimplemented, which the kubelet treats as permanent and fails the pod. Transparent forwarding of unknown methods would avoid a proxy release per new RPC.
  • critest coverage for the RPC, validation, merge, and errors.

Additional context

CRI-O has shipped annotation-based OCI artifact support for seccomp profiles since v1.30; its implementation of this KEP is tracked in https://github.com/cri-o/cri-o/issues/10037. The RPC is on ImageService (not RuntimeService) so that snapshotters can forward credentials through their existing ImageService proxy. Merge library: moved to https://github.com/kubernetes-sigs/security-profiles-merger as a SIG Node subproject; import sigs.k8s.io/security-profiles-merger, and v0.6.0 is the version to pin: it ships seccomp.UnmarshalStrict, seccomp.ValidateArtifact with its limits, and merge semantics checked against libseccomp, runc, and crun, including 32-bit argument comparison and socketcall/ipc multiplexing (so the merge result depends on the node's architecture and runs on the node), and the KEP's merge text follows it. The runtime flow is described in https://github.com/kubernetes-sigs/security-profiles-merger/blob/v0.6.0/docs/integration.md, so nothing blocks the integration on the library side. Kubelet prerequisite: https://github.com/kubernetes/kubernetes/pull/141958, merged for v1.38.