Container image security scanning helps development and operations teams find vulnerable packages, document what an image contains, and decide whether a build is safe to release. This guide explains a repeatable workflow for Docker image vulnerability scanning, software bills of materials (SBOMs), severity triage, remediation, and risk exceptions. Use it as a working checklist whenever images are built, promoted, or reassessed after a new vulnerability disclosure.
Overview
A container image is assembled from application code, operating-system packages, language libraries, build tools, and metadata. Each component can introduce security or maintenance risk. Scanning an image provides a point-in-time assessment of known vulnerabilities, but the result is not a complete security verdict. Scanner coverage, package identification, configuration, runtime exposure, and the availability of an exploit can all affect the decision.
A useful program combines four activities:
- Image scanning: identify packages and match them against vulnerability databases.
- SBOM generation: record the components and versions present in the image.
- Risk triage: prioritize findings using severity, exploitability, exposure, and business impact.
- Remediation tracking: rebuild, upgrade, replace, mitigate, or formally accept the remaining risk.
Scanning should occur before an image reaches a production registry and again when it is promoted or redeployed. A previously clean image can acquire new findings when vulnerability databases are updated, even if its digest has not changed.
What to track
Image identity and provenance
Record the image repository, immutable digest, source commit, Dockerfile or build configuration, base image, target architecture, build date, and deployment environments. A tag such as latest is not enough for reliable investigation because tags can move. Pair every scan with the digest under review. For deployment verification, see Container Image Tags, Digests, and Immutability.
Vulnerability findings
For each finding, retain the vulnerability identifier when available, affected package, installed version, fixed version if known, severity rating, scanner database timestamp, and the image layer or operating-system distribution involved. Also capture whether the vulnerable component is in the final runtime image or only in a discarded build stage.
Do not treat severity as a release decision by itself. A high-severity issue in an unreachable development utility may warrant a different response from a moderate issue in an internet-facing request parser. Record the service, endpoint, privilege level, network exposure, and data handled by the affected workload.
SBOM format and contents
An SBOM is an inventory, not a pass or fail result. Common machine-readable formats include SPDX and CycloneDX. Either can support inventory, vulnerability correlation, audit evidence, and incident response when generated consistently. The important operational choices are format version, package identifiers, supplier information, license data where required, relationship data, image digest, and generation timestamp.
Store the SBOM with the build record or attach it to the registry artifact. Keep enough history to compare one release with another. An SBOM that cannot be tied to an immutable image digest is difficult to use during an incident.
Scanner capabilities
| Capability | Why it matters | Questions to ask |
|---|---|---|
| Registry scanning | Finds issues in stored images, including images not currently in CI. | Does it rescan when database data changes? Can it scan private repositories? |
| CI scanning | Stops or warns on findings before promotion. | Can policies differ by branch, environment, or image type? |
| SBOM generation | Provides a component inventory for later investigation. | Which SPDX or CycloneDX versions are supported? |
| Reachability or exploit context | Provides additional information for prioritization. | Is the result evidence, a heuristic, or a user-configured signal? |
| Remediation workflow | Connects findings to owners and exceptions. | Can findings be assigned, tracked, suppressed, and audited? |
Release-gate checklist
- Confirm the scan covers the final image, not only the build environment.
- Verify the image digest and target architecture.
- Generate and retain an SBOM.
- Review critical and high findings for actual runtime exposure.
- Check for an available fixed version and test the upgrade.
- Document compensating controls or an approved exception when immediate repair is not practical.
- Ensure the resulting image is signed or otherwise linked to an auditable build record according to organizational policy.
Cadence and checkpoints
Use several checkpoints rather than relying on a single scan. Run a scan during every build or pull request that changes the Dockerfile, application dependencies, or base image. Scan again when an image is pushed to a registry, and rescan stored images on a scheduled basis because vulnerability data changes over time.
A monthly review is a practical minimum for many teams, while internet-facing or high-impact services may need more frequent review. At each cycle, compare:
- new findings since the previous scan;
- findings that gained a fixed version;
- findings whose severity or exploit context changed;
- images that are still deployed despite reaching end of support;
- exceptions approaching their expiry date; and
- base images that have received security or maintenance updates.
In CI, establish separate thresholds for development, staging, and production if the risk model requires it. A warning can provide visibility for a development branch, while production promotion may require no unresolved findings above a defined severity unless an approved exception exists. Keep those thresholds explicit and version-controlled.
How to interpret changes
A change in the scan report does not always mean that the application changed. It may reflect a newly added vulnerability record, improved package detection, a changed severity assessment, or a rebuilt base image. Compare the image digest, scanner version, vulnerability-database timestamp, and SBOM before concluding that a new package entered the release.
Prioritize a finding by combining these questions:
- Is the component present in the shipped image? Build-only dependencies may not remain in the runtime stage.
- Is the vulnerable code reachable? Package presence alone does not prove that vulnerable functionality is used, but do not dismiss a finding without evidence.
- Can an attacker reach the workload? Consider public exposure, network boundaries, authentication, and required privileges.
- What is the impact? Evaluate confidentiality, integrity, availability, and the importance of the data or service.
- Is a supported fix available? Prefer upgrading the package or rebuilding from a maintained base image over suppressing the result.
When a fix is unavailable, consider reducing exposure, disabling the affected feature, limiting permissions, applying network controls, or replacing the dependency. These measures reduce risk but do not remove the vulnerable component. Track them as temporary controls with an owner and review date.
Exception template
Use a consistent record for accepted risk:
- Image and digest: identify the exact artifact.
- Finding: include the package, vulnerability identifier, severity, and evidence.
- Business justification: explain why release or continued operation is necessary.
- Exposure assessment: describe reachability, privileges, network access, and affected data.
- Compensating controls: list controls that are deployed and verified.
- Owner: name the team accountable for remediation.
- Expiry and review date: set a finite deadline rather than an indefinite suppression.
- Exit condition: define the fixed version, replacement, or architecture change that closes the exception.
Practical CI and registry workflow
- Build the image from a pinned or otherwise controlled base-image reference.
- Scan the final image and generate an SPDX or CycloneDX SBOM.
- Apply policy thresholds using severity and contextual signals.
- Fail or pause promotion when the policy requires remediation or an approved exception.
- Push the image, SBOM, scan result, and build metadata to the registry or associated artifact store.
- Rescan retained images on a schedule and notify the owning team when a new finding appears.
- Rebuild after package or base-image updates, then verify the new digest and deployment behavior.
Keep image security work connected to operational controls. Health checks, logging, storage, and runtime configuration can affect how a vulnerability is detected, contained, and investigated. Relevant background is available in Container Health Checks Explained and Container Log Management.
When to revisit
Revisit this process whenever a new vulnerability affects a base image, operating-system distribution, language ecosystem, or widely used library. Also review it monthly or quarterly according to service risk, after a scanner or vulnerability database change, and before a security audit or major release.
At the next review, confirm that scanner coverage still matches the images your teams build, SBOMs remain tied to immutable digests, policy thresholds reflect current risk, and exception records have owners and expiry dates. Check whether build-stage packages are being mistaken for runtime packages and whether old images remain deployable in registries or clusters.
For a practical action plan, select one representative production image this week. Record its digest, run a fresh scan, generate an SBOM, classify the top findings using exposure and exploitability, and assign remediation owners. Repeat the exercise after the next base-image update. Over time, this recurring checkpoint turns container vulnerability management from a one-time gate into a traceable release and operations practice.