Join our Newsletter — 33% off our NHI Course

Container Image

A container image is a read-only package that contains an application, its dependencies and the file system contents needed to run it. If an image includes vulnerable software, secrets or excessive privileges, every container started from it inherits that risk. Defenders control image provenance, patching and runtime restrictions.

What a container image represents in security terms

A container image is more than a build artifact, it is the packaged trust boundary for every container launched from it. Its contents, provenance and embedded defaults determine whether that runtime starts cleanly or starts already carrying risk.

That is why image review is not just a build concern. A single image can distribute vulnerable packages, embedded credentials, dangerous configuration and inherited permissions across every environment that pulls it.

Why image provenance and contents matter

The core security question is whether the image came from a trusted source and whether its layers contain anything that should never reach runtime. A compromised or poorly maintained image can normalize unsafe software, stale dependencies and hidden secrets across many deployments.

For that reason, container security guidance treats image provenance, registry hygiene and base-image selection as first-order controls. NIST’s NIST SP 800-190 Container Security frames images as part of the larger container trust chain, including the registry and runtime that consume them.

When organisations are trying to understand image risk, they should also look at how images are built, tagged, promoted and reused. NHIMG’s Container Security Guide gives the broader operational context for image scanning, signing, base-image selection and runtime hardening.

Common security failures in container images

Image risk usually enters through avoidable build and release mistakes. Secrets may be copied into layers, packages may remain unpatched for long periods, and an image may ship with more privilege than the application needs.

Those failures matter because images are highly reusable. If a weak image is published once, every cluster, host or pipeline that consumes it can inherit the same exposure without repeating the original mistake.

NHIMG’s Massive Docker Hub Secrets Leak and Secrets in Docker Hub images (RWTH Aachen study) both illustrate the same pattern: images can silently become distribution vehicles for credentials, keys and other sensitive material.

That reuse also creates supply-chain amplification. NHIMG’s Docker Hub breach 2019 is a reminder that registries and build systems can expose downstream systems even when the image itself is only one part of the compromise path.

How defenders control image risk across build and runtime

Defenders reduce container image risk by treating the image as a governed artifact with lifecycle controls, not as a static file. That means knowing what is in the image, who produced it, where it came from and whether it can be trusted at deployment time.

At build time, the important checks are image scanning, dependency hygiene, secret detection and provenance validation. At deployment time, the important checks are whether the runtime can constrain privilege, restrict filesystem writes and prevent the image from expanding its intended blast radius.

The guidance in NIST SP 800-190 Container Security is useful here because it connects image management to registry trust and runtime containment, rather than treating them as separate problems.

Where image risk touches identity material, the operational issue becomes even sharper, because an image can carry access material that survives into every replica. That is why hidden secrets inside container images are especially dangerous: the compromise may begin before the container even starts.

What a secure image lifecycle should preserve

A secure container image lifecycle preserves integrity from build to deployment to retirement. The image should be traceable, minimal, routinely refreshed and stripped of anything that does not belong in a runtime artifact.

That lifecycle view is what separates a safe reusable image from a convenient but fragile one. The more widely an image is reused, the more important it becomes to control provenance, version drift, embedded secrets and inherited privilege.

In practice, the best images are boring: they are reproducible, lean, signed where possible and easy to inspect. Their security value comes from reducing what is inside them and proving that what is inside them is what the operator intended to run.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST SP 800-53 Rev 5 CM-2 — Baseline Configuration Container images depend on controlled secure baselines and approved build contents.
SI-2 — Flaw Remediation Images inherit vulnerable software, so flaw remediation directly governs image patch freshness.
IA-5 — Authenticator Management Images can embed secrets and tokens, making credential lifecycle control materially relevant.
Recommendation — Establish approved image baselines and prevent unauthorized drift in package and configuration content. Scan images for vulnerable components and replace them with remediated builds before release. Detect and rotate secrets found in images, then remove them from build artifacts and pipelines.
CIS Controls v8 CIS-2 — Inventory and Control of Software Assets Images are software assets that need inventory, provenance and lifecycle control.
CIS-4 — Secure Configuration of Enterprise Assets and Software Image hardening and runtime-safe defaults map directly to secure software configuration.
Recommendation — Inventory container images and approve only trusted, current artifacts for deployment. Harden images by minimizing packages, disabling unsafe defaults and removing unnecessary privileges.