Best Docker security scanners (2026)
There is no single Docker security scanner that covers every surface. Trivy, Grype, Docker Scout, Dockle, and Lynis are each best-in-class for their domain. This roundup covers what each tool actually scans, what it misses, and — if you are running AI workloads on self-hosted infrastructure — which column only one tool fills.
Four surfaces, six tools
A deployed Docker host has four distinct security surfaces, and the existing tools split across them cleanly:
- Container image CVEs — known vulnerabilities in OS packages and language dependencies baked into the image. Trivy and Grype are the reference tools here.
- Image configuration and best practices — whether the built image follows CIS Docker Image Benchmark checks: non-root user, no unnecessary packages, HEALTHCHECK set, no sensitive files accidentally included. Dockle is purpose-built for this layer.
- Host OS configuration — SSH hardening, PAM, boot loader, firewall config, package freshness, file permissions. Lynis is the standard auditor here; Docker Scout does not touch this surface at all.
- Deployment context: exposure + AI/MCP posture — what ports are actually reachable from the internet (Docker silently bypasses UFW), plus the AI agents and MCP servers running on the box. No scanner in the first three categories covers this. Keelix is the only tool in this roundup that does.
The tools
1. Trivy — the broadest all-in-one scanner
Trivy (Apache-2.0, 36,000+ GitHub stars) is the de-facto standard open-source container security scanner. A single binary covers CVE scanning across OS packages and 20+ language ecosystems, IaC misconfiguration detection (Terraform, CloudFormation, Kubernetes, Helm, Dockerfile, Ansible), secrets scanning, license auditing, and SBOM generation (CycloneDX, SPDX). It runs fully locally — CVE DB downloaded and cached — with no account and no cloud calls.
Where Trivy is limited: it scans images, filesystems, and manifests. It does not scan the live running box outside-in, does not check what ports are actually reachable from the internet due to Docker's iptables rules, and has no awareness of AI agents or MCP servers. It belongs in your build pipeline as the image-layer gate; it does not replace a deployment-context scan.
Note on the March 2026 supply-chain incident: Threat actors compromised Aqua Security's CI/CD pipeline and force-pushed 76 of 77 trivy-action release tags to credential-stealing malware on GitHub. (In a separate prong of the same attack, two malicious image tags were pushed to Docker Hub.) Pin Actions to immutable commit SHAs in production rather than mutable version tags.
2. Grype — fast CVE scanner with EPSS/KEV prioritization
Grype (Apache-2.0, ~12,370 GitHub stars) by Anchore is a fast, single-binary CVE scanner for container images and filesystems. Like Trivy it covers OS packages and 20+ language ecosystems, supports EPSS and KEV scoring for risk prioritization, and handles OpenVEX for filtering non-exploitable findings. No account required; runs fully locally.
Grype's differentiator is its tight integration with Syft: teams that generate SBOMs at build time and scan them separately (decoupling SBOM generation from vulnerability lookup) tend to prefer Grype. For teams who want IaC + image scanning in a single tool, Trivy has the edge. For CVE-only pipelines, Grype is equally capable and lighter.
3. Docker Scout — integrated but cloud-backed
Docker Scout ships inside Docker Desktop and the Docker CLI, making it the lowest-friction starting point for teams already on Docker Hub. It generates SBOMs, matches against 23+ advisory sources, and surfaces remediation suggestions (specific base image recommendations, not just CVE IDs). The policy evaluation engine can enforce security standards across a team.
The meaningful trade-off: Scout is cloud-backed. Image analysis data is sent to Docker's infrastructure, a Docker account is required for Hub-linked features, and the free Personal plan is limited to 1 Docker Scout-enabled repository. For teams with strict data-residency requirements or self-hosted environments where nothing should leave the box, Trivy or Grype are the standard alternatives. Scout also does not scan the host OS, IaC files, or running workloads — scope is image-only.
4. Dockle — CIS Docker Image Benchmark linter
Dockle (Apache-2.0, ~3,260 stars) fills a specific gap that Trivy and Grype do not: it checks built container images against the 11 CIS Docker Image Benchmark checkpoints (CIS-DI-0001 through CIS-DI-0011) plus its own proprietary best-practice checks. This covers things Trivy's Dockerfile linting misses — for example, whether a setuid/setgid binary ended up in the final image, whether sensitive files were accidentally COPY'd in, or whether an image runs as root when it should not.
Dockle is a linter, not a CVE scanner — it does not match packages against vulnerability databases. Run it alongside Trivy or Grype: Trivy/Grype for CVEs, Dockle for CIS-DI compliance at the image layer. Local-first, no account, single binary.
5. Lynis — host OS auditor
Lynis (GPL, by CISOfy) is a host-based security auditor — not a container scanner. It runs directly on the Linux host and checks hundreds of configuration points: SSH hardening, PAM, boot loader, firewall settings, file permissions, package freshness, and more. It produces a hardening index (a number) and a prose report with per-finding remediation guidance. Compliance modes for PCI DSS, HIPAA, and ISO 27001 are available.
What Lynis does not do: it does not scan container images for CVEs, does not check what Docker has opened through iptables, does not assess AI agents or MCP configs, and does not produce a shareable audit record mapped to control frameworks. Its report is a human-readable text file, not a structured evidence artefact you can feed into a compliance workflow. For the host layer, Lynis is thorough; for the whole box, it is half the picture.
6. Keelix — whole-box posture gate (including AI/MCP)
Keelix is the only scanner in this roundup that operates at the deployment-context layer. It runs on the live box and covers what the others do not: host OS configuration checks (mapped to CIS, SOC 2, and ISO 27001 controls), outside-in exposure (exactly which ports are reachable from the internet, including what Docker opened through iptables), and the AI agents and MCP servers running on the machine — auto-approval risk, plaintext secrets in MCP config, unvetted server publishers, and the lethal trifecta.
All of that folds into a single 0–100 posture score you can gate CI on: set a threshold, and the deploy blocks if anything pushes the score below it. Findings map to control frameworks and are exported as shareable audit records — JSON, HTML, or scan record format.
Where Keelix is honest about its limits: it does not perform deep CVE scanning of image layers (Trivy and Grype do that better), it does not generate SBOMs, and it does not lint Dockerfiles for best-practice issues (Dockle and Trivy do that better). The intended workflow is run both in sequence — Trivy in the image build stage, Keelix in the deploy-to-staging stage.
Apache-2.0 CLI, free, nothing leaves the box.
Side by side
| Trivy | Grype | Docker Scout | Dockle | Lynis | Keelix | |
|---|---|---|---|---|---|---|
| Primary scope | Container images, filesystems, git repos, K8s manifests, IaC | Container images, filesystems, SBOMs | Container images (cloud-backed) | Container image best-practice linting (CIS-DI checks) | Host OS: config, packages, auth, networking | Whole box: host config, containers, outside-in exposure, AI/MCP posture |
| CVE scanning | ✓ Deep — OS packages + 20+ language ecosystems, EPSS/KEV | ✓ Deep — OS packages + 20+ language ecosystems, EPSS/KEV, OpenVEX | ✓ Image CVEs (requires Docker account; cloud-backed) | ✗ Not scanned | ✓ Installed OS packages (host only, no containers) | ✓ Host OS packages (posture checks) |
| IaC / Dockerfile misconfigs | ✓ Terraform, CloudFormation, K8s, Helm, Dockerfile, ARM, Ansible | ✗ Not scanned | ✗ Not scanned | ✓ CIS Docker Image checkpoints (11 CIS-DI checks + Dockle proprietary) | ✗ Not scanned | ✓ 93 CIS/SOC 2/ISO 27001-mapped host + container checks |
| Outside-in exposure scan | ✗ Not scanned | ✗ Not scanned | ✗ Not scanned | ✗ Not scanned | ✗ Not scanned | ✓ Shows what is actually reachable from the internet (0.0.0.0 bindings, open ports) |
| AI-agent / MCP posture | ✗ Not scanned | ✗ Not scanned | ✗ Not scanned | ✗ Not scanned | ✗ Not scanned | ✓ Auto-approval, plaintext secrets, unvetted servers, lethal trifecta |
| SBOM generation | ✓ CycloneDX, SPDX, GitHub-flavored | ✓ CycloneDX, SPDX, Syft JSON (via Syft integration) | ✓ CycloneDX, SPDX | ✗ Not generated | ✗ Not generated | ✗ Not generated |
| Output / scoring | CVE list + severity + SBOM + misconfig findings | CVE list + severity, EPSS scores, OpenVEX support | CVE list + remediation suggestions + policy evaluation | Pass/fail per CIS checkpoint; 5 severity levels | Hardening index + per-finding suggestions (prose report) | 0–100 whole-box posture score + per-finding report (JSON/HTML/scan record) |
| CI gate mechanism | Exit code on severity threshold (--exit-code 1 --severity CRITICAL) | Exit code on severity threshold | Policy evaluation; no native exit-code gate without CLI wrapper | Exit code on findings (--exit-level FATAL) | Hardening index; manual threshold via script | Exit code on posture threshold (e.g. score ≥ 80) + GitHub Action |
| Compliance evidence | ✗ Not generated | ✗ Not generated | ✗ Not generated | ✗ Not generated (CIS-DI findings only) | ✗ Not generated | ✓ SOC 2, ISO 27001, CIS Docker Benchmark — shareable audit records |
| Local-first / zero telemetry | ✓ Runs fully locally; CVE DB downloaded and cached | ✓ Runs fully locally; no account required | ✗ Cloud-backed — image analysis data sent to Docker infrastructure | ✓ Runs fully locally | ✓ Runs fully locally on the host | ✓ Nothing leaves your box; secrets redacted at scan boundary |
| Docker / cloud account required | None | None | Docker account required for Hub-linked features and cloud analysis | None | None | None |
| License | Apache-2.0 | Apache-2.0 | Proprietary (Personal free: 1 Scout-enabled repo; Pro $9/user/mo billed annually ($11/mo monthly); Team $15/user/mo billed annually ($16/mo monthly)) | Apache-2.0 | GPL (open-source; enterprise plugins available) | Apache-2.0 CLI free; Keelix Cloud for history + teams |
Recommended pipeline for self-hosted Docker deployments
A minimal, fully local-first pipeline for a self-hosted Docker deployment looks like this:
- Build stage: Trivy image scan for CVEs and IaC misconfigs; Dockle CIS-DI check on the built image. Gate on CRITICAL CVEs and FATAL Dockle findings. Output SBOM.
- Deploy-to-staging: Keelix posture gate on the live staging box — host config, exposure, and AI/MCP checks. Gate on posture score ≥ your threshold before promote-to-production.
- Periodic host audit: Lynis for a deep host-only report when you want the prose detail or need to demonstrate compliance to an auditor who expects Lynis output.
None of these overlap in a way that wastes scan time — each is checking a genuinely different input.
# Build stage — image CVE scan
- name: Trivy image scan
uses: aquasecurity/trivy-action@v0.35.0 # pin to commit SHA in prod
with:
image-ref: myapp:${{ github.sha }}
exit-code: 1
severity: CRITICAL
# Build stage — CIS Docker Image check
- name: Dockle image lint
run: |
dockle --exit-code 1 --exit-level fatal myapp:${{ github.sha }}
# Deploy-to-staging — whole-box posture gate
- name: Keelix posture gate
uses: jakelamon/keelix@v0.1.0
with:
threshold: 80
fail-on: mcp-auto-approval,mcp-secretsFrequently asked
- Which Docker security scanner is best for self-hosted servers?
- For self-hosted VPS or bare-metal deployments, the right answer is usually more than one tool — because each scans a different surface. Trivy or Grype handles CVE scanning on your container images (both local-first, Apache-2.0, no account required). Lynis audits the host OS. Keelix is the only tool that ties all surfaces together — host config, container posture, internet-reachable ports, and the AI agents or MCP servers running on the box — into a single 0–100 score you can gate a deploy on.
- What is the difference between Trivy and Grype?
- Both are fast, local, Apache-2.0 CVE scanners with no account requirement — and both are excellent at their job. The main differences: Trivy covers more target types (Kubernetes manifests, Terraform/CloudFormation IaC, Helm charts, Ansible, Dockerfiles) in a single binary. Grype focuses on container images and filesystems and integrates tightly with Syft for SBOM-driven scanning, with strong EPSS/KEV prioritization and OpenVEX support. Most teams pick one as their primary image scanner; Trivy's broader IaC coverage makes it the more common choice for a single tool, but Grype's SBOM-native workflow is preferred by teams already using Syft.
- Does Docker Scout require a Docker account?
- Yes — Docker Scout's full feature set (continuous monitoring, policy evaluation, Hub integration) requires a Docker account, and image analysis data is processed through Docker's cloud infrastructure. The free Personal plan allows 1 Docker Scout-enabled repository. For teams with strict data-residency requirements or air-gapped environments, this cloud-backed model is a meaningful constraint. Trivy and Grype are the standard local-first alternatives.
- What does Dockle check that Trivy does not?
- Dockle checks built Docker images against CIS Docker Image Benchmark (CIS-DI-0001 through CIS-DI-0011) and its own best-practice checkpoints — for example, whether setuid/setgid files are compliant, whether sensitive files were accidentally packaged, whether the image runs as a non-root user, and whether the HEALTHCHECK instruction is set. These are image-layer configuration checks, not CVE scanning. Trivy has some IaC and Dockerfile misconfiguration coverage, but Dockle is more granular on the CIS-DI layer for a built image. Most hardening pipelines run both.
- Does any open-source Docker scanner check AI agent security?
- Keelix does. Trivy, Grype, Docker Scout, Dockle, and Lynis are all completely blind to the AI agents and MCP servers running on the same box. None of them check whether an MCP server auto-approves all tool calls, whether an API key is stored in plaintext in a Claude Code config file, or whether the lethal trifecta is present. That surface is new enough that none of the established Docker scanners have added it — Keelix was built specifically to close that gap.
- Can I use Lynis and Keelix together?
- Yes — and they are complementary, not duplicative. Lynis is a host-only auditor: it checks the Linux system configuration (SSH hardening, PAM, boot loader, package freshness, network config) and produces a prose hardening report. It does not scan containers, does not show what ports Docker has opened through iptables, and has no awareness of AI agents or MCP servers. Keelix scans the whole box — including the host checks Lynis covers (mapped to CIS/SOC 2/ISO 27001 controls) plus containers, outside-in exposure, and AI/MCP posture — and produces a single scored, shareable audit record rather than a prose report. You can run Lynis for the deeper host-only detail and Keelix as the CI gate.
Related
- Keelix vs Trivy — complementary tools, different surfaces
- Keelix vs Grype — beyond CVE scanning
- Keelix vs Docker Scout — local-first vs cloud-backed
- Keelix AI/MCP security — the surface Docker scanners miss
- Is my Docker container exposed to the internet?
- CIS Docker Benchmark scanner — automated audit and scoring
Add the column no Docker scanner fills.
Free, local-first, Apache-2.0. Runs after Trivy — not instead of it.