LIVEยทThe trends shaping tomorrow's world.
Future Tech

Container Security Explained: Risks and Controls from Build to Runtime

Container security across images, registries, orchestrators, runtimes and hosts: the risks NIST SP 800-190 names and the controls that address each one.

Container security means protecting every stage a container passes through: the image you build, the registry that stores it, the orchestrator that schedules it, the runtime that executes it and the host kernel it shares with other containers. NIST's container security guide names risks at each of those five layers [1]. The biggest shift from traditional server security is timing. Because containers are rebuilt and redeployed instead of patched in place, most fixes happen in the build pipeline rather than on running systems [1].

If you're new to how containers isolate workloads, start with our explainer on containers vs virtual machines. This article assumes that background and focuses on threats and controls.

Why containers need a different security model

Three properties drive the differences.

Shared kernel. Containers on a host share one operating system kernel. A virtual machine has its own kernel behind a hypervisor. A kernel or runtime flaw can therefore let a process break out of its container and reach the host [1]. NIST recommends grouping containers on a host only when they share "the same purpose, sensitivity, and threat posture" [1].

Immutability. A container image is built once and run many times. NIST notes that traditional patching and vulnerability tools assume long-lived servers with stable software, which doesn't match containers [1]. You fix a container by rebuilding the image and redeploying it.

Speed and scale. Containers start and stop constantly and move between hosts. Security tooling has to work from attributes such as container names and labels, not static IP addresses [1].

The five layers and their risks

NIST SP 800-190 organizes container risk into five component groups [1]:

Layer

Main risks (per NIST)

Core controls

Image

Vulnerable packages, configuration defects, embedded malware, clear-text secrets, untrusted images

Scan in the pipeline, minimal base images, secrets outside images, trusted sources only

Registry

Insecure connections, stale images, weak access control

TLS, prune old images, reference specific versions, role-based access

Orchestrator

Unbounded admin access, unauthorized access, flat container networks, mixed sensitivity workloads, untrusted nodes

Least-privilege RBAC, network segmentation, group workloads by sensitivity

Container (runtime)

Runtime vulnerabilities, unbounded network access, insecure runtime settings, app flaws, rogue containers

Patch the runtime, restrict egress, enforce configuration baselines, separate environments

Host OS

Large attack surface, shared kernel, component flaws, improper user access, file system tampering

Container-specific minimal OS, patching, restricted host access

Securing the image: where most of the work happens

Scan continuously, not once. NIST recommends container-aware vulnerability tools that understand image layers and the declarative build process. It also recommends centralized reporting, and preventing non-compliant images from running at all [1]. An image that was clean last month may have a newly published CVE today, so rescan stored images.

Start small. Every package in a base image is attack surface. Minimal or "distroless" base images, multi-stage builds that leave compilers behind, and pinned versions shrink what scanners have to report and what attackers can use.

Keep secrets out. NIST is explicit: "Secrets should be stored outside of images and provided dynamically at runtime as needed" [1]. Orchestrators such as Kubernetes provide native secret objects, but Kubernetes warns that Secrets are stored unencrypted in etcd by default, and anyone with API access or etcd access can retrieve them. Its minimum steps include enabling encryption at rest and least-privilege RBAC access to Secrets [7]. Our upcoming guide to secrets management and key vaults covers the options.

Know where images came from. Supply-chain attacks target the build itself. SLSA (Supply-chain Levels for Software Artifacts), whose current specification is version 1.2 (as of November 2026), describes itself as "a set of incrementally adoptable guidelines for supply chain security," with ascending levels in tracks such as its Build Track, which covers producing and verifying build provenance [5]. NIST recommends identifying images by cryptographic signature and validating those signatures before an image runs [1]. In practice, teams sign images in the pipeline and verify signatures and provenance before deployment.

Securing registries

Registries are the handoff between build and run. NIST's two main points are pruning and precise references [1]. Delete vulnerable images that should no longer be used. Deploy specific versions, such as my-app:2.4, rather than trusting a latest tag that is "only a label" with no guarantee of freshness [1]. Many teams go further and reference images by immutable content digest. Require TLS for registry connections and restrict who can push.

Securing the orchestrator

The orchestrator controls everything, so its admin access is a crown jewel. NIST recommends least-privilege access models, strong authentication, segmenting container network traffic by sensitivity, and separating workloads of different sensitivity onto different hosts [1].

In Kubernetes, these map to role-based access control, NetworkPolicies and the Pod Security Standards. Those standards define Privileged, Baseline and Restricted profiles, ranging from "unrestricted" to "heavily restricted" pod permissions [6]. We cover the platform layer in depth in our upcoming Kubernetes security architecture guide, and the control plane itself in our Kubernetes architecture explainer.

Securing the runtime

Container escapes are real and documented:

  • CVE-2019-5736: runc through 1.0-rc6, as used in Docker before 18.09.2, let a process running as root inside a container overwrite the host's runc binary and gain root on the host [2].
  • CVE-2024-21626: in runc 1.1.11 and earlier, a leaked file descriptor could give a new container process a working directory on the host filesystem, enabling a full escape. runc 1.1.12 fixed it [3].

The lessons:

  • Patch the runtime like any other critical component [1].
  • Don't run as root. CVE-2019-5736 required the attacker to run a command as root inside the container [2], and non-root processes have less to work with in any escape. Docker's rootless mode goes further and runs the daemon and containers inside a user namespace as a non-root user [4]. In Kubernetes, the Restricted profile requires non-root execution [6].
  • Drop privileges. Avoid privileged containers. Drop Linux capabilities you don't need, and use read-only root filesystems where possible.
  • Enforce baselines automatically. NIST recommends tools that continuously assess and enforce runtime configuration, such as against the CIS Docker Benchmark, plus mandatory access control like SELinux or AppArmor [1].
  • Control network egress. By default, many platforms let containers talk to anything. Restrict outbound traffic to what each service needs [1].
  • Stop rogue containers. Separate development, test and production environments, tie every container creation to an individual identity, and log it [1].

Securing the host

NIST recommends container-specific host operating systems: minimal systems built only to run containers, with other services disabled and read-only file systems. Their attack surface is "typically much smaller" than a general-purpose OS [1]. Avoid direct logins to hosts and audit the ones that happen, patch the kernel promptly, and consider hardware roots of trust such as TPM-based measured boot [1].

Where to start

If you're securing an existing container platform, this order gives the most risk reduction per hour:

  1. Inventory and scan every image in your registries and block known-critical vulnerabilities at deploy time.
  2. Remove secrets from images and move them to the orchestrator or a vault, with encryption at rest.
  3. Enforce non-root, non-privileged containers using admission policy (Baseline at minimum, Restricted where possible) [6].
  4. Lock down orchestrator admin access and add network segmentation between workloads.
  5. Add provenance: generate build provenance [5], sign images and verify signatures before they run [1].
  6. Move hosts to a minimal container OS and automate kernel and runtime patching [1].

Frequently asked questions

Are containers less secure than virtual machines?

Containers share the host kernel, so a kernel or runtime flaw can expose every container on that host. VMs have stronger isolation boundaries [1]. Well-configured containers, grouped by sensitivity and run without root, can still be appropriate for most workloads. Highly sensitive or untrusted multi-tenant code may justify VM-level or sandboxed isolation.

What is a container escape?

It's when a process breaks out of its container's isolation and gains access to the host or other containers. Documented examples include runc vulnerabilities CVE-2019-5736 and CVE-2024-21626 [2][3].

Is image scanning enough?

No. Scanning finds known vulnerabilities in packages. It doesn't catch misconfigurations at runtime, over-broad orchestrator permissions or a compromised build pipeline. NIST treats image, registry, orchestrator, runtime and host as separate risk areas that each need controls [1].

What does "rootless" mean for containers?

In Docker's rootless mode, the Docker daemon and containers run as a non-root user inside a user namespace, to mitigate potential vulnerabilities in the daemon and the container runtime [4]. A process that breaks out lands as an unprivileged user, not root on the host. Separately, running the application inside the container as a non-root user is a basic hardening step.

How old is NIST's container guidance, and is it still relevant?

SP 800-190 was published in September 2017 [1]. Specific tools have changed since, but its five-layer risk model and core recommendations still frame current practice. Pair it with current platform documentation such as Kubernetes' Pod Security Standards [6].

Sources

  1. Murugiah Souppaya, John Morello and Karen Scarfone, NIST, "SP 800-190, Application Container Security Guide," September 2017. https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-190.pdf
  2. NIST National Vulnerability Database, "CVE-2019-5736," published February 11, 2019. https://nvd.nist.gov/vuln/detail/CVE-2019-5736
  3. NIST National Vulnerability Database, "CVE-2024-21626," published January 31, 2024. https://nvd.nist.gov/vuln/detail/CVE-2024-21626
  4. Docker, "Rootless mode" (documentation). https://docs.docker.com/engine/security/rootless/
  5. OpenSSF SLSA project, "About SLSA," specification v1.2. https://slsa.dev/spec/v1.2/about
  6. The Kubernetes Authors, "Pod Security Standards." https://kubernetes.io/docs/concepts/security/pod-security-standards/
  7. The Kubernetes Authors, "Secrets." https://kubernetes.io/docs/concepts/configuration/secret/