Container Security
Container security protects containerized workloads throughout their lifecycle: securing images at build time, hardening runtime isolation, restricting capabilities, segmenting network access, and monitoring for anomalous behavior in production container environments.
itVirtualization, containers, and orchestration | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Container Security
Container security is the work of making a packaged application less able to surprise the host, its neighbors, or the delivery system when something inside it goes wrong. A container brings its application and user-space dependencies, but on Linux it still shares the host kernel. Efficient, certainly. A tiny separate machine, regrettably not.
The useful map has five layers: source and build, image, registry and delivery, runtime and orchestrator, then host and observation. Each asks a different question. A vulnerability scan can identify known weaknesses. It cannot tell you who built the image, and a signature cannot make its contents safe by force of paperwork. Digest, signature, and provenance are three different receipts for three different questions.
At runtime, the aim is not to construct an invincible lunchbox. It is to give the process the smallest practical authority. A non-root user, fewer Linux capabilities, blocked privilege escalation, a read-only root filesystem, and a system-call filter all reduce what a compromised process can do next. The surprise is that “containerized” is not the same thing as “safely isolated.” A privileged container or a container-engine socket can turn a neat boundary into an administrative shortcut with unfortunate consequences.
Secrets belong outside the image and arrive at runtime through a managed mechanism. NetworkPolicy describes expected traffic, but it only works when the cluster network implementation enforces it. This is a recurring theme: configuration without enforcement is a very well formatted wish.
Static checks stop when the workload starts. Runtime monitoring watches for the awkward sequel: unexpected processes, new network destinations, filesystem writes, privilege changes, and sensitive host access. Preserve the relevant events before replacing a suspect workload, because containers are admirably disposable until they are also your evidence.
For the full map, read the Intro first. The Slides compress the relationships between lifecycle layers and controls. The Cheatsheet is the operating reference when reviewing a workload. Field Notes covers the sharper edges that emerge in practice. The Quiz tests the distinctions that prevent a signed image, a clean scan, and a restricted runtime from being mistaken for the same thing.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://csrc.nist.gov/pubs/sp/800/190/final
Supports
- Containers as operating system virtualization combined with application packaging
- Shared-kernel isolation and container-specific risks
- Security responsibilities across images, registries, orchestrators, containers, and hosts
- Vulnerability management, trusted images, runtime defense, monitoring, and incident response
- Publication of the Application Container Security Guide in September 2017
- https://docs.docker.com/build/building/best-practices/
Supports
- Trusted minimal base images and reduced attack surface
- Multi-stage builds and removal of build-only content from final images
- Regular image rebuilds with updated dependencies
- Mutable tags, digest pinning, reproducibility, and required update workflows
- https://docs.docker.com/engine/security/
Supports
- Docker daemon authority and host security boundary
- Linux capability removal and least-privilege recommendations
- User namespaces, image signature verification, AppArmor, and SELinux
- https://docs.docker.com/engine/security/seccomp/
Supports
- Seccomp as a Linux system-call restriction mechanism
- Docker default seccomp profile behavior and the risk of unconfined execution
- https://docs.docker.com/engine/security/trust/
Supports
- Image signing and client-side signature enforcement
- Distinction between signed tags and explicit content hashes
- https://kubernetes.io/docs/concepts/security/application-security-checklist/
Supports
- Non-root execution, blocked privilege escalation, read-only root filesystems, and capability removal
- Per-workload service accounts and optional token mounting
- NetworkPolicy enforcement dependency and runtime isolation choices
- https://kubernetes.io/docs/concepts/security/security-checklist/
Supports
- Secret encryption, runtime delivery, and service-account token minimization
- Minimal images, unprivileged users, audit logs, node separation, and RuntimeClass tradeoffs
- https://kubernetes.io/docs/concepts/security/pod-security-standards/
Supports
- Privileged, Baseline, and Restricted policy profiles
- Restricted non-root, privilege-escalation, seccomp, capability, and volume rules
- https://kubernetes.io/docs/concepts/security/linux-kernel-security-constraints/
Supports
- Seccomp, AppArmor, SELinux, capabilities, and non-root workload isolation
- Privileged containers overriding or weakening kernel security constraints
- Sandboxed runtimes as a stronger but more costly isolation choice
- https://specs.opencontainers.org/image-spec/descriptor/
Supports
- OCI descriptor digest and size fields
- Digests as content identifiers and verification inputs
- https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html
Supports
- Risk of exposing the Docker daemon socket
- Capability minimization, security profiles, secret handling, and supply-chain controls
- https://docs.docker.com/reference/cli/docker/container/run/
Supports
- Docker run options for read-only filesystems, tmpfs mounts, capability removal, security options, and user selection
- Inspectable local restricted-container exercise
- https://docs.docker.com/engine/release-notes/prior-releases/
Supports
- Docker initial public release in March 2013
- Docker 1.0 production support in June 2014
- https://opencontainers.org/about/overview/
Supports
- Open Container Initiative launch on June 22 2015
- OCI standards for image formats and runtimes
- https://kubernetes.io/blog/2018/09/27/kubernetes-1-12-release-announcement/
Supports
- Kubernetes 1.12 RuntimeClass alpha feature
- https://kubernetes.io/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/
Supports
- PodSecurityPolicy deprecation in Kubernetes 1.21
- Migration toward Pod Security Admission or third-party admission plugins
- https://kubernetes.io/docs/concepts/security/pod-security-policy/
Supports
- PodSecurityPolicy removal in Kubernetes 1.25
- https://kubernetes.io/blog/2023/09/13/userns-alpha/
Supports
- Kubernetes user namespaces alpha and host user ID mapping
- https://kubernetes.io/blog/2024/04/05/userns-enabled-by-default/
Supports
- Kubernetes user namespaces beta and expanded support conditions
- https://trivy.dev/
Supports
- Trivy image and configuration analysis
- https://www.docker.com/products/docker-scout/
Supports
- Docker Scout image analysis and image update workflows
- https://snyk.io/product/container-vulnerability-management/
Supports
- Snyk Container vulnerability management
- https://docs.sigstore.dev/cosign/
Supports
- Cosign image signatures and attestations
- https://www.chainguard.dev/chainguard-images/
Supports
- Chainguard Images as a container image offering
- https://falco.org/
Supports
- Falco runtime security and detection
- https://sysdig.com/
Supports
- Sysdig runtime detection and investigation offering
- https://www.aquasec.com/
Supports
- Aqua Security lifecycle security offering
- https://gvisor.dev/
Supports
- gVisor as a sandboxed container runtime
- https://kubescape.io/
Supports
- Kubescape Kubernetes security posture and policy analysis
- https://sysdig.com/blog/how-runtime-insights-help-with-container-security/
Supports
- Runtime context and continuous visibility for ephemeral container workloads
- https://github.com/google/gvisor/security
Supports
- Container-engine socket exposure as a configuration-caused escape path
- gVisor sandbox escape model and host-boundary examples
- https://github.com/google/gvisor
Supports
- gVisor stronger isolation model and compatibility considerations
- https://sysdig.com/blog/sysdig-secure-docker-run-time-security/
Supports
- Runtime baselining for unexpected processes, paths, and connections
