10 Best Image Scanning Tools for Container Security
Compare 10 container image scanners: Trivy, Grype, Clair, Docker Scout, Snyk, Anchore, Aqua, Amazon Inspector, Defender and Artifact Analysis.
Container image scanners list the packages inside an image and match them against vulnerability databases. Trivy and Grype are the leading open source choices for CI. Docker Scout, Snyk Container, Anchore Enterprise and Aqua add policy, fix advice and reporting, while Amazon Inspector, Microsoft Defender for Containers and Google Artifact Analysis scan images inside each cloud's registry.
This post belongs to our DevSecOps series. If you are building a full pipeline, start with the hub post on automated security testing in CI/CD with OWASP ZAP and our stage-by-stage list of DevSecOps tools for secure CI/CD. This page goes deep on one stage: scanning the image itself.
Product names, licenses and commands were checked against each vendor's documentation in November 2026.
Key takeaways
- Scan in three places: in CI before push, in the registry after push, and again on a schedule, because new CVEs appear for images that have not changed.
- Trivy (Apache-2.0) and Grype (Apache-2.0) are the open source defaults for pipelines. Clair (Apache-2.0) is the API-driven scanner behind registries such as Quay.
- Anchore Engine is no longer maintained and its repository was archived in March 2026. Anchore points users to Syft and Grype, or to Anchore Enterprise for a supported platform.
- Amazon ECR basic scanning now uses AWS native technology for OS packages. Enhanced scanning with Amazon Inspector adds language packages and continuous rescans.
- Microsoft Defender for Containers scans images with Microsoft Defender Vulnerability Management and covers ACR, ECR, Google Artifact Registry, Docker Hub and JFrog Artifactory.
- Different scanners report different results for the same image. Test two on your own images before you standardise.
How image scanners work and why results differ
Every scanner follows the same three steps. It unpacks the image layers and builds an inventory of what is installed (often as an SBOM). It matches each package and version against vulnerability data from sources such as distribution security trackers, the GitHub Advisory Database and the NVD. Then it filters and ranks the matches by severity, fix availability and sometimes exploit data.
Results differ between tools for practical reasons:
- Package detection. Some tools read only OS package databases (dpkg, rpm, apk). Others also find language packages such as npm, PyPI, Maven and Go modules, and binaries copied in without a package manager.
- Data sources. A distribution may mark a CVE as not affecting its build of a package, while the NVD lists it as affected. Scanners that trust the distribution report fewer false positives on that OS.
- Prioritisation. Newer scanners use EPSS scores and CISA's Known Exploited Vulnerabilities (KEV) catalogue to rank findings. Grype and Anchore Enterprise both mention EPSS and KEV.
- Suppression. VEX (Vulnerability Exploitability eXchange) documents let a vendor or your team state that a CVE does not affect a product. Grype supports OpenVEX for filtering.
Because of this, the number of CVEs a tool reports says little about its quality. What matters is whether the findings are accurate, fixable and ranked well enough that developers act on them.
Comparison of the 10 scanners
| Tool | Type | License | Where it runs | Best fit |
|---|---|---|---|---|
| Trivy | CLI scanner | Apache-2.0 | CI, local, Kubernetes, Harbor | All-round open source default |
| Grype (with Syft) | CLI scanner | Apache-2.0 | CI, local, SBOM files | SBOM-first workflows |
| Clair | API service | Apache-2.0 | Registry backend (Quay) | Self-hosted registry scanning |
| Docker Scout | Service plus CLI | Commercial, included with Docker plans | Docker Desktop, CLI, Docker Hub | Teams already on Docker Hub |
| Snyk Container | SaaS plus CLI | Commercial, Free plan | CI, registries, Kubernetes | Base image upgrade advice |
| Anchore Enterprise | Platform | Commercial | Self-hosted, air-gapped | SBOM management and compliance policy |
| Aqua Platform | Platform | Commercial | CI, registries, Kubernetes | Image assurance plus runtime security |
| Amazon Inspector (ECR) | Cloud service | Commercial (AWS) | Amazon ECR | AWS-only workloads |
| Defender for Containers | Cloud service | Commercial (Azure) | ACR, ECR, GAR, external registries | Azure and multi-cloud estates |
| Google Artifact Analysis | Cloud service | Commercial (Google Cloud) | Artifact Registry, on-demand | Google Cloud workloads |
Open source scanners
1. Trivy
Trivy, maintained by Aqua Security, scans container images, filesystems, Git repositories, VM images and Kubernetes clusters. Beyond CVEs it finds IaC misconfigurations, secrets and license issues, and it can produce CycloneDX or SPDX SBOMs. It is the bundled scanner in Harbor, so many teams meet it through their registry.
# Gate a build on fixable high and critical CVEs
trivy image --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 app:1.4.2
# Produce an SBOM once, then rescan the SBOM later without pulling the image
trivy image --format cyclonedx --output sbom.cdx.json app:1.4.2
trivy sbom sbom.cdx.json
If you call Trivy through GitHub Actions, pin the action to a full commit SHA. In March 2026 attackers rewrote most aquasecurity/trivy-action tags and published a malicious Trivy v0.69.4. Aqua's advisory GHSA-69fq-xp46-6x23 lists the safe versions and recommends rotating any secrets those pipelines could read.
2. Grype (with Syft)
Grype, from Anchore, scans images, directories and SBOMs. Its companion Syft generates the SBOM. Splitting the two steps is useful: generate the SBOM at build time, store it with the image, and rescan the stored SBOM daily without pulling the image again.
syft app:1.4.2 -o syft-json > sbom.syft.json
grype sbom:./sbom.syft.json --fail-on high --only-fixed -o table
# SARIF output for code scanning dashboards
grype app:1.4.2 -o sarif > grype.sarif
--fail-on sets exit code 2 when a finding meets the chosen severity. Grype also supports OpenVEX documents for suppressions and uses EPSS and KEV data for prioritisation.
3. Clair
Clair is an open source static analyser for OCI and Docker images, developed under the Quay organisation and licensed Apache-2.0. Clients call its API to index an image and then match the index against vulnerability data. It is designed to run as a service behind a registry rather than as a quick CLI in a build job.
Choose Clair if you run Quay or want a self-hosted scanning service with an API. For pipeline gates, Trivy or Grype are simpler to set up.
Commercial platforms
4. Docker Scout
Docker Scout builds an SBOM for an image and matches it against a continuously updated vulnerability database. It works in Docker Desktop, the Docker CLI, Docker Hub and the Scout dashboard. The number of Scout-enabled repositories depends on your Docker subscription, so check Docker's pricing page.
docker scout quickview app:1.4.2
docker scout cves --exit-code --only-severity critical,high --only-fixed app:1.4.2
docker scout compare app:1.4.2 --to app:1.4.1
--exit-code returns 2 when vulnerabilities are found. compare shows what changed between two versions, which is handy in pull requests that bump a base image.
5. Snyk Container
Snyk Container scans images from the CLI, from registry integrations and from a Kubernetes integration. Developers like it for base image advice: when you pass the Dockerfile, it suggests alternative base images with fewer vulnerabilities. Snyk's Free plan includes 100 Container tests, according to its plans page.
snyk container test app:1.4.2 --file=Dockerfile --severity-threshold=high
snyk container monitor app:1.4.2 --file=Dockerfile
6. Anchore Enterprise
Anchore Enterprise is the supported platform built around Anchore's open source tools. It manages SBOMs in Syft, CycloneDX and SPDX formats, rescans stored SBOMs continuously, checks for malware and secrets, and ranks findings with CVSS, EPSS and KEV. Policies are JSON documents you can keep in Git, and policy packs cover NIST, FedRAMP and DISA controls. It can run in air-gapped environments.
If you see older guides recommending Anchore Engine, note that it has not been maintained since 2023 and its repository was archived in March 2026.
7. Aqua Platform
Aqua Security's commercial platform scans images for vulnerabilities, malware, embedded secrets and misconfigurations, and rescans registry images when new CVEs are published. Two features go beyond static scanning. Dynamic Threat Analysis runs an image in a sandbox and watches its behaviour for malware, cryptominers and container escape attempts. Assurance Policies set the minimum standard an image must meet, applied as CI gates and, through KubeEnforcer, as Kubernetes admission control.
Cloud-native registry scanning
8. Amazon Inspector with Amazon ECR
Amazon ECR offers two modes. Basic scanning uses AWS native technology with the CVE database to find operating system vulnerabilities, on push or on demand. Enhanced scanning hands the repository to Amazon Inspector, which adds programming language packages, scans on push and continuously, and sends updated findings to EventBridge as new CVEs appear.
# Basic scanning: trigger and read results
aws ecr start-image-scan --repository-name app --image-id imageTag=1.4.2
aws ecr describe-image-scan-findings --repository-name app --image-id imageTag=1.4.2
AWS notes that the newer basic scanning returns results through DescribeImageScanFindings rather than the summary fields in DescribeImages, so update older scripts that read those fields. Switching between basic and enhanced modes resets the established scans.
9. Microsoft Defender for Containers
Defender for Cloud uses Microsoft Defender Vulnerability Management to scan registry images and the images behind running containers. Registry assessment covers Azure Container Registry, Amazon ECR, Google Artifact Registry, Google Container Registry and configured external registries such as Docker Hub and JFrog Artifactory. It scans OS packages on Linux and Windows and language packages on Linux.
Newly pushed images are usually scanned within a few hours, and images pushed or pulled in the last 30 days, or running in a monitored cluster, are rescanned daily. Images outside that window stop getting updated findings until they are pulled again. With Defender CSPM enabled, findings gain risk-based prioritisation.
10. Google Artifact Analysis
Artifact Analysis, formerly called Container Analysis, scans each image pushed to Artifact Registry once the API is enabled, and updates findings as new vulnerabilities are published. It includes language package scanning. On-demand scanning lets you scan an image from the gcloud CLI, including local images, before you push. On-demand results are available for 48 hours and are not updated after that.
Google Container Registry has been replaced by Artifact Registry. Our guide to container registry security practices covers that migration along with signing and retention.
Scanning what is already running in Kubernetes
Registry scans tell you which images are vulnerable. They do not tell you which of those images are running, in which namespace, and who owns them. Two approaches answer that question.
The cloud services do it for you if you enable runtime assessment: Defender for Containers maps registry findings to running workloads, and can scan images collected from the cluster regardless of registry. For self-managed clusters, the open source Trivy Operator (Apache-2.0) watches the cluster and scans automatically when, for example, a new Pod is created. It stores results as Kubernetes custom resources, so you can query them with kubectl or export them to dashboards.
helm repo add aqua https://aquasecurity.github.io/helm-charts/
helm repo update
helm install trivy-operator aqua/trivy-operator \
--namespace trivy-system --create-namespace
# List vulnerability reports for all workloads
kubectl get vulnerabilityreports -A
Besides vulnerabilities, the operator produces configuration audit, exposed secret, RBAC and compliance reports (NSA/CISA hardening guidance, CIS Kubernetes Benchmark and Pod Security Standards). Pin the chart with --version in production so upgrades are deliberate. Our list of common Kubernetes vulnerabilities covers the cluster-level issues these reports flag.
Other tools you will see
Qualys, Tenable, Sysdig Secure, Wiz, JFrog Xray and GitLab and GitHub's built-in container scanning also scan images. They are usually chosen because an organisation already uses that vendor's platform, not as standalone scanners. If your company already pays for one of them, test its image scanning before buying another product, because consolidating findings in one console has real value for the security team. Evaluate them with the same test described below.
Where to scan: CI, registry and runtime
| Point | What it catches | Typical tools |
|---|---|---|
| Dockerfile and build | Vulnerable base images and packages before anything is pushed | Trivy, Grype, Docker Scout, Snyk Container |
| Registry on push | Images pushed by any pipeline, including ones without a CI gate | Inspector, Defender, Artifact Analysis, Harbor with Trivy, Clair |
| Continuous rescan | New CVEs in images that have not changed | Inspector enhanced, Defender, Anchore Enterprise, SBOM rescans with Grype or Trivy |
| Runtime | Which vulnerable images are actually running | Defender runtime assessment, Aqua, Sysdig |
Scanning catches known CVEs. It does not replace good build habits: small base images, multi-stage builds, non-root users and pinned versions. Our Dockerfile examples show these patterns for Node, Python, Go and Java, and fewer packages means fewer findings to triage.
Example: a scan gate in GitLab CI
The pattern is the same in any CI system: build and push the image with a unique tag, scan that exact image, keep the full report as an artifact, and fail the job only on the findings you have agreed to block. This GitLab CI job uses Trivy's container image and GitLab's predefined registry variables.
container_scan:
stage: test
image:
name: aquasec/trivy:0.76.2 # pin a version you have reviewed
entrypoint: [""]
variables:
TRIVY_USERNAME: "$CI_REGISTRY_USER"
TRIVY_PASSWORD: "$CI_REGISTRY_PASSWORD"
TRIVY_CACHE_DIR: ".trivycache/"
IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
script:
# Full report for the record, never fails the job
- trivy image --exit-code 0 --format json --output trivy-report.json "$IMAGE"
# The gate: only fixable critical CVEs block the pipeline
- trivy image --exit-code 1 --severity CRITICAL --ignore-unfixed "$IMAGE"
cache:
paths:
- .trivycache/
artifacts:
when: always
paths:
- trivy-report.json
Two choices in this job matter. Scanning by commit SHA tag means the scanned image is the one that gets deployed, and the cache directory keeps the vulnerability database download from slowing every run. Once the team is comfortable, add HIGH to the gate.
Triage: what to do with the findings
A scanner that reports 300 CVEs on the first run is normal. The goal is a short list developers can act on this week, and a record of everything else.
- Fix the base image first. Most OS package findings disappear when you move to a newer or smaller base image. One rebuild can clear dozens of CVEs.
- Upgrade direct dependencies next. Language package findings usually need a version bump in the application manifest, followed by a rebuild.
- Use exploit data to rank the rest. A CVE in the KEV catalogue or with a high EPSS score should come before a theoretical issue in a package your code never loads.
- Record accepted risks with a reason and an end date. Trivy reads a
.trivyignorefile, and Grype and Anchore support VEX documents. Review every entry when it expires. - Rescan after release. An image that passed last month can fail today. Schedule a daily scan of running images or stored SBOMs and send new criticals to the owning team.
# .trivyignore
# Not reachable: the vulnerable function is in a CLI tool we do not ship. Owner: platform team.
CVE-2026-00000
The CVE ID above is a placeholder. Keep the ignore file in the same repository as the Dockerfile so changes go through code review.
How to choose: a one-afternoon test
- Pick five real images: one distroless or Alpine, one Debian or Ubuntu, one RHEL-based, one with many language dependencies, and one old image you know is out of date.
- Scan each with two candidate tools and export JSON.
- Compare the critical and high findings. Check a sample against the distribution's security tracker to see which tool is right.
- Note how many findings have a fix, and whether the tool tells developers what to change.
- Time the scan in your CI runner and check that the exit code behaviour fits your gate.
- Check the integrations you need: your registry, SARIF output, ticketing and Kubernetes admission.
When a critical CVE is announced, the scanner is only half the response. Read how DevOps teams handle zero-day vulnerabilities in the pipeline for the rest, and how SBOMs support compliance for keeping an inventory you can search quickly.
Learn container security in a lab
Our DevSecOps training includes hands-on labs on image scanning with Trivy and Grype, SBOM generation, image signing and Kubernetes admission policies. Classes run in Kharadi, Pune and live online across India.
FAQs
What is the best free container image scanner?
Trivy and Grype are the most widely used free scanners. Trivy covers images, filesystems, IaC and secrets in one binary. Grype pairs with Syft for an SBOM-first workflow. Both are Apache-2.0 licensed and fit easily into any CI system.
Is Trivy better than Grype?
Neither is better for every case. Trivy does more kinds of scanning, such as IaC and secrets. Grype focuses on vulnerabilities and works well with stored Syft SBOMs, OpenVEX and EPSS-based ranking. Run both on your own images and compare accuracy before choosing.
Is Anchore Engine still supported?
No. Anchore Engine has not been maintained since 2023 and its GitHub repository was archived in March 2026. Anchore recommends Syft and Grype for open source use and Anchore Enterprise for a supported platform.
Does Amazon ECR still use Clair for scanning?
The ECR documentation now describes basic scanning as using AWS native technology with the CVE database for OS vulnerabilities. Enhanced scanning uses Amazon Inspector and adds language packages and continuous scanning.
Should I scan in CI or in the registry?
Both. CI scans stop bad images before they are pushed and give developers quick feedback. Registry and continuous scans catch images pushed by other routes and new CVEs disclosed after the build.
Why do two scanners report different vulnerabilities for the same image?
They detect packages differently and trust different vulnerability sources. A distribution may mark a CVE as not affecting its package while the NVD lists it as affected. Compare a sample of findings against the distribution's security tracker to judge accuracy.
Can image scanning find malware?
Standard CVE scanners such as Trivy and Grype look for known vulnerable packages, not malware. Commercial platforms such as Aqua and Anchore Enterprise add malware scanning, and Aqua's Dynamic Threat Analysis runs images in a sandbox to watch their behaviour.
What exit code do scanners return when they find vulnerabilities?
It varies. Trivy returns the value you set with --exit-code. Grype returns 2 when --fail-on is triggered, and Docker Scout returns 2 with --exit-code. Check the tool's documentation and make sure your CI treats any non-zero code as a failure.
References
- Trivy repository
- Trivy security advisory GHSA-69fq-xp46-6x23
- Trivy Operator repository
- Grype repository
- Grype command line reference
- Clair repository
- Anchore Engine repository (archived)
- Anchore Enterprise platform
- Docker Scout documentation
- docker scout cves reference
- Snyk Container documentation
- Aqua container scanning
- Amazon ECR image scanning
- Microsoft Learn: Vulnerability management for containers
- Google Cloud: Artifact Analysis overview
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0