Image scanning and promotion
Scan the exact artifact
An image scan compares supported software components with known vulnerability information. ECR basic scanning covers supported operating-system packages; enhanced scanning integrates Amazon Inspector and adds supported programming-language packages and options for ongoing assessment. Coverage depends on platform, configuration and eligibility. A report with no findings is not a proof of safety: it cannot establish that application authorization, embedded secrets or runtime configuration are secure.
Build once, promote by digest
Consider an application built in CI. Store the artifact in a private candidate repository, capture its registry digest, run tests, review scan coverage and provenance, and approve the precise digest. Copy the artifact into a release repository when approved, then check the destination digest and required platform manifests. Deploy by verified destination digest. Do not rebuild from source merely to promote an image: a new build can change dependencies or metadata. Retain the prior approved digest for rollback.
A fictional release gate
Our fictional team requires a completed and current scan for the expected digest, zero unresolved critical findings, passing tests and approved provenance. This is a team policy, not an ECR default. Candidate A passes all checks; candidate B has one critical finding and is held for remediation. Candidate C has no report and is also held. A missing result is unknown, not zero findings. Exceptions in real systems require an owner, documented risk and expiration.
Handle new findings after release
New advisories can affect a previously approved artifact. Monitor findings, assess reachability and business impact, update the affected dependency or base image, build a new artifact, retest and promote it. Avoid changing the approved digest in place. A rollback is safe only when the earlier artifact is available and its known risk is acceptable. Keep scan evidence and deployment records linked by digest.
Practice: reject a mismatched report
The pipeline expects A but receives a clean report for B. Reject the promotion even if all other checks are green. In the offline lab compare report identity, freshness, completion and approval independently. For a real pipeline retrieve current findings using the supported API; basic scanning results should be retrieved with DescribeImageScanFindings rather than relying on legacy DescribeImages summary fields. Do not publish any image in this exercise.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Image scanning and promotion — knowledge check
Apply the lesson to offline container distribution scenarios.
A report is clean but refers to B; the candidate is A. What should the gate do?
What does enhanced scanning add to basic scanning?
The report is missing. How should the fictional gate classify it?
Why avoid rebuilding merely to promote?
An advisory affects the released digest. What is a sound response?