Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Multi-Scanner Security Vulnerability Scanner

A comprehensive Docker container security scanning tool that integrates multiple vulnerability scanners to provide thorough assessments of container images.


πŸš€ Features

  • 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

πŸ”§ Supported Scanners

1. Trivy

A fast, comprehensive vulnerability scanner by Aqua Security. Detects OS-level and application package vulnerabilities with minimal false positives.

2. Snyk

A developer-first security platform for scanning open-source dependencies, container images, and IaC. Requires SNYK_TOKEN.

3. Grype

Vulnerability scanner by Anchore. Supports multiple Linux distros and programming languages.

4. Docker Scout

Docker's built-in security scanning solution. Integrated into Docker Desktop and CLI. Requires Docker Hub credentials and token.

5. Syft

CLI tool and Go library for generating SBOMs. Provides detailed package discovery from container images.


βš™οΈ Configuration File (config.yaml)

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

πŸ’» Usage

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

⚠️ Note:

You must provide valid tokens for Snyk and Docker Scout using environment variables. Never commit your tokens in source code.


πŸ“Š Output Formats

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
    }
  }
}

Example: Summary Report

{
  "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
    }
  }
}

πŸ”Ή 1. Build Directly with Dockerfile

  1. (Optional) Set build args or environment variables as needed.

  2. Build the image:

    docker build \

--tag your-name/docker-multiscanner:latest
.


πŸ“„ Detailed Report

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

🧠 Scanner Overview

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

How to Build

πŸ› οΈ Build the Docker Image

You have two options:

πŸ”Ή 1. Build Directly with Dockerfile

  1. (Optional) Set build args or environment variables as needed.

  2. Build the image:

docker build \
--tag docker-multiscanner:latest \
.
  1. 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=latest

Clean Up Local Build

make clean IMAGE_NAME=docker-multiscanner  

πŸ™‹β€β™‚οΈ Contributing

Contributions are welcome! Please open issues or submit pull requests for enhancements and bug fixes.


πŸ“Ž License

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages