A comprehensive Docker container security scanning tool that integrates multiple vulnerability scanners to provide thorough assessments of container images.
- Multi-Scanner Integration: Supports Trivy, Snyk, Grype, Docker Scout, and Syft
- Flexible Configuration: YAML-based configuration with environment variable support
- Multiple Output Formats: JSON, summary reports, and detailed analysis
- Comprehensive Logging: Configurable logging levels with file and console output
- Robust Error Handling: Retry mechanisms for improved reliability
- SBOM Generation: Generates Software Bill of Materials using Syft
- Vulnerability Filtering: Supports severity filters and CVE exclusions
A fast, comprehensive vulnerability scanner by Aqua Security. Detects OS-level and application package vulnerabilities with minimal false positives.
A developer-first security platform for scanning open-source dependencies, container images, and IaC. Requires SNYK_TOKEN.
Vulnerability scanner by Anchore. Supports multiple Linux distros and programming languages.
Docker's built-in security scanning solution. Integrated into Docker Desktop and CLI. Requires Docker Hub credentials and token.
CLI tool and Go library for generating SBOMs. Provides detailed package discovery from container images.
On first run, a default config file is generated automatically. You can customize as needed:
scanners:
trivy:
enabled: true
timeout: 600
options: ["--format", "json", "--quiet"]
snyk:
enabled: true
timeout: 900
options: ["--json"]
grype:
enabled: true
timeout: 600
options: ["-o", "json", "--quiet"]
docker_scout:
enabled: true
timeout: 600
preferred_format: "sarif"
syft:
enabled: true
timeout: 300
options: ["-o", "json", "--quiet"]
output:
directory: "scan_results"
formats: ["json", "summary"]
include_raw_output: true
logging:
level: "INFO"
file: "logs/scanner.log"
console_output: true
To scan a container image, run:
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd)/results:/app/scan_results \
-v $(pwd)/logs:/app/logs \
-e SNYK_TOKEN="<your_snyk_token>" \
-e DOCKER_SCOUT_TOKEN="<your_docker_scout_token>" \
-e DOCKER_SCOUT_USERNAME="<your_dockerhub_username>" \
docker_scanner:latest \
certbot/certbot:latest
You must provide valid tokens for Snyk and Docker Scout using environment variables. Never commit your tokens in source code.
Example: Full Output (json)
{
"image": "docker.phoenix.mahsan.net/certbot/certbot:latest",
"scan_timestamp": "2025-07-29T06:01:17.560554",
"total_execution_time": 468.964819,
"scanners_executed": 5,
"total_vulnerabilities": 24,
"severity_breakdown": {
"CRITICAL": 2,
"HIGH": 3,
"MEDIUM": 13,
"LOW": 6,
"UNKNOWN": 0
},
"scanner_summary": {
"trivy": {
"success": true,
"execution_time": 295.31,
"vulnerabilities_found": 3,
"packages_found": 0
},
"snyk": {
"success": true,
"execution_time": 7.63,
"vulnerabilities_found": 0,
"packages_found": 0
},
"grype": {
"success": true,
"execution_time": 138.72,
"vulnerabilities_found": 18,
"packages_found": 0
},
"docker_scout": {
"success": true,
"execution_time": 13.51,
"vulnerabilities_found": 3,
"packages_found": 0
},
"syft": {
"success": true,
"execution_time": 10.38,
"vulnerabilities_found": 0,
"packages_found": 99
}
}
}{
"image": "nginx:latest",
"scan_timestamp": "2024-01-15T10:30:00",
"total_execution_time": 45.2,
"scanners_executed": 5,
"total_vulnerabilities": 23,
"severity_breakdown": {
"CRITICAL": 2,
"HIGH": 5,
"MEDIUM": 10,
"LOW": 6,
"UNKNOWN": 0
},
"scanner_summary": {
"trivy": {
"success": true,
"execution_time": 12.3,
"vulnerabilities_found": 15
}
}
}-
(Optional) Set build args or environment variables as needed.
-
Build the image:
docker build \
--tag your-name/docker-multiscanner:latest
.
The detailed report contains comprehensive information about vulnerabilities detected by each scanner. This includes:
β
CVE IDs β Unique identifiers for each vulnerability (e.g., CVE-2024-12345)
π¦ Affected Packages β The name and version of vulnerable packages
π Severity Levels β Categorized as CRITICAL, HIGH, MEDIUM, LOW, or UNKNOWN
π§ Fix Recommendations β Suggested fixes or patched versions (if available)
π Reference Links β URLs to external sources such as NVD, GitHub advisories, etc.
π§Ύ Raw Scanner Output β The original JSON output from each scanner, stored for auditing and debugging
This section outlines the purpose, strengths, and specific requirements (if any) of each integrated scanner:
| Scanner | Purpose | Strengths | Requirements |
|---|---|---|---|
| Trivy | General vulnerability scanning | Fast, accurate, supports OS & language packages | None |
| Snyk | Developer-focused security scanner | Excellent vulnerability database, actionable fix suggestions | SNYK_TOKEN environment variable |
| Grype | Filesystem and container image scanning | SBOM-aware scanning, supports multiple formats | None |
| Docker Scout | Docker-native security scanning | Tight Docker CLI/Desktop integration, image suggestions | Docker Hub credentials + token |
| Syft | SBOM (Software Bill of Materials) generation | Deep package inspection, ideal for inventory purposes | None |
You have two options:
-
(Optional) Set build args or environment variables as needed.
-
Build the image:
docker build \
--tag docker-multiscanner:latest \
.- Build and Publish with Makefile
Fill IMAGE_NAME and IMAGE_TAG variables in the Makefile or pass as arguments.
Build Locally
make build IMAGE_NAME=docker-multiscanner IMAGE_TAG=latestClean Up Local Build
make clean IMAGE_NAME=docker-multiscanner Contributions are welcome! Please open issues or submit pull requests for enhancements and bug fixes.