| name | scanning-container-images-with-grype |
| description | Scans container images, filesystems, and SBOMs for known CVEs using Anchore Grype, matching Syft-generated SBOM packages against NVD, GitHub Advisories, and OS-specific vulnerability feeds with configurable severity thresholds. Use when running a security assessment or incident-response check that requires scanning container images for known vulnerabilities with Grype. |
| domain | cybersecurity |
| subdomain | container-security |
| tags | ["grype","vulnerability-scanning","container-security","sbom","anchore","supply-chain"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
| nist_csf | ["PR.PS-01","PR.IR-01","ID.AM-08","DE.CM-01"] |
| mitre_attack | ["T1610","T1611","T1609","T1525","T1195"] |
Scanning Container Images with Grype
Overview
Grype is an open-source vulnerability scanner from Anchore that inspects container images, filesystems, and SBOMs for known CVEs. It leverages Syft-generated SBOMs to match packages against multiple vulnerability databases including NVD, GitHub Advisories, and OS-specific feeds.
When to Use
- When conducting security assessments that involve scanning container images with grype
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing
Prerequisites
- Docker or Podman installed
- Grype CLI installed (
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin)
- Syft CLI (optional, for SBOM generation)
- Network access to pull vulnerability databases
Core Commands
Install Grype
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin
grype version
brew install grype
Scan Container Images
grype nginx:latest
grype docker:myapp:1.0
grype docker-archive:image.tar
grype oci-dir:path/to/oci/
grype sif:image.sif
grype dir:/path/to/project
Output Formats
grype alpine:3.18
grype alpine:3.18 -o json > results.json
grype alpine:3.18 -o cyclonedx
grype alpine:3.18 -o sarif > grype.sarif
grype alpine:3.18 -o template -t /path/to/template.tmpl
Filtering and Thresholds