ECR Image Scanning: Basic vs Enhanced, Why Nothing Is Scanned by Default, SCAN_ELIGIBILITY_EXPIRED and the New 7-Day Window, Reading Findings and What Inspector Costs
Amazon ECR image scanning comes in two kinds. Basic scanning is built into ECR, checks operating system packages only, and runs on push or when you start it by hand, at most once per image every 24 hours. Enhanced scanning is Amazon Inspector: it checks operating system and programming language packages (Python, Java, Node.js, Go and more), re-scans automatically when new vulnerabilities are published, and costs $0.09 per image scanned on push plus $0.01 per automatic re-scan in US East (N. Virginia), October 2026. The surprise in most accounts is that basic scanning is already "on" but every repository is set to Manual, so nothing has ever been scanned. The surprise for anyone turning on enhanced scanning this month is newer still: for accounts that activate ECR scanning on or after October 15, 2026, Inspector picks up only images pushed in the last 7 days and keeps re-scanning them for 7 days unless a cluster is still running them; everything older shows SCAN_ELIGIBILITY_EXPIRED until you push it again or lengthen the window. This page covers choosing a scan type, turning on scan on push, the expired status, reading findings, the errors, the real cost, alerts, CI gates and Terraform.
Jake's shop sells repair bookings to a chain of phone stores, and the chain's new supplier questionnaire had one line he could not answer: "Are your container images scanned for vulnerabilities?" His developer friend Ethan opened the ECR console, saw "Basic scanning" at the top of the scanning settings, and nearly wrote "yes". Then he opened the shop's booking image and found no findings at all, not even an empty report. "So we scan," Jake said. "We are allowed to scan," Ethan said. "Nobody ever pressed the button." This page is how Ethan got from there to a real answer for the questionnaire, and the 7-day surprise he hit on the way.
New to Amazon ECR? It is AWS's private registry for container images, the shelf your ECS tasks, EKS pods and Lambda container functions pull from. Scanning settings belong to the private registry (one per account per Region), and scan results belong to each image.
Basic vs enhanced scanning: what each one actually does
| Basic scanning (ECR) | Enhanced scanning (Amazon Inspector) | |
|---|---|---|
| What it checks | Operating system packages only | OS packages and programming language packages (Python, Java, Ruby, Node.js and more), plus extra detection for things like the Go toolchain, Oracle JDK, Corretto, Tomcat, Apache httpd and WordPress |
| When it scans | Scan on push, or manual | Scan on push, or continuous (re-scans when a new relevant CVE appears); no manual scans |
| Scratch, distroless, Chainguard images | Not supported | Supported |
| Extra intelligence | Basic CVE details, CVSS v2/v3 | Exploit available, fixed-in version, EPSS score, an Inspector score, end-of-life software findings, which ECS and EKS clusters run the image |
| Where findings appear | ECR console and ECR API | ECR and Inspector consoles and APIs, Security Hub, EventBridge |
| Cost | No separate scan charge | $0.09 per initial scan, $0.01 per re-scan (us-east-1) |
| Limits | One scan per image per 24 hours; 100,000 images per 24 hours per Region | Push-date and re-scan windows (7 days by default for new activations) |
Basic scanning draws on more than 50 data feeds (vendor security advisories, threat intelligence, the National Vulnerability Database and MITRE) and uses the severity from the Linux distribution when there is one, otherwise the CVSS score. So the choice is less "free vs paid" than "operating system only vs everything you installed". If your images are mostly a base image plus your own code, basic catches the OS side. If your image carries a requirements.txt, a package.json or a JAR full of dependencies, those are invisible to basic scanning, and that is where most real vulnerabilities in application images live.
One rule decides how you switch: the scan type is a registry-wide setting per Region. You cannot run basic on one repository and enhanced on another in the same Region. When you switch types, the scans set up under the old type are no longer shown; if you switch back, they return.
What is on by default, and why most repositories were never scanned
ECR turns on basic scanning for every private registry by default, so the scanning settings page says "Basic scanning" before you have touched anything. But in that default state every repository is set to Manual. No image is scanned until someone starts a scan by hand or adds a scan on push filter. That is how an account can show "Basic scanning" at the top and zero findings on every image, which is exactly what Ethan found.
There is a second way to end up with no scans: an older repository-level switch. Repositories created with the "Scan on push" checkbox (the imageScanningConfiguration setting, or scan_on_push in Terraform) used a per-repository API, PutImageScanningConfiguration, which is being deprecated in favor of the registry-level configuration. If your scripts still set it and your registry rules say otherwise, the registry rules are what you should check and change.
You can check your own setup in under a minute. Run aws ecr get-registry-scanning-configuration in each Region you use. If the answer shows "scanType": "BASIC" with an empty rules list, every repository is on Manual and nothing is scanned automatically. If it shows rules, compare each rule's repositoryFilters with your repository names using the wildcard table further down; a repository whose name matches no filter is the one your questionnaire answer is wrong about. Then open one important image and look for a scan status. No status at all means it has never been scanned, whatever the settings page says.
Security Hub notices this too. The control [ECR.1] ECR private repositories should have image scanning configured (severity High) fails for any private repository not set for scan on push or continuous scanning, and [Inspector.2] Amazon Inspector ECR scanning should be enabled (also High) fails when Inspector's ECR scanning is off for the account. If your Security Hub score dropped because of either, the next two sections are the fix; our Security Hub guide explains why a control can stay failed for a while after you fix it.
Turn on scan on push for basic scanning
- Open the Amazon ECR console and choose the Region from the navigation bar.
- In the navigation pane, choose Private registry, then the scanning settings (Settings or Scanning, depending on the console version), which open the Scanning configuration page.
- For Scan type, keep Basic scanning.
- Under Scan on push filters, either choose to scan all repositories on push, or add a filter that matches the repository names you want (see the wildcard table below).
- Choose Save, then push an image (or push the same tag again) and open it in the repository; a scan status appears within a few minutes.
The same with the AWS CLI, for all repositories in the Region:
aws ecr put-registry-scanning-configuration \
--scan-type BASIC \
--rules '[{"scanFrequency":"SCAN_ON_PUSH","repositoryFilters":[{"filter":"*","filterType":"WILDCARD"}]}]' \
--region us-east-1
aws ecr get-registry-scanning-configuration --region us-east-1
Repositories that match no scan on push filter stay on Manual. Scan on push also covers images restored from the archive storage class: when an archived image is restored in a repository with scan on push, it is scanned again (old results from before the archive are not kept).
Turn on enhanced scanning with Amazon Inspector
Enhanced scanning is the same settings page with a different choice. Before you start, check two things. First, the identity you use needs Inspector permissions; this policy covers turning it on and reading results:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["inspector2:Enable", "inspector2:Disable", "inspector2:ListFindings",
"inspector2:ListAccountPermissions", "inspector2:ListCoverage"],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "*",
"Condition": {"StringEquals": {"iam:AWSServiceName": ["inspector2.amazonaws.com"]}}
}
]
}
Second, if your registry has a registry policy, make sure it does not deny ecr:* or ecr:PutRegistryScanningConfiguration; a deny there breaks turning scanning on and off at the registry level. Inspector creates its own service-linked role the first time.
- In the ECR console, choose Private registry, Settings, and for Scan type choose Enhanced scanning.
- By default every repository is set for continuous scanning. To limit it, clear Continuously scan all repositories and add filters for the repositories that should be scanned continuously.
- Choose which repositories get scan on push only (all, or a filter).
- Choose Save. Repeat in each Region.
Or with the CLI: continuous scanning for repositories with "prod" in the name, scan on push for everything else:
aws ecr put-registry-scanning-configuration \
--scan-type ENHANCED \
--rules '[
{"repositoryFilters":[{"filter":"prod","filterType":"WILDCARD"}],"scanFrequency":"CONTINUOUS_SCAN"},
{"repositoryFilters":[{"filter":"*","filterType":"WILDCARD"}],"scanFrequency":"SCAN_ON_PUSH"}
]' \
--region us-east-1
Three rules about enhanced filters catch people out. Repositories that match no filter are Off, not Manual: they are not scanned at all. When a repository matches both a continuous filter and a scan on push filter, continuous wins. And there are no manual scans under enhanced scanning, so the "Scan" button and start-image-scan stop being an option.
Filters match more than you might expect. A filter with no wildcard matches every repository name that contains it; a * stands for zero or more characters:
| Filter | prod | repo-prod | prod-repo | repo-prod-repo | prodrepo |
|---|---|---|---|---|---|
prod | Yes | Yes | Yes | Yes | Yes |
*prod | Yes | Yes | No | No | No |
prod* | Yes | No | Yes | No | Yes |
*prod* | Yes | Yes | Yes | Yes | Yes |
prod*repo | No | No | Yes | No | Yes |
So a filter of prod meant for production also catches preprod-tools and product-images. If you mean "starts with", write prod*.
SCAN_ELIGIBILITY_EXPIRED and the new 7-day windows
This is the part that changed a week ago. Inspector does not watch your images forever. It uses two windows: an image push date duration (how far back it picks up images, and how long after a push it keeps watching) and an image re-scan duration (how long after the last time the image was in use, or pulled, it keeps re-scanning). The defaults depend on when your account first activated ECR scanning in Inspector:
| ECR scanning activated | Push date duration | Re-scan duration | Re-scan based on |
|---|---|---|---|
| On or after October 15, 2026 | 7 days | 7 days | Last in use date |
| May 16, 2024 to October 14, 2026 | 14 days | 14 days | Last in use date |
| Before May 16, 2024 | 90 days | 90 days | Last pull date |
In practice, for a new account: when you first turn on enhanced scanning, Inspector only detects images pushed within the last 7 days. Those are scanned and set to ACTIVE. Everything older gets the status SCAN_ELIGIBILITY_EXPIRED and is never scanned. And an image you pushed today stays under continuous watch only while it was pushed within 7 days, was last in use on an ECS or EKS cluster within 7 days, or was scanned within the re-scan window. A base image you built once and keep in a repository for months drops out after a week unless something keeps running it. When an image's window runs out, its findings are scheduled to close and the ECR console shows SCAN_ELIGIBILITY_EXPIRED.
That is what Ethan hit. He turned on enhanced scanning on October 20, and Jake's booking image, last pushed in early September, came back SCAN_ELIGIBILITY_EXPIRED, which looked like a broken scanner. "It is not broken," Ethan said. "It is choosing not to look at anything older than a week."
You have two fixes, and most teams use both:
- Push the image again. Re-tagging and pushing (or simply rebuilding and pushing, which you should do anyway to pick up patched base layers) gives it a fresh push date, so Inspector scans it.
- Lengthen the windows. In the Inspector console, under the account's ECR re-scan duration settings, raise the push date duration and the re-scan duration. The allowed push date values are 3, 7, 14, 30, 60, 90 or 180 days, or Lifetime; the re-scan (pull or last-in-use date) values are 3, 7, 14, 30, 60, 90 or 180 days. With the CLI:
aws inspector2 update-configuration \
--ecr-configuration rescanDuration=DAYS_30,pullDateRescanDuration=DAYS_30,pullDateRescanMode=LAST_IN_USE_AT
aws inspector2 get-configuration
Longer windows mean more automatic re-scans, and each costs $0.01, so pick the window that matches how long an image really stays in service. Lifetime on a registry with thousands of old images can add up; a lifecycle policy that deletes images nobody runs any more keeps it sane (our lifecycle policy guide covers rules that actually delete).
Archived images follow their own rule: Inspector scans only images whose status is ACTIVE. When an image moves to the archive, Inspector closes its findings and deletes them 3 days later; when you restore it, Inspector scans it again.
Reading the scan results
In the console, open the repository, then the image tag; the vulnerabilities list shows each CVE with its severity, package and (for enhanced) the fixed-in version. From the command line, the call is describe-image-scan-findings, by tag or by digest:
aws ecr describe-image-scan-findings \
--repository-name booking-api --image-id imageTag=v42 \
--query "imageScanFindings.findingSeverityCounts"
# status of the scan itself: PENDING, IN_PROGRESS, COMPLETE, FAILED, UNSUPPORTED_IMAGE, ACTIVE,
# SCAN_ELIGIBILITY_EXPIRED, FINDINGS_UNAVAILABLE, LIMIT_EXCEEDED or IMAGE_ARCHIVED
aws ecr describe-image-scan-findings \
--repository-name booking-api --image-id imageTag=v42 \
--query "imageScanStatus"
One change trips up older scripts: the current version of basic scanning no longer fills the imageScanFindingsSummary and imageScanStatus fields in the describe-images response. A script that reads severity counts from describe-images now sees nothing and happily reports "no vulnerabilities". Switch it to describe-image-scan-findings, which also paginates with --max-results and nextToken when an image has many findings.
For enhanced scanning you can also query Inspector directly, which is handy across many repositories. Inspector's filters include ecrImageRepositoryName, ecrImageTags, ecrImageHash, ecrImagePushedAt, ecrImageInUseCount and ecrImageLastInUseAt:
aws inspector2 list-findings \
--filter-criteria '{"ecrImageRepositoryName":[{"comparison":"EQUALS","value":"booking-api"}],
"severity":[{"comparison":"EQUALS","value":"CRITICAL"}]}' \
--query "findings[].[title,severity,fixAvailable]" --output table
How to read what comes back:
- Severity comes from the distribution's own rating when there is one, otherwise from CVSS. A severity of
UNDEFINEDmeans the source gave no priority, or one ECR does not recognize; look the CVE up at its source before you ignore it. - Fix available (enhanced) tells you whether a patched package version exists. "No" means waiting or replacing the package, not rebuilding.
- Exploit available and the EPSS score (enhanced) show how likely the CVE is to be used in the wild; they are the best way to decide what to fix first.
- In use (enhanced, continuous scanning): how many ECS tasks and EKS pods run the image and when it was last used, refreshed every 24 hours (up to 36 hours for a new image). Seeing it needs both the
AWSReadOnlyAccessandAWSInspector2ReadOnlyAccessmanaged policies;AWSReadOnlyAccessalone is not enough.
Check which images Inspector is actually covering
The fastest way to find images that are silently not scanned is Inspector's coverage list. It shows every ECR image and repository Inspector knows about, with a status of ACTIVE or INACTIVE and a reason code. This lists the inactive images and why:
aws inspector2 list-coverage \
--filter-criteria '{"resourceType":[{"comparison":"EQUALS","value":"AWS_ECR_CONTAINER_IMAGE"}],
"scanStatusCode":[{"comparison":"EQUALS","value":"INACTIVE"}]}' \
--query "coveredResources[].[resourceId,scanStatus.reason]" \
--output table
The reason codes you will see most for ECR, and what to do about each:
| Reason | Meaning | Action |
|---|---|---|
PENDING_INITIAL_SCAN | Queued, not scanned yet | Wait a few minutes |
SCAN_FREQUENCY_MANUAL | The repository is set to Manual | Add a scan filter in ECR |
SCAN_FREQUENCY_SCAN_ON_PUSH | Scanned once at push; no continuous re-scans | Move it to a continuous filter if it runs in production |
SCAN_ELIGIBILITY_EXPIRED | Outside the push or re-scan window | Push again or lengthen the window |
UNSUPPORTED_OS | The base operating system is not supported | Move to a supported base |
UNSUPPORTED_MEDIA_TYPE, UNSUPPORTED_CONFIG_FILE | The manifest or config format is not one Inspector reads | Push a standard Docker v2 or OCI image |
IMAGE_SIZE_EXCEEDED | The image is larger than Inspector will scan | Slim the image (multi-stage build) |
IMAGE_ARCHIVED | The image is in the archive | Restore it to scan |
ACCESS_DENIED | Inspector cannot read the image | Check the registry and repository policies for denies |
Inspector shows these settings but cannot change them: the choice between scan on push and continuous scanning is made only in ECR. When the coverage list says SCAN_FREQUENCY_MANUAL, the fix is in the ECR scanning configuration, not in Inspector.
Severity, the Inspector score, CVSS and EPSS, in plain words
A findings list with 200 entries is useless until you know which ten matter. Four numbers help, and they answer different questions:
- CVSS (Common Vulnerability Scoring System) rates how bad a vulnerability is in general, from 0 to 10, from the National Vulnerability Database or the vendor. Both scan types show it.
- Inspector score (enhanced only) starts from CVSS and adjusts it for your situation. Its bands map to severities: 0 is Informational, 0.2 to 3.9 Low, 4.0 to 6.9 Medium, 7.0 to 8.9 High, and 9.0 to 10.0 Critical.
- EPSS (Exploit Prediction Scoring System, enhanced only) estimates how likely the vulnerability is to be exploited soon. A "critical" CVE with a tiny EPSS can wait behind a "high" one that attackers are actively using.
- Exploit available (enhanced only) is a yes or no: is there known exploit code? Treat yes as urgent.
A sensible order for a small team: critical or high with an exploit available on an image in use, then critical or high with a fix available, then everything else at the next scheduled rebuild. That is the order Ethan set up for Jake, and it turned a 140-line report into four tickets.
Suppressing accepted findings and exporting reports
Some findings you will decide to accept: a CVE in a package your code never calls, or one with no fix that you have mitigated another way. Rather than ignoring the list, create a suppression rule in Inspector so those findings stop appearing in the default views (they are hidden, not deleted, and the rule records why):
aws inspector2 create-filter \
--name accept-cve-in-build-tools \
--action SUPPRESS \
--reason "Package only present in the build stage" \
--filter-criteria '{"ecrImageRepositoryName":[{"comparison":"EQUALS","value":"build-tools"}],
"vulnerabilityId":[{"comparison":"EQUALS","value":"CVE-2026-00000"}]}'
Replace the CVE ID with the real one. Keep suppression rules narrow (one CVE, one repository) and review them when you rebuild; a broad rule is how real problems disappear from view.
For auditors and customer questionnaires like Jake's, two exports help. Findings reports come out as CSV or JSON from the Inspector console or API. And Inspector can export a software bill of materials (SBOM), the full list of packages in your images, in CycloneDX 1.4 or SPDX 2.3 format, to an S3 bucket encrypted with a KMS key you name:
aws inspector2 create-sbom-export \
--report-format SPDX_2_3 \
--resource-filter-criteria '{"ecrRepositoryName":[{"comparison":"EQUALS","value":"booking-api"}]}' \
--s3-destination bucketName=my-sbom-bucket,keyPrefix=booking/,kmsKeyArn=arn:aws:kms:us-east-1:111122223333:key/EXAMPLE
The bucket policy and the KMS key policy must let Inspector write and encrypt; if the export fails, those two policies are the first place to look.
Turning on enhanced scanning across an AWS Organization
With several accounts, turn Inspector on once from the top rather than account by account:
- From the Organizations management account, make a security account the Inspector delegated administrator:
aws inspector2 enable-delegated-admin-account --delegated-admin-account-id 111122223333. - In that delegated administrator account, set new member accounts to get ECR scanning automatically:
aws inspector2 update-organization-configuration --auto-enable ec2=false,ecr=true(addlambda=trueorec2=trueif you want those too). - Activate ECR scanning for the existing accounts:
aws inspector2 enable --resource-types ECR --account-ids 444455556666 777788889999. - Repeat in each Region you use; Inspector, like ECR scanning, is configured per Region.
- In each account's ECR settings, adjust the continuous and scan on push filters; those stay an ECR setting per registry.
Activating ECR scanning in Inspector sets Inspector as the registry's scanning service, the same as choosing "Enhanced scanning" in ECR. The delegated administrator then sees findings, coverage and estimated cost for every member account in one place.
Manual scans and the once-per-24-hours rule
Under basic scanning you can scan any image by hand, from the image's page (select it and choose Scan) or with the CLI:
aws ecr start-image-scan --repository-name booking-api --image-id imageTag=v42
aws ecr wait image-scan-complete --repository-name booking-api --image-id imageTag=v42
Each image can be scanned once per 24 hours, and the scan on push counts. So if scan on push already ran this morning, a manual scan this afternoon fails with LimitExceededException, and the quota cannot be raised. The registry-wide limit is 100,000 basic scans per 24 hours per Region, also fixed. If you need to scan the same code more often, push a new image (a new digest is a new image).
Manual scans do not exist under enhanced scanning. If you need an on-demand scan with enhanced-level detail, for example in a build pipeline before the image is pushed, Inspector's CI/CD scanning does that, priced per image (below).
ECR scan errors and what they mean
| Error or status | What it means | Fix |
|---|---|---|
ScanNotFoundException | The image has never been scanned (repository on Manual, or scan type switched) | Start a scan, or add a scan on push filter and push again |
LimitExceededException on start-image-scan | The image was already scanned in the last 24 hours | Wait, or push a new image |
UnsupportedImageError | Basic scanning does not support the image's operating system, or the image is built FROM scratch | Use a supported base, or switch to enhanced scanning |
UnsupportedImageTypeException | The image is of a type ECR cannot scan | Check what was pushed; for multi-arch tags, look at the per-architecture images |
ImageArchivedException | The image is archived | Restore it first |
SCAN_ELIGIBILITY_EXPIRED | Outside Inspector's push or re-scan window | Push again, or lengthen the windows |
Severity UNDEFINED | The CVE source gave no priority ECR recognizes | Check the CVE at its source |
Basic scanning supports the major versions of Amazon Linux, Amazon Linux 2, Debian, Ubuntu, CentOS, Oracle Linux, Alpine and RHEL. When a distribution loses vendor support, its advisories often stop or are removed from the feeds, so ECR may stop scanning it, and any findings it still produces are informational only. An old base image is a vulnerability in itself; a scanner that goes quiet on it is not good news.
Multi-architecture images deserve a note. A multi-arch tag points to a manifest list (an "index"), and Inspector does not scan the application/vnd.docker.distribution.manifest.list.v2+json media type itself. It scans the individual images the list points to, which show up in the repository as untagged digests. When the tag's page shows no findings, look at those per-architecture images.
What ECR scanning costs
| Item (US East, N. Virginia, October 2026) | Price |
|---|---|
| Basic scanning | No separate charge (part of ECR) |
| Enhanced: initial scan when an image is pushed | $0.09 per image |
| Enhanced: each automatic re-scan (continuous scanning) | $0.01 per re-scan |
| Inspector CI/CD (on-demand) image scan | $0.03 per image |
| Free trial (accounts new to Inspector) | 15 days of ECR, EC2 and Lambda scanning at no cost; 25 free CI/CD image scans, once per account |
A re-scan is triggered only when Inspector adds a new CVE that affects that particular image, so the re-scan count is not a fixed number per day. A worked example, so you can size your own: a team pushes 300 images a month with continuous scanning. The initial scans are 300 × $0.09 = $27. If each image is re-scanned 5 times while it is inside its window, that is 1,500 × $0.01 = $15. About $42 a month. The same team on scan on push only would pay the $27 and never get told when a new CVE lands on an image already running. For Jake's shop, about 40 pushes a month, the bill came to under $5. Our security costs guide puts Inspector next to GuardDuty and Security Hub.
Two settings move the bill the most: how many repositories are on continuous scanning (keep build caches and test repositories on scan on push or Off), and the length of the re-scan windows. The Inspector console shows estimated spend, including across an AWS Organization, so check it after the first week.
Get alerted when a scan finds something
Scan results are only useful if someone sees them. EventBridge receives an event for each one, so you can route them to email, chat or a ticket system. The events differ by scan type:
- Basic scanning: source
aws.ecr, detail-typeECR Image Scan, withscan-status,repository-name,image-digest,image-tagsandfinding-severity-counts(only severities that have findings are present). - Enhanced scanning: source
aws.inspector2, detail-typeInspector2 Scanwhen the initial scan completes (statusINITIAL_SCAN_COMPLETE) andInspector2 Findingwhen a finding is created, updated or closed. ECR also sendsECR Scan Resource Changewhen a repository's scan frequency changes or images are created or deleted.
A rule that fires only for basic scans with at least one critical finding:
{
"source": ["aws.ecr"],
"detail-type": ["ECR Image Scan"],
"detail": {
"scan-status": ["COMPLETE"],
"finding-severity-counts": { "CRITICAL": [{ "numeric": [">", 0] }] }
}
}
Point the rule at an SNS topic with an email subscription and you have the alert. If it never fires, our EventBridge pattern guide walks through testing the pattern against a real event; the usual mistake is matching a severity key that is absent because the count was zero.
Fail a build when an image has critical vulnerabilities
A simple gate for basic scanning in any CI system: push, wait for the scan, read the counts, and stop the pipeline if anything critical shows up. In GitHub Actions, give the job AWS access through OIDC (our OIDC guide covers the trust policy) and run:
REPO=booking-api; TAG=$GITHUB_SHA
docker push "$REGISTRY/$REPO:$TAG"
aws ecr wait image-scan-complete --repository-name "$REPO" --image-id imageTag="$TAG"
CRIT=$(aws ecr describe-image-scan-findings --repository-name "$REPO" --image-id imageTag="$TAG" \
--query "imageScanFindings.findingSeverityCounts.CRITICAL" --output text)
if [ "$CRIT" != "None" ] && [ "$CRIT" -gt 0 ]; then
echo "Image has $CRIT critical vulnerabilities"; exit 1
fi
The None check matters: when there are no critical findings, the key is missing and the CLI prints None, not 0. With enhanced scanning the same idea works through list-findings filtered by the image digest, but the image is already in the registry by the time it is scanned. If you need to block an image before it is pushed, that is what Inspector's CI/CD scanning (the $0.03 scans) is for.
ECR scanning vs open-source scanners like Trivy and Grype
Many teams also run an open-source scanner such as Trivy or Grype in their build. That is not either-or; they answer different questions at different times:
- A pipeline scanner checks the image on the build machine before it reaches the registry, so a bad image never gets pushed. It knows only what it saw at build time.
- ECR scanning checks the image after push, where it lives. With continuous scanning, it tells you when a vulnerability published next month affects an image you pushed today, which a build-time scanner cannot.
For a small team, the simplest setup that covers both is enhanced scanning with continuous filters on production repositories, plus the CI gate above on every push. If you already have a pipeline scanner you trust, basic scanning on push plus that scanner is a reasonable budget option, as long as you rebuild images on a schedule so new CVEs get caught on the next build. What does not work is a pipeline scanner alone on images that are built once and then run for months; nothing ever looks at them again.
Jake asked which one Ethan would keep if he could only have one. "The one that keeps looking after I stop," Ethan said. That is continuous scanning.
Terraform for scanning settings
In Terraform, manage the registry-level setting with aws_ecr_registry_scanning_configuration, one per Region:
resource "aws_ecr_registry_scanning_configuration" "this" {
scan_type = "ENHANCED"
rule {
scan_frequency = "CONTINUOUS_SCAN"
repository_filter {
filter = "prod*"
filter_type = "WILDCARD"
}
}
rule {
scan_frequency = "SCAN_ON_PUSH"
repository_filter {
filter = "*"
filter_type = "WILDCARD"
}
}
}
The older image_scanning_configuration { scan_on_push = true } block on aws_ecr_repository sets the per-repository switch behind the deprecated API. It still works today, but keep one source of truth: if the registry configuration exists, let it decide, and remove the per-repository block so the two cannot disagree. This resource owns the whole registry configuration for that Region, so two Terraform stacks that both declare it will keep overwriting each other.
Fixing what the scan finds
A scan report is a to-do list, and most of it is handled by the same few moves:
- Rebuild on a patched base image. Most OS findings disappear when the base image (
debian,alpine,amazonlinux, a language image) is updated and you rebuild. Rebuild on a schedule, weekly for anything internet-facing, even when your code has not changed. - Update the flagged packages. For language findings, bump the dependency to the fixed-in version enhanced scanning shows, run your tests, and push.
- Remove what you do not need. Build tools, compilers and shells in the final image add findings and attack surface. Multi-stage builds and minimal bases (distroless and similar, which enhanced scanning supports) cut the list sharply.
- Prioritize by exploit and in-use data. A critical CVE with a known exploit in an image running on 40 tasks comes before a high one in an image nothing runs.
- Delete images nobody runs. Old tags keep showing findings and, under continuous scanning with long windows, keep costing re-scans. A lifecycle policy cleans them up.
If your images come from Docker Hub, an ECR pull through cache puts those upstream images in your registry, where the same scanning settings apply to them.
ECR scanning not working? Troubleshooting by symptom
Scan status is empty, or "ScanNotFoundException"
The repository is on Manual (the default) or matches no filter. Add a scan on push filter, or start a scan by hand under basic scanning, then check again in a few minutes.
All old images show SCAN_ELIGIBILITY_EXPIRED after enabling enhanced scanning
They were pushed before Inspector's push date window (7 days for accounts activated from October 15, 2026). Push them again, or raise the push date duration in Inspector.
Images that were scanned stop showing findings after a week
The re-scan window ran out because nothing ran the image. Lengthen the re-scan duration, or accept it for images that are no longer in service.
"Scan" button is gone, or start-image-scan fails
The registry is on enhanced scanning, which has no manual scans. Under basic, a second scan within 24 hours fails with LimitExceededException.
My script says zero vulnerabilities, the console shows many
It reads imageScanFindingsSummary from describe-images, which basic scanning no longer fills. Use describe-image-scan-findings.
Basic scan fails with UnsupportedImageError
The image uses an operating system basic scanning does not support, or it is built from scratch. Switch to enhanced scanning, which covers scratch, distroless and Chainguard images.
A multi-arch tag shows no findings
The tag points to a manifest list, which is not scanned itself. Check the per-architecture images it references.
Enabling enhanced scanning fails with an access error
The caller lacks the inspector2 permissions or iam:CreateServiceLinkedRole for inspector2.amazonaws.com, or a registry policy denies ecr:PutRegistryScanningConfiguration. Fix the policy and try again.
Inspector coverage shows ACCESS_DENIED for an image
Inspector cannot read the image, usually because a registry or repository policy denies it. Remove the deny for Inspector's service-linked role, then push the image again so it is picked up inside the window.
Repositories I did not list are not scanned
Under enhanced scanning, repositories that match no filter are Off. Add a catch-all * scan on push rule after your continuous rules.
ECR image scanning: frequently asked questions
What is the difference between ECR basic and enhanced scanning?
Basic scanning checks operating system packages, on push or manually. Enhanced scanning uses Amazon Inspector to check OS and programming language packages, can re-scan continuously, and adds exploit and fix information.
Is ECR basic scanning free?
There is no separate charge for basic scanning; it is part of ECR. Enhanced scanning is billed by Amazon Inspector, at $0.09 per initial scan and $0.01 per re-scan in US East (N. Virginia), October 2026.
How much does ECR enhanced scanning cost?
$0.09 for each image scanned when pushed, plus $0.01 for each automatic re-scan, in us-east-1. Accounts new to Inspector get a 15-day free trial.
How do I turn on scan on push in ECR?
In the ECR console, choose Private registry, Settings, and add a scan on push filter, or run aws ecr put-registry-scanning-configuration with a SCAN_ON_PUSH rule. Repositories that match no filter stay on Manual under basic scanning.
Is ECR scan on push deprecated?
The per-repository setting (the PutImageScanningConfiguration API) is being deprecated in favor of registry-level scanning configuration. Scan on push itself is not going away; you set it with registry filters instead.
What does SCAN_ELIGIBILITY_EXPIRED mean in ECR?
The image is outside Inspector's push date or re-scan window, so enhanced scanning no longer scans it. Push it again or lengthen the windows in the Inspector console.
How long does Inspector keep scanning ECR images?
For accounts that activated ECR scanning on or after October 15, 2026, 7 days from push and 7 days from last use by default. Older activations default to 14 or 90 days; you can change both settings.
How do I scan an ECR image from the CLI?
Under basic scanning, run aws ecr start-image-scan with the repository and tag, then aws ecr wait image-scan-complete and aws ecr describe-image-scan-findings. Enhanced scanning has no manual scans.
How do I get ECR scan results?
Open the image in the ECR console, or run aws ecr describe-image-scan-findings. For enhanced scanning, aws inspector2 list-findings with an ecrImageRepositoryName filter also works.
Why can I only scan an ECR image once a day?
Basic scanning allows one scan per image per 24 hours, including the scan on push, and the quota cannot be raised. Push a new image to scan again sooner.
Does ECR scanning find vulnerabilities in Python or Node.js packages?
Only enhanced scanning does. Basic scanning checks operating system packages only, so language dependencies are invisible to it.
Can ECR scan distroless or scratch images?
Enhanced scanning supports scratch, distroless and Chainguard images. Basic scanning cannot scan images built from scratch and returns UnsupportedImageError.
How do I get notified about ECR scan findings?
Create an EventBridge rule for the ECR Image Scan event (basic) or the Inspector2 Finding event (enhanced) and send it to an SNS topic. Filter on finding-severity-counts to alert only on critical results.
What does the ECR.1 Security Hub control check?
That each private ECR repository is configured for scan on push or continuous scanning. Repositories left on Manual fail it, with severity High.
Can I use basic scanning for some repositories and enhanced for others?
Not in the same Region: the scan type is a registry-wide setting per Region. You can choose which repositories enhanced scanning covers with filters, and leave the rest Off.
Does switching from enhanced back to basic delete my scan results?
Results from the other scan type stop being shown after a switch. If you switch back, the earlier scans become available again.
For readers preparing for an AWS certification
We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.
Exams that test this topic: Security – Specialty (SCS-C03) • DevOps Engineer – Professional (DOP-C02) • CloudOps Engineer – Associate (SOA-C03) • Developer – Associate (DVA-C03 from December 1, 2026).
Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:
1. A company must find vulnerabilities in both OS packages and Python libraries in its ECR images, and be told when new CVEs affect images already pushed. What should it enable?
ECR enhanced scanning (Amazon Inspector) with continuous scanning filters on the relevant repositories; basic scanning covers OS packages only.
2. Security Hub control ECR.1 fails for most repositories, although the registry shows Basic scanning. Why?
Basic scanning is on by default, but every repository starts at Manual; add scan on push (or continuous) filters to the registry scanning configuration.
3. After enhanced scanning is turned on, older images show SCAN_ELIGIBILITY_EXPIRED. What are the two fixes?
Push the images again so they fall inside the push-date window, or lengthen the ECR push-date and re-scan durations in Amazon Inspector.
4. A pipeline must stop when a newly pushed image has critical findings, using basic scanning. Which CLI calls do this?
aws ecr wait image-scan-complete, then aws ecr describe-image-scan-findings, checking findingSeverityCounts.CRITICAL.
5. How can the security team receive an alert for every basic scan that finds a critical vulnerability?
An EventBridge rule on the ECR Image Scan event filtered on finding-severity-counts.CRITICAL, targeting an SNS topic.
6. A manual start-image-scan fails with LimitExceededException. What happened?
Basic scanning allows one scan per image per 24 hours, and the scan on push already used it; wait or push a new image.
Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.
Ethan answered the questionnaire a week later with a straight "yes": enhanced scanning on every production repository, scan on push on the rest, a 30-day window, a weekly rebuild of the booking image, and an email to Jake whenever a critical finding appears. The first email arrived on a Tuesday, for a library in the booking API, and the fix was a one-line version bump. "That is the whole job?" Jake asked. "That is the whole job," Ethan said, "now that something is actually looking."
📌 If you keep one line from this page
Basic scanning is on by default but every repository starts at Manual, so add scan on push; switch to enhanced when your images carry language packages, and lengthen Inspector's 7-day windows or rebuild weekly so nothing silently ages out.
$0.09 per initial scan · $0.01 per re-scan · 1 basic scan per image per 24 h · 7-day default windows from October 15, 2026.
Revision note. Written October 22, 2026, with Amazon ECR and Amazon Inspector behavior and US East (N. Virginia) prices of that date. "Out of sight, out of mind," the proverb says; a scanner set to Manual is exactly that.