Container Image Security Checklist: Reduce Vulnerabilities, Secrets, and Supply-Chain Risk
containersdockerdevsecopsimage-securitysoftware-supply-chain

Container Image Security Checklist: Reduce Vulnerabilities, Secrets, and Supply-Chain Risk

OOracles Cloud Editorial Team
2026-12-01
7 min read

Use this practical container image security checklist to catch vulnerabilities, secrets, weak permissions, and supply-chain gaps before deployment.

A container image can pass a build and still carry unnecessary packages, exposed credentials, excessive privileges, or unclear provenance into production. This reusable container image security checklist helps developers and DevOps teams review images before deployment, set practical CI/CD controls, and document exceptions without blocking every release unnecessarily.

Overview

Container image security is a chain of decisions rather than a single scan. The Dockerfile, base image, dependency lockfiles, build environment, registry, deployment configuration, and runtime permissions all influence risk. A vulnerability scanner is useful, but it cannot determine whether an image contains an accidentally copied secret, runs with excessive access, or came from an untrusted build process unless those checks are included separately.

Use this checklist at pull request review, image publication, release promotion, and before deploying an image to a sensitive environment. Record the image reference, scan results, software bill of materials (SBOM), signing or attestation status, reviewer, and any approved exceptions. The exact tools may vary; the control objectives should remain understandable even when your CI/CD platform, registry, or Kubernetes tooling changes.

For image naming, tags, digest pinning, retention, and cleanup practices, pair this checklist with the Container Image Lifecycle Guide. Security decisions are easier to enforce when image ownership and promotion paths are already clear.

Checklist by scenario

Before building the image

  • Choose a maintained base image. Confirm its publisher, intended use, update process, and supported architecture. Prefer a base with only the runtime components the application needs.
  • Reduce the attack surface. Remove compilers, package managers, shells, debugging utilities, and cached package indexes from the final runtime image when they are not required.
  • Pin important inputs. Use explicit versions for base images and application dependencies. Where reproducibility and provenance matter, reference the base image by digest rather than relying only on a mutable tag.
  • Review the build context. Keep credentials, local configuration, source-control metadata, test data, and unrelated files outside the build context. Use an appropriate ignore file and inspect what is actually sent to the builder.
  • Use multi-stage builds. Compile or test in a builder stage, then copy only the required artifacts into a smaller runtime stage.

During the build

  • Keep secrets out of layers. Do not place tokens, private keys, cloud credentials, or passwords in Dockerfile arguments, environment variables used during construction, copied files, or shell history. A deleted secret may still remain in an earlier layer.
  • Update packages deliberately. Apply available security updates using a repeatable process, then rebuild and test. Avoid combining uncontrolled floating updates with production releases if that makes the result difficult to reproduce.
  • Generate an SBOM. Produce a machine-readable inventory for the final image, including operating-system packages and application dependencies where supported. Store it with the build record or attach it to the image.
  • Capture provenance. Record the source revision, builder identity, workflow, input references, and build time. If your environment supports attestations, attach them to the image and verify them during promotion.
  • Scan more than the operating system. Configure scanning for application libraries, language packages, native binaries, and misconfigurations. Review whether the scanner examines the final image rather than only the source or intermediate stage.

Before publishing or promoting

  • Define severity gates. Establish which findings block publication, deployment, or promotion. A practical policy may treat exploitable high-severity findings differently from development-only packages or findings with no applicable fix, but the rationale must be documented.
  • Check for embedded secrets independently. Use secret-detection checks against the Dockerfile, build context, image filesystem, and relevant image history. Treat any confirmed credential as exposed: revoke or rotate it, investigate access, and rebuild the image.
  • Verify image identity. Promote by immutable digest where possible. Confirm that the digest scanned is the digest deployed; scanning one tag and later deploying a tag that changed defeats the control.
  • Restrict registry access. Limit who can push, delete, overwrite, or promote images. Separate build identities from deployment identities and retain an audit trail for publication and promotion events.
  • Sign or attest according to risk. If image signing is used, define which identities are trusted, what is signed, and where verification occurs. Keep verification rules operationally simple enough to work consistently across environments.

Before running the container

  • Avoid root by default. Create or select a non-root user and verify file ownership, ports, temporary directories, and startup behavior under that identity.
  • Limit runtime permissions. Drop unnecessary Linux capabilities, avoid privileged mode, use a read-only root filesystem where practical, and provide writable mounts only for specific paths that need them.
  • Minimize secret exposure. Inject secrets at runtime through an approved secrets mechanism rather than baking them into the image. Limit each workload to the credentials it actually needs.
  • Set resource and network controls. Define CPU and memory limits where appropriate, restrict unnecessary outbound access, and avoid broad access to host sockets or device files.
  • Test the deployed image. Confirm that the runtime identity, health checks, logging behavior, and rollback path match the security assumptions made during review.

What to double-check

Scanner results are not deployment decisions by themselves. A finding needs context: the affected component, reachable code path, execution environment, available fix, exploitability, and business impact. Establish a repeatable triage process rather than silently ignoring recurring findings.

Tags and digests may be confused. A tag is convenient for humans but can point to different content over time. Ensure the CI record, registry entry, deployment manifest, and incident logs all identify the immutable image content when traceability matters.

Build-time and runtime secrets are different problems. A secret used to access a private dependency may leak through build logs, cache exports, or image layers even if it is not present in the final filesystem. Review the builder, cache, logs, and artifact storage as well as the final image.

Exceptions need owners and expiry dates. An accepted vulnerability should identify the affected image, reason for acceptance, compensating controls, responsible owner, target remediation date, and conditions that trigger earlier review. An exception without an end point tends to become the default policy.

Small images are not automatically safe. Size reduction helps limit components, but security still depends on patching, identity, permissions, provenance, and runtime configuration. Validate functionality after removing shells or diagnostic tools so teams do not restore unnecessary packages during an incident.

For the delivery side of these controls, the CI/CD Pipeline Debugging Checklist can help separate a failed security gate from a failed build or deployment handoff. For GitOps environments, review how image digests, secrets references, and promotion approvals are represented in the repository using the GitOps Repository Structure Guide.

Common mistakes

  • Scanning only on a schedule. Add checks to the image build and promotion path so a known-bad image is not released between scheduled scans.
  • Blocking on every finding without triage. An indiscriminate gate creates noise and encourages bypasses. Define thresholds, ownership, and a documented exception process.
  • Copying the entire repository into the image. This can include credentials, test fixtures, source maps, private configuration, and development tools. Copy only the artifacts required at runtime.
  • Using a root user because the application initially fails otherwise. Fix ownership, ports, or filesystem paths instead of treating root as a permanent workaround.
  • Assuming a clean scan proves provenance. A scanner can report package findings without proving that the source, builder, or image publisher is trusted. Keep inventory, provenance, and access controls as separate checks.
  • Leaving stale images and credentials in the registry. Define retention and deletion rules, protect release images from accidental replacement, and remove obsolete artifacts according to operational and audit requirements.

When to revisit

Run the checklist before every production release or image promotion, after a base-image rebuild, and whenever application dependencies change. Revisit it immediately after a vulnerability disclosure affecting your operating system or language ecosystem, a suspected secret leak, a registry or build-system change, or a change to runtime privileges and network access.

Use planned reviews before seasonal planning cycles, platform upgrades, and audit preparation. Confirm that scanner rules, severity mappings, signing or attestation verification, registry permissions, and retention behavior still match your workflow. Review exception records at the same cadence; close entries that no longer apply and renew only those with a current owner and rationale.

A practical release gate can be short: identify the immutable image, confirm the scan and SBOM match it, check for secrets, verify provenance and required signatures, review open exceptions, and confirm the runtime security context. If any step fails, pause promotion or document the decision with an owner and follow-up date. This keeps container image security connected to everyday delivery rather than treating it as a one-time compliance exercise.

Related Topics

#containers#docker#devsecops#image-security#software-supply-chain
O

Oracles Cloud Editorial Team

DevOps and Cloud Infrastructure Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.