OwnLife home
First LookCloud InfrastructureOpen SourceDeveloper ToolsSeptember 24, 20267 min read By OwnLife · AI-generated

Kubernetes v1.37 Storage Security: What Bind Mount Options and EmptyDir Permissions Break

Kubernetes v1.37 adds noexec/nosuid mount flags and sticky-bit emptyDir modes to pod specs. Here's what breaks in sidecars, CI runners, and Helm charts—and how to audit before your security team mandates it.

Photo by GuerrillaBuzz on Unsplash

Kubernetes v1.37 Storage Security: What Bind Mount Options and EmptyDir Permissions Break

The latest release adds Linux-level mount hardening directly to pod specs. If your workloads assume permissive volume behavior, here's exactly what needs to change.

Kubernetes v1.37 shipped on September 16 with two storage security features that sound incremental but reach deep into how containers interact with volumes — configurable bind mount options and explicit emptyDir permission modes. As the Kubernetes project blog explains in the official v1.37 release announcement, these features let developers enforce policies like preventing cross-container file deletion or blocking binary execution from writable volumes, directly in pod manifests rather than through external tooling or workarounds.

For teams running production workloads, this is less about new capability and more about new defaults that may collide with existing assumptions. Here's the gap analysis.

What Actually Changed: Bind Mount Options

Before v1.37, Kubernetes gave you limited control over how volumes were mounted into containers. You could set readOnly: true or leave it writable. That was roughly it at the pod spec level. Any finer-grained mount behavior — like preventing execution of binaries from a volume or enforcing the sticky bit on shared directories — required either custom init containers, security contexts with limited scope, or host-level configuration that lived outside your manifests entirely.

The new bind mount options expose Linux VFS (Virtual File System) flags directly in volume mount specifications. These map to the low-level Linux mechanisms that control what actions are permitted on a mounted filesystem, the Kubernetes project blog notes: noexec to prevent binary execution, nosuid to block setuid/setgid bits, and nodev to prevent device file interpretation.

The practical difference: you can now declare in a pod spec that a particular volume mount should be noexec, and the kubelet will enforce it at the Linux mount level. Previously, achieving this required either a PodSecurity admission policy that blanket-applied restrictions, or a custom mutating webhook, or manual node configuration. None of those approaches were portable or declarative in the way Kubernetes manifests are supposed to be.

What Breaks: Bind Mount Enforcement

If your containers write scripts or binaries to an emptyDir or projected volume and then execute them, a noexec mount option will hard-stop that pattern. This is more common than you'd think. CI/CD runners, data pipeline containers that download and run transformation scripts, and sidecar patterns that stage executables in shared volumes all rely on this behavior.

Any Helm chart or operator that mounts a writable volume and assumes execution is permitted will need review. The bind mount options are opt-in per volume mount, so nothing changes automatically on upgrade. But if your organization starts enforcing these options via admission policy — which is the clear intent — existing workloads that haven't been audited will start failing.

EmptyDir Permission Modes: The Sticky Bit Problem

The second feature is more subtle and arguably more disruptive. Kubernetes v1.37 introduces explicit permission mode configuration for emptyDir volumes. The Kubernetes blog highlights the sticky bit explanation in the announcement as the key mechanism: when applied to a directory (mode 01777), it ensures files can only be deleted or renamed by their owner or root, even in a world-writable directory.

This matters because emptyDir volumes are the default scratch space in Kubernetes. They're used for inter-container communication within a pod, temporary caches, and sidecar coordination. By default, emptyDir volumes have historically been created with 0777 permissions — world-readable, world-writable, and critically, any container in the pod can delete any other container's files (EmptyDir Volume Permission Mode | Kubernetes Contributors).

With the new permission mode field, you can set 01777 (sticky bit) on an emptyDir, which means Container A can't delete files created by Container B, even though both can read and write to the same directory. This is the same mechanism Linux uses for /tmp.

What Breaks: EmptyDir Sticky-Bit

The assumption that any container in a pod can freely manage files in a shared emptyDir is baked into a lot of sidecar patterns. Log shipping sidecars that rotate or clean up files written by the main container. Config-reloading sidecars that swap out files atomically. Init containers that stage files for the primary workload and expect the primary to overwrite or remove them later.

If your organization enforces sticky-bit emptyDir permissions via admission policy, any sidecar that deletes files it didn't create will get EPERM errors. The container won't crash immediately — it'll get permission-denied on specific file operations, which often surfaces as intermittent failures that are harder to diagnose than a clean startup failure.

Migration Steps: What to Audit Before Upgrading

The features themselves are opt-in, so upgrading to v1.37 won't break anything by default. The risk comes from organizational security policies that adopt these features as requirements. Here's what to check:

1. Inventory your volume mount execution patterns. Search your manifests and Helm charts for emptyDir volumes and projected volumes where containers write and then execute files. Flag any workload that stages binaries, scripts, or shared libraries in a volume mount. These are candidates for breakage under noexec policies.

2. Audit sidecar file ownership. For any pod with multiple containers sharing an emptyDir, trace which container creates files and which container deletes or renames them. If ownership doesn't match, sticky-bit enforcement will cause failures. Fix this by running sidecars under the same UID, or redesign the handoff to use signal files rather than deletion.

3. Review PodSecurity and admission controllers. If you're using Pod Security Standards (the replacement for the deprecated PodSecurityPolicy), check whether your restricted or baseline profiles will be updated to require bind mount options. The new fields give admission controllers a much more granular surface to enforce. Expect policy-as-code tools like OPA/Gatekeeper and Kyverno to ship rules for these features quickly.

4. Test StatefulSets with persistent volume claims. The bind mount options apply to all volume types, not just emptyDir. If your StatefulSets mount PVCs and any container executes binaries from those mounts — common in database containers that run initialization scripts from mounted config volumes — test with noexec explicitly to understand the blast radius.

5. Check feature gate status. As with all Kubernetes features, these may be behind feature gates at alpha or beta stage. Verify the gate status in the v1.37 release notes before assuming they're enabled by default in your distribution. Managed Kubernetes services (EKS, GKE, AKS) typically lag upstream by weeks or months, and may not enable beta gates immediately (Feature gates | Google Kubernetes Engine (GKE)).

Broader Security Context: What This Enables

These features close a gap that security teams have been working around for years, and they fit a pattern we noted in our earlier reporting on Kubernetes v1.37's kubelet flag removals and containerd 2.0 requirements: this release leans hard on operational hygiene. The storage hardening features fit that pattern: they move security enforcement from the node level (where it's fragile and non-portable) into the pod spec (where it's declarative and auditable).

The practical effect is that security teams can now write admission policies that say "no writable volume in this namespace may permit execution" or "all shared emptyDir volumes must use sticky-bit permissions." These are policies that were previously either impossible to enforce consistently or required custom tooling to approximate.

This also intersects with the broader Kubernetes ecosystem. InfoQ reports that Microsoft recently open-sourced TauGrid for managing AI workloads on GPU-enabled Kubernetes clusters. AI workloads that download and execute model-serving binaries from shared volumes are exactly the kind of pattern that bind mount options are designed to control (Pod | Kubernetes API Reference). As Kubernetes continues to absorb more diverse workload types, the need for granular storage security only increases.

What to Do Now

Don't wait for your managed Kubernetes provider to enable these features before auditing. The migration work is the same regardless of when the feature gates flip: inventory your volume execution patterns, fix sidecar file ownership assumptions, and prepare admission policies.

The upgrade to v1.37 itself is safe — these features are additive. The disruption comes when your security team, or your compliance requirements, starts mandating them. That's when the manifests you didn't audit become the incidents you didn't expect.

Advertisements

What's your next step?

Every journey begins with a single step. Which insight from this article will you act on first?