Use this when securing container images, registries and running containers.
Container Security
Container security protects images, registries and running containers: minimal and scanned images, no secrets in images, non-root and rootless containers, dropped capabilities, seccomp profiles and runtime monitoring.
1. Container security: trusted images, scanning, least privilege (non-root, no privileged), runtime protection, network policies.
2. Sign and verify images.
3. Secrets from managers.
4. Pod Security Standards.
5. Patch base images.
image build → scan/sign → admission → runtime controls
Context & applicabilityCommon mistakes · platform/version boundaries
- Running containers as root and
--privileged. - Mounting the Docker socket into containers (full host control).
- Images with many unused packages and old base images.
- Secrets baked into images or environment variables visible in
docker inspect.
Operational reference
Fast context before you go deeper.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
Container security fundamentals cover the whole lifecycle: trusted and scanned images, secure registries, least-privilege runtime settings, network policies, secrets handling and a patched host and orchestrator.
Subtopic Container IsolationContainer isolation relies on Linux namespaces, cgroups, capabilities and seccomp, sharing the host kernel.
Subtopic Image SecurityImage security means building containers from minimal, trusted, pinned base images, keeping them patched, avoiding secrets in layers and signing images so only verified ones are deployed.
Subtopic Image ScanningImage scanning checks container images for known vulnerabilities, secrets and misconfigurations with tools like Trivy or Grype, in CI and in the registry, blocking images above a severity threshold.
Subtopic Registry SecurityRegistry security protects where images are stored: authentication and RBAC for push and pull, TLS, image signing and scanning, and immutable tags so a trusted image cannot be silently replaced.
Subtopic SecretsContainer secrets should be injected at runtime from a secret store or orchestrator secrets, mounted as files with tight permissions, never baked into images or committed in Dockerfiles.
Subtopic Linux CapabilitiesLinux capabilities split root's powers into units like NET_ADMIN or SYS_ADMIN.
Subtopic SeccompSeccomp filters which system calls a process may make. Container runtimes apply a default profile blocking dangerous syscalls; custom profiles can restrict an application even further.
Subtopic Rootless ContainersRootless containers run the container engine and containers as an ordinary user with user namespaces, so a container escape lands as an unprivileged user instead of root on the host.
Subtopic Runtime SecurityContainer runtime security monitors running containers for suspicious behaviour — unexpected processes, shells, file changes or network connections — with tools like Falco, and enforces policies at admission.
Subtopic Container HardeningContainer hardening reduces attack surface: minimal base images, non-root users, read-only file systems, dropped capabilities, seccomp and AppArmor or SELinux profiles, and resource limits.
- Containers share the host kernel; isolation is weaker than VMs.
- Running as root or privileged makes escapes easier.
- Images often carry known vulnerabilities and secrets.
trivy image <image>— image vulnerabilitiesdocker inspect <container> --format '{{.HostConfig.Privileged}} {{.Config.User}}'— privileged/userkubectl get pods -A -o jsonpath='{..securityContext}'— security contexts
ReferenceWhy it matters1 section · depth on demand
Container security layers
| Layer | Controls |
|---|---|
| Image | Minimal base images, vulnerability scanning (Trivy, Grype), no secrets |
| Supply chain | Signed images (Cosign), SBOMs, trusted registries |
| Runtime | Non-root, read-only filesystem, drop capabilities, seccomp/AppArmor |
| Orchestration | RBAC, Pod Security Admission, network policies, secrets management |
| Host | Patched kernel, CIS benchmark, minimal OS |
| Detection | Falco, runtime EDR |
ReferenceHow it works1 section · depth on demand
In depth
Container security covers the whole lifecycle: building trustworthy images, storing them in a protected registry, deploying with safe settings, and monitoring at runtime. Containers share the host kernel, so a container escape or a privileged container can compromise the host.
| Phase | Controls |
|---|---|
| Build | Minimal base images, image scanning, no secrets in layers, SBOM |
| Registry | Access control, signing (cosign), vulnerability scanning |
| Deploy | Non-root, read-only root filesystem, drop capabilities, no privileged, resource limits |
| Orchestrator | RBAC, Pod Security Standards, network policies, admission control |
| Runtime | Falco/eBPF detection, drift prevention |
The topics in this group cover each phase in detail.
ReferenceImportant terms & boundaries1 section · depth on demand
Tools by layer
| Layer | Tools |
|---|---|
| Image scanning | Trivy, Grype, registry scanners |
| Signing | Sigstore cosign, Notation |
| Admission control | Kyverno, OPA Gatekeeper, Pod Security Admission |
| Runtime | Falco, Tetragon, commercial CNAPP |
| Benchmarks | CIS Docker/Kubernetes, kube-bench |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Container Security. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/sp/800/190/final · confidence 94%