Container image trust and runtime least privilege
Two independent trust decisions
A container image packages an application and its dependencies. A digest identifies specific image content; a tag can change. Verify the digest and trusted signer or provenance before approving a release, then restrict what the running process can do. A signed image can still contain vulnerabilities.
Isolation layers
Linux namespaces separate views of resources; containers still share a kernel. Capabilities divide privileged operations into smaller permissions, while seccomp limits system calls. A nonroot application runs with a nonzero user ID inside the container; Docker rootless mode also runs the daemon without host root privileges. These controls are complementary. Never mount a host daemon socket into a classroom container.
Review a static security context
This Linux container securityContext fragment is not a complete manifest or a deployment instruction:
runAsNonRoot: truerunAsUser: 10001allowPrivilegeEscalation: falsereadOnlyRootFilesystem: truecapabilities: drop: [ALL]seccompProfile: type: RuntimeDefaultThe application must support this user and write only to explicitly approved writable storage. Review every app, init and ephemeral container, not just the first. Check Pod-level inherited settings.
What verification cannot prove
A registry digest is not a signature. A signature must bind the exact artifact to an approved identity and trust root; separately evaluate SBOM and vulnerability findings. A read-only root filesystem does not make mounted volumes read-only. RuntimeDefault depends on runtime implementation. Kubernetes v1.35 Restricted Pod Security Standards do not require a read-only root filesystem; this is an additional classroom requirement.
Practice a release review
A report image has an approved signature and digest but requires writing a temporary file. Propose a narrowly scoped writable volume and a test for successful report generation; do not remove all restrictions. If signer evidence is absent, mark review pending. Revisit Linux hardening (chapter 16), supply-chain security (chapter 26) and the ByteMind Docker track for image and runtime foundations.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Container image trust and runtime least privilege — knowledge check
Review container trust, runtime, access and telemetry.
What does an image digest establish?
What distinguishes Docker rootless from a nonroot application?
What does seccomp constrain?
What does a read-only root filesystem not guarantee?
Does v1.35 Restricted PSS require readOnlyRootFilesystem?