Container image security is most effective when it is a repeatable delivery workflow rather than a one-time scan. This guide provides a practical checklist for generating SBOMs, scanning images, prioritizing findings, signing approved artifacts, enforcing admission checks, managing exceptions, and rebuilding production images when inputs change.
Overview
A container image can include application code, operating-system packages, language dependencies, build tools, configuration files, and metadata. Each layer may introduce vulnerabilities or unwanted components. A scanner can identify known issues, but a useful security process must also answer four operational questions: how serious is the finding, can the issue be exploited, is the image exposed in the runtime environment, and what action should happen next?
The goal is not to block every image on every finding. That approach can create noisy pipelines and encourage teams to bypass controls. The goal is to establish a documented decision path: produce evidence about the image, evaluate risk in context, remediate what can be fixed, prevent unapproved artifacts from reaching sensitive environments, and record exceptions with owners and expiry dates.
A typical secure container build pipeline contains these stages:
- Build from a declared and reviewable source.
- Generate an SBOM for the image and retain it with build metadata.
- Scan the image and its dependencies using a selected vulnerability data source.
- Prioritize findings using severity, exploitability, runtime exposure, and fix availability.
- Run tests and policy checks before publication.
- Sign the approved image and attach provenance or related attestations where supported.
- Deploy by immutable digest rather than an unattended mutable tag.
- Use a registry or cluster admission control to reject images that fail defined requirements.
- Rebuild and re-evaluate images when base images, dependencies, or vulnerability data change.
Checklist by scenario
When building a new image
- Choose a maintained base image appropriate for the workload. Keep the base image choice, version, and digest visible in source control or build configuration.
- Use a minimal runtime image where practical, but do not remove files required for debugging, certificate validation, user permissions, or application operation without testing.
- Separate build-time tools from runtime contents with a multi-stage build when the application permits it.
- Run the process as a non-root user unless a documented requirement makes that impractical.
- Prevent secrets from entering image layers, build arguments, logs, or cached build output.
- Pin important inputs sufficiently to make builds reproducible, while maintaining a planned process for updating those inputs.
- Generate an SBOM that identifies packages and versions. Store it with the image digest and build record rather than associating it only with a mutable tag.
- Scan before pushing to a release repository, and fail the build only on policy conditions that the team has agreed to maintain.
When a scanner reports vulnerabilities
- Confirm that the finding belongs to the image currently being assessed and identify the affected layer or package.
- Check whether a fixed version is available and whether updating it changes application behavior.
- Distinguish a vulnerability in an installed package from one in an unused build tool or an unreachable application path.
- Assess runtime exposure: internet-facing services, privileged workloads, host mounts, sensitive data access, and network reachability can increase practical risk.
- Record the affected image digest, scanner result, data-source timestamp or version when available, and the proposed action.
- Prefer rebuilding from an updated base image or dependency set over manually modifying a running container.
- Retest the rebuilt image, rescan it, and compare the new SBOM with the previous one.
When publishing or deploying an image
- Push only artifacts that passed the required build, test, SBOM, and scan checks.
- Sign the image after the final build and before release. Ensure the signing identity is controlled by the build or release system, not an individual developer account.
- Store the signature and related metadata where the deployment environment can verify them.
- Configure deployment policy to require a trusted signature, an approved registry, an acceptable scan result, and a digest reference where possible.
- Test admission rules in an audit or warning mode before enforcing them across production, especially when existing workloads have mixed provenance.
- Document the response when verification fails: stop deployment, identify the failed predicate, and provide a supported remediation path.
When an exception is necessary
- Describe the exact image digest, package, vulnerability identifier if supplied by the scanner, affected service, and reason the normal fix cannot yet be applied.
- Assign a responsible owner and a review date. Avoid indefinite exceptions.
- Define compensating controls such as restricted network access, reduced privileges, disabled functionality, increased monitoring, or deployment to a lower-risk environment.
- Set an explicit expiration condition and notify the owner before it arrives.
- Reassess the exception whenever a fixed package, replacement base image, or material runtime change becomes available.
How to prioritize findings
Severity is a useful starting point, not a complete remediation order. Use a simple decision table to make the reasoning visible:
| Severity or condition | Exploitability | Runtime exposure | Suggested priority |
|---|---|---|---|
| High or critical impact | Known or plausible path; exploit conditions are present | Internet-facing, privileged, or connected to sensitive systems | Immediate investigation and accelerated rebuild or mitigation |
| High impact | Exploitability is uncertain or requires specific conditions | Reachable service, but controls limit access | Schedule remediation quickly; validate exposure and compensating controls |
| Moderate impact | Requires unusual configuration or local access | Internal or isolated workload | Include in normal dependency or base-image update work |
| Low impact or not reachable | No practical path identified in the current deployment | Unused package, build-only layer, or isolated component | Track, remove where practical, and avoid allowing the finding list to grow unchecked |
This table is a decision aid, not a universal policy. Your team should define what “immediate,” “quickly,” and “normal work” mean for each environment. Also separate vulnerable code from vulnerable configuration. A package may be fixed in a new release, while a dangerous capability may require changing the image, Kubernetes manifest, runtime permissions, or network policy.
What to double-check
SBOM quality
Verify that the SBOM is generated from the final image, not only from a lockfile or source directory. Confirm that package names, versions, operating-system components, and application dependencies are represented as accurately as the chosen format and tool allow. Retain the association between the SBOM, image digest, source revision, and build identifier.
Signing and provenance
Signing proves that an approved identity signed a particular artifact; it does not prove that the artifact is secure by itself. Verify the signer, the image digest, the build context, and the policy that determines which identities are trusted. Keep signing keys or signing credentials out of developer workstations when a controlled build environment can perform the operation.
Registry hygiene
Use separate controls for development, staging, and production repositories where appropriate. Define retention rules for untagged images, failed builds, superseded releases, signatures, and SBOMs. Retain enough history to support rollback and incident investigation, but remove artifacts that no longer need to be available. Before changing retention rules, confirm that deployment systems do not depend on tags that are scheduled for deletion.
Admission policy behavior
Test denied deployments deliberately. Check whether the policy validates signatures, image digests, registry location, SBOM presence, vulnerability thresholds, and exception records as intended. Confirm that policy failures are observable and that operators can identify the exact reason for rejection without searching through several unrelated systems.
Common mistakes
- Scanning only at build time: Vulnerability databases and runtime conditions change after publication. Rescan retained production images on a defined schedule and after important advisory or base-image changes.
- Treating every scanner result as equally urgent: A long list without context encourages alert fatigue. Rank findings using impact, exploitability, exposure, fix availability, and business importance.
- Using tags as the security boundary: Tags can be moved or reused. Deploy and verify immutable digests, then make the selected tag a human-readable convenience rather than the sole identity.
- Signing too early: If the image changes after signing, the signature no longer represents the deployed artifact. Sign the final image and verify the digest during release.
- Allowing permanent exceptions: An exception without an owner or expiry becomes an undocumented policy bypass. Require review dates and compensating controls.
- Ignoring build layers: Deleted secrets or files may remain in earlier layers. Keep sensitive material out of the build context and inspect the final image and its layer history.
- Blocking production without a recovery path: A failed admission check should explain what to fix, how to request a time-limited exception, and how to validate the replacement image.
When to revisit
Revisit this workflow before seasonal planning cycles, after a major base-image migration, when the CI/CD provider or registry changes, and whenever the organization changes its signing, provenance, or admission tooling. Review it immediately after a significant vulnerability affects a package used by your images, even if the scanner has not yet produced a complete result.
Schedule a recurring review of the following inputs:
- Base-image versions, digests, and support assumptions.
- Application and operating-system dependency update queues.
- Scanner configuration, vulnerability data behavior, ignore rules, and severity mappings.
- SBOM generation coverage and retention.
- Signing identities, key access, verification rules, and provenance records.
- Registry retention and promotion controls.
- Admission policies, exception records, and expired waivers.
- Production images that have not been rebuilt since their base or dependency inputs changed.
For a practical release check, start with the image digest and build record, confirm that the SBOM belongs to that exact artifact, review scan findings using the prioritization table, verify the signature, and test the deployment policy in the target environment. If the image fails, rebuild from updated inputs rather than patching a running container. After deployment, record the result and close or renew any exception deliberately. This turns container image security scanning from a report-producing step into a maintainable DevSecOps workflow.