Kubernetes v1.37 Hardens In-Pod Storage with Native Bind Mount Options and Sticky Bits
The Kubernetes project has introduced two new storage security features in Kubernetes v1.37 under alpha feature gates: configurable bind mount options (VolumeBindMountOptions) and emptyDir permission modes (EmptyDirVolumeMode). Authored by Red Hat engineers Nispriha Jagan and Neeraj Krishna Gopalakrishna, these enhancements allow platform operators and developers to apply native Linux mount flags—specifically noexec, nosuid, and nodev—directly to volumeMounts across persistent, CSI, projected, secret, and emptyDir volumes, while also enabling granular octal permission modes such as 0750 or the POSIX sticky bit (01777) on temporary directories.
For platform engineers and DevSecOps practitioners, this feature pair resolves a stubborn architectural security gap. Historically, mounting an emptyDir volume forced a default 0777 permission set. In multi-container pods sharing temporary scratch spaces or unix sockets, any container could inadvertently overwrite or delete files generated by sidecars. Furthermore, while teams routinely set readOnlyRootFilesystem: true to prevent container runtime compromises, attackers executing malicious code could still write payload scripts or binaries to an emptyDir or PersistentVolume, chmod +x them, and execute arbitrary code. Native noexec mount flags eliminate this attack vector at the kernel level.
This storage lockdown fits directly into Kubernetes' multi-year push toward rootless, defense-in-depth node and pod architectures. Over recent releases, the container ecosystem has systematically shifted isolation responsibilities into the core control plane—progressing from user namespaces (UserNamespacesSupport graduating to GA in v1.36) and rootless node components (KubeletInUserNamespace hitting beta in v1.37) to granular storage controls. Instead of forcing platform teams to maintain privileged init containers or custom admission webhooks that perform out-of-band chmod and mount operations, Kubernetes is standardizing POSIX security primitives into the core Pod specification.
In practice, utilizing these capabilities requires cluster administrators running v1.37 to explicitly enable both the VolumeBindMountOptions and EmptyDirVolumeMode feature gates on both the kube-apiserver and kubelet. Workload authors can specify mode: 01777 on emptyDir specs to emulate classic /tmp directory behaviors where only file owners can delete their assets, or set restrictive permissions like 0750 for isolated database scratchpads. When implementing bindMountOptions, operators must ensure that underlying container runtimes (such as containerd or CRI-O) support CRI mount_options, and note that pod-level fsGroup definitions will still take precedence over volume modes. Windows worker nodes do not support these Linux-specific flags, so heterogeneous clusters should rely on node affinity rules when testing these configurations.
Read original source