XenonStack

Continuous Security

XenonStack Insights Container Security: Best Practices and NIST SP 800-190

and | Published | Updated

Container security guide: runtime detection, pod hardening, image and registry controls, container-specific host OS.

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.

Two-column diagram pairing images, registries, containers and host OS risks with scanning, immutable names, Pod Security Restricted settings and container-specific host operating systems.
LayerRisks NIST SP 800-190 namesHeadline countermeasure
ImagesVulnerabilities, configuration defects, embedded malware, clear text secrets, untrusted imagesImage vulnerability management across the whole lifecycle; keep secrets outside images
RegistriesInsecure connections, stale images, weak authentication and authorisationEncrypted connections, pruning of vulnerable images, immutable version names, authentication for sensitive repositories
OrchestratorsUnbounded administrative access, poor network separation, mixed workload sensitivity levelsLeast-privilege access; separate networks and hosts by sensitivity level
ContainersRuntime vulnerabilities, unbounded network access, insecure runtime settings, rogue containersRuntime monitoring, egress control, no privileged mode
Host OSLarge attack surface, shared kernel, component vulnerabilities, file system tamperingContainer-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.

SettingWhat it doesPractical use
runAsUserSets the user ID for the container's processes; a container-level value overrides the pod-level oneRun as a non-root ID
readOnlyRootFilesystemMounts the root file system read-onlyStops an intruder writing to the image file system; give writable paths through volumes
allowPrivilegeEscalationControls whether a process can gain more privileges than its parent, for example through a setuid binary; defaults to trueSet to false
capabilitiesAdds or drops individual Linux capabilitiesDrop everything, add back only what the workload needs
seccompProfileFilters system calls; type is RuntimeDefault, Unconfined or LocalhostUse 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?

PracticeWhen it fitsCurrent status
Image scanning and policy gates in CIEvery pipeline that builds imagesRecommended by NIST SP 800-190
Pod Security Standards, Restricted profileApplication workloads that need no host accessDocumented in Kubernetes; use Baseline where Restricted breaks a workload
Read-only root file systemStateless servicesDocumented securityContext field
Docker Content TrustExisting pipelines that already signBeing retired; Notary v1 service shuts down 8 December 2026
Runtime detectionProduction clustersRecommended by NIST; tools such as Falco are open source
Separate hosts by sensitivityMixed regulated and non-regulated workloadsRecommended 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?

  1. Inventory images, registries and clusters, and name an owner for each.
  2. Add image scanning and a block on critical findings to CI.
  3. Move secrets out of images and Dockerfiles.
  4. Apply Baseline Pod Security in warning mode, then enforce Restricted where workloads allow.
  5. Set non-root users, dropped capabilities, seccomp and read-only file systems in pod specs.
  6. Add runtime detection and egress control.
  7. 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.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in Solving your Challenges with XenonStack Team
Get Started

Get Started with your requirements and primary focus, that will help us to make your solution

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Proceed Next