Key takeaway
- Container security explained: the five NIST SP 800-190 risk areas, Kubernetes hardening settings, Pod Security profiles and Docker Content Trust status.
Container security is the practice of protecting container images, registries, orchestrators, running containers and the host operating system that they share. NIST SP 800-190, the Application Container Security Guide (final, September 2017), is the reference most teams start from, and it groups the risks into those five areas.
This guide turns that structure into a working checklist for Docker and Kubernetes teams: what to control at each layer, which Kubernetes settings do the work, what to do about image signing now that Docker Content Trust is being retired, and how to sequence adoption. It sits alongside our guides to containers in DevOps and cloud-native security.
What does container security cover?
A container packages application code and its dependencies, but it still runs on a shared host kernel. That is why NIST treats container security as a stack of five risk areas rather than a single control. Fixes for image problems, for example, must be made in the image and redeployed, so a running container can stay vulnerable until it is rebuilt.
| Layer | Risks NIST SP 800-190 names | Headline countermeasure |
|---|---|---|
| Images | Vulnerabilities, configuration defects, embedded malware, clear text secrets, untrusted images | Image vulnerability management across the whole lifecycle; keep secrets outside images |
| Registries | Insecure connections, stale images, weak authentication and authorisation | Encrypted connections, pruning of vulnerable images, immutable version names, authentication for sensitive repositories |
| Orchestrators | Unbounded administrative access, poor network separation, mixed workload sensitivity levels | Least-privilege access; separate networks and hosts by sensitivity level |
| Containers | Runtime vulnerabilities, unbounded network access, insecure runtime settings, rogue containers | Runtime monitoring, egress control, no privileged mode |
| Host OS | Large attack surface, shared kernel, component vulnerabilities, file system tampering | Container-specific host operating systems instead of general-purpose ones |
Source: NIST SP 800-190, sections 3 and 4, read 13 November 2026.
How do you secure container images and registries?
Start with where images come from. Build from sources you trust, scan every image before it reaches a registry, and rescan what is already running, because new vulnerabilities are reported after an image ships. NIST recommends container-specific vulnerability management tools and processes, with scanning and policy gates across the image lifecycle.
Keep secrets out of images. NIST says secrets should be stored outside images and provided dynamically at runtime. A key or token written into a Dockerfile layer can be recovered from the image, so use a secrets mechanism instead; our guide to Docker BuildKit covers build-time secrets.
Treat the registry as a controlled system. Require encrypted connections, require authentication for sensitive repositories, use immutable version names so a tag cannot silently change, and prune stale images that carry known flaws.
What is happening to Docker Content Trust?
Docker Content Trust uses digital signatures on image tags so that consumers who enable it can only pull, run or build with signed images. According to Docker's documentation, it is being retired, and the Notary v1 service at notary.docker.io will shut down on 8 December 2026. If your pipeline relies on it, plan a replacement for signing and verification now, and confirm the current Docker guidance on the official page.
Which Kubernetes settings harden a running container?
Most hardening in Kubernetes is set in the pod or container securityContext. The fields below are documented on the Kubernetes security context page.
| Setting | What it does | Practical use |
|---|---|---|
| runAsUser | Sets the user ID for the container's processes; a container-level value overrides the pod-level one | Run as a non-root ID |
| readOnlyRootFilesystem | Mounts the root file system read-only | Stops an intruder writing to the image file system; give writable paths through volumes |
| allowPrivilegeEscalation | Controls whether a process can gain more privileges than its parent, for example through a setuid binary; defaults to true | Set to false |
| capabilities | Adds or drops individual Linux capabilities | Drop everything, add back only what the workload needs |
| seccompProfile | Filters system calls; type is RuntimeDefault, Unconfined or Localhost | Use RuntimeDefault as a baseline |
The same page also documents SELinux options and an AppArmor profile setting, which apply the mandatory access control mechanisms that the old version of this guide described.
What do the Pod Security Standards require?
The Pod Security Standards define three profiles. Privileged is an unrestricted policy that allows known privilege escalations. Baseline is minimally restrictive and prevents known privilege escalations. Restricted is heavily restricted and follows current pod hardening practice. Under Restricted, containers must run as non-root (runAsNonRoot true), must not allow privilege escalation, must drop all capabilities and may add back only NET_BIND_SERVICE, and must set a seccomp profile of RuntimeDefault or Localhost. Choose the profile per namespace and test it in warning mode before enforcing it.
How do you detect threats while containers run?
Scanning cannot find flaws nobody has reported yet. NIST recommends container-aware runtime defence tools, because traditional tools often lack the visibility and scale that containers need, together with control of outbound traffic and rapid patching. Falco describes itself as cloud native runtime security across hosts, containers, Kubernetes and cloud environments, and states that it is a graduated Cloud Native Computing Foundation project (falco.org, read 13 November 2026). Commercial platforms exist as well; confirm any vendor capability on that vendor's own page before you rely on it.
Design your cluster so that a compromise stays small. Kubernetes patterns such as sidecars and init containers are covered in our guide to Kubernetes container design patterns, and NIST advises separating workloads of different sensitivity onto separate hosts.
Which practice fits which situation?
| Practice | When it fits | Current status |
|---|---|---|
| Image scanning and policy gates in CI | Every pipeline that builds images | Recommended by NIST SP 800-190 |
| Pod Security Standards, Restricted profile | Application workloads that need no host access | Documented in Kubernetes; use Baseline where Restricted breaks a workload |
| Read-only root file system | Stateless services | Documented securityContext field |
| Docker Content Trust | Existing pipelines that already sign | Being retired; Notary v1 service shuts down 8 December 2026 |
| Runtime detection | Production clusters | Recommended by NIST; tools such as Falco are open source |
| Separate hosts by sensitivity | Mixed regulated and non-regulated workloads | Recommended by NIST |
How should governance and cost be handled?
Container security fails most often at the edges between teams: who approves a base image, who owns a registry, who may run a privileged pod. Write those rules as policy and keep an audit trail of exceptions. Where AI agents now raise pull requests, scan images or change cluster settings, the same rule applies to them. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents, and AgentGRC offers governance, risk and compliance controls for autonomous agent actions.
Cost follows hygiene. Stale images in registries multiply scanning work and carry known flaws, so pruning and immutable version names are security controls and housekeeping at once.
In what order should a team adopt these controls?
- Inventory images, registries and clusters, and name an owner for each.
- Add image scanning and a block on critical findings to CI.
- Move secrets out of images and Dockerfiles.
- Apply Baseline Pod Security in warning mode, then enforce Restricted where workloads allow.
- Set non-root users, dropped capabilities, seccomp and read-only file systems in pod specs.
- Add runtime detection and egress control.
- Replace any dependency on Docker Content Trust before 8 December 2026.
What are the trade-offs and limits?
Containers share the host kernel, and NIST lists that shared kernel as a host risk, so containers are not a substitute for separate machines when workloads are mutually hostile. Restricted profiles can break images that expect to run as root, and read-only file systems need volumes for scratch space. Expect some rework of base images before you can enforce the strictest settings.
Video: Container Security Solutions and Strategy, from XenonStack.
To map one container or pipeline decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
Container security FAQ
What is container security?
It is the set of processes, tools and policies that protect images, registries, orchestrators, running containers and the host. NIST SP 800-190 groups the risks into those five areas.
Are containers secure by default?
No. Containers share the host kernel, and settings such as privilege escalation default to allowed in Kubernetes unless you change them. Hardening is something you configure.
What does the Restricted Pod Security profile require?
Non-root execution, no privilege escalation, all capabilities dropped (only NET_BIND_SERVICE may be added back) and a seccomp profile of RuntimeDefault or Localhost.
Should I keep using Docker Content Trust?
Docker's documentation says it is being retired and that the Notary v1 service at notary.docker.io shuts down on 8 December 2026, so plan an alternative and confirm current guidance on Docker's site.
Where should secrets live?
Outside images. NIST says secrets should be stored outside images and provided dynamically at runtime.
Ready to put AI agents to work? See an ElixirClaw demo: the agentic OS to build, orchestrate and govern AI agents across your enterprise systems.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE