scanning-container-images-with-grype
Scans container images, filesystems, and SBOMs for known CVEs with Anchore Grype, matching Syft-generated SBOM packages against NVD, GitHub Advisories, and OS-specific feeds with configurable severity thresholds and failure gates. Use when Grype or Syft is the chosen toolchain, when scanning an exis
v1.03 installazioni+3 in 7 giorni36,3K StelleApache-2.0sincronizzato 12 ore fa
Installa
Non hai ancora la CLI di NotHoly? Installala prima.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install mukul975/scanning-container-images-with-grypeScrive in ~/.notholy/skills dopo aver controllato la firma e lo SHA-256.
FirmaFirmato, ed25519
Pacchetto829784ac…8843aff5
829784ac1097…e64c8843aff58 file · 12.8 KBScansioneMedio8 segnalazioni
- command.pipe_to_shellSKILL.md:52
- command.pipe_to_shellSKILL.md:62
- command.pipe_to_shellreferences/workflows.md:8
Sorgentegithub.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/scanning-container-images-with-grype@54a7988
Questa voce non è ancora scritta in italiano, quindi è mostrata in un'altra lingua: English.
In questa pagina
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
# Install via script
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin
# Verify installation
grype version
# Install via Homebrew (macOS/Linux)
brew install grypeScan Container Images
# Scan a Docker Hub image
grype nginx:latest
# Scan from Docker daemon
grype docker:myapp:1.0
# Scan a local archive
grype docker-archive:image.tar
# Scan an OCI directory
grype oci-dir:path/to/oci/
# Scan a Singularity image
grype sif:image.sif
# Scan a local directory / filesystem
grype dir:/path/to/projectOutput Formats
# Default table output
grype alpine:3.18
# JSON output for pipeline processing
grype alpine:3.18 -o json > results.json
# CycloneDX SBOM output
grype alpine:3.18 -o cyclonedx
# SARIF output for GitHub Security tab
grype alpine:3.18 -o sarif > grype.sarif
# Template-based custom output
grype alpine:3.18 -o template -t /path/to/template.tmplFiltering and Thresholds
# Fail if vulnerabilities meet or exceed a severity
grype nginx:latest --fail-on critical
# Show only fixed vulnerabilities
grype nginx:latest --only-fixed
# Show only non-fixed vulnerabilities
grype nginx:latest --only-notfixed
# Filter by severity
grype nginx:latest --only-fixed -o json | jq '[.matches[] | select(.vulnerability.severity == "High")]'
# Explain a specific CVE
grype nginx:latest --explain --id CVE-2024-1234Working with SBOMs
# Generate SBOM with Syft then scan
syft nginx:latest -o spdx-json > nginx-sbom.json
grype sbom:nginx-sbom.json
# Scan CycloneDX SBOM
grype sbom:bom.jsonConfiguration File (.grype.yaml)
# .grype.yaml
check-for-app-update: false
fail-on-severity: "high"
output: "json"
scope: "squashed" # or "all-layers"
quiet: false
ignore:
- vulnerability: CVE-2023-12345
reason: "False positive - not exploitable in our context"
- vulnerability: CVE-2023-67890
fix-state: unknown
db:
auto-update: true
cache-dir: "/tmp/grype-db"
max-allowed-built-age: 120h # 5 days
match:
java:
using-cpes: true
python:
using-cpes: true
javascript:
using-cpes: falseCI/CD Integration
# GitHub Actions
- name: Scan image with Grype
uses: anchore/scan-action@v4
with:
image: "myregistry/myapp:${{ github.sha }}"
fail-build: true
severity-cutoff: high
output-format: sarif
id: scan
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.scan.outputs.sarif }}# GitLab CI
container_scan:
stage: test
image: anchore/grype:latest
script:
- grype ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} --fail-on high -o json > grype-report.json
artifacts:
reports:
container_scanning: grype-report.jsonDatabase Management
# Check database status
grype db status
# Manually update vulnerability database
grype db update
# Delete cached database
grype db delete
# List supported database providers
grype db listKey Vulnerability Sources
| Source | Coverage |
|---|---|
| NVD | CVEs across all ecosystems |
| GitHub Advisories | Open source package vulnerabilities |
| Alpine SecDB | Alpine Linux packages |
| Amazon Linux ALAS | Amazon Linux AMI |
| Debian Security Tracker | Debian packages |
| Red Hat OVAL | RHEL, CentOS |
| Ubuntu Security | Ubuntu packages |
| Wolfi SecDB | Wolfi/Chainguard images |
Best Practices
- Pin image tags - Always scan specific digests, not
latest - Fail on severity - Set
--fail-on highorcriticalin CI gates - Use SBOMs - Generate SBOMs with Syft for reproducible scanning
- Suppress false positives - Use
.grype.yamlignore rules with documented reasons - Scan all layers - Use
--scope all-layersto catch vulnerabilities in intermediate layers - Automate database updates - Keep the vulnerability database current in CI runners
- Compare scans - Track vulnerability count over time for regression detection
File di questa versione
assets/12.1 KB
- template.md2.1 KB
references/38.2 KB
- api-reference.md1.7 KB
- standards.md2.5 KB
- workflows.md4.0 KB
scripts/211.2 KB
- agent.py4.9 KB
- process.py6.4 KB
- LICENSE11.0 KB
- SKILL.md5.8 KB
Permessi
| Permesso | Dichiarato | Trovato dalla scansione |
|---|---|---|
| Legge file | Sì | Sì |
| Scrive file | Sì | Sì |
| Esegue comandi shell | Sì | Sì |
| Usa la rete | Sì | Sì |
| Usa i connettori | No | No |
| Controlla un browser | No | No |
Segnalazioni della scansione
Rivisto il 13 nov 2026
- MediaComando · command.pipe_to_shellSKILL.md:52
- MediaComando · command.pipe_to_shellSKILL.md:62
- MediaComando · command.pipe_to_shellreferences/workflows.md:8
- MediaComando · command.pipe_to_shellreferences/workflows.md:11
- MediaFile · Script eseguibile incluso nella skillscripts/agent.py
- MediaComando · command.pipe_to_shellscripts/agent.py:35
- MediaFile · Script eseguibile incluso nella skillscripts/process.py
- InfoLink · Link a domini esterni
Una scansione pulita abbassa il rischio, ma non prova che il pacchetto sia sicuro. Leggi quello che installi.
| Versione | Pubblicata | Commit | SHA-256 | Firma | Cambio di permessi |
|---|---|---|---|---|---|
| v1.0 | 13 nov 2026 | 54a7988 | 829784ac | Firmata | – |
Altro da mukul975
Tutto da questo editore- testing-for-xml-injection-vulnerabilitiesmukul975/testing-for-xml-injection-vulnerabilities5
- testing-for-sensitive-data-exposuremukul975/testing-for-sensitive-data-exposure5
- performing-jwt-none-algorithm-attackmukul975/performing-jwt-none-algorithm-attack5
- detecting-aws-credential-exposure-with-trufflehogmukul975/detecting-aws-credential-exposure-with-trufflehog5
Altro in Linux, cloud e container
Vai alla categoria- cloud-gcpnoorqureshi/cloud-gcp4
- container-image-hardeningsecurityskills/container-image-hardening3
- performing-cloud-incident-containment-proceduresmukul975/performing-cloud-incident-containment-procedures3
- implementing-taxii-server-with-opentaxiimukul975/implementing-taxii-server-with-opentaxii3
- detecting-cryptomining-in-cloudmukul975/detecting-cryptomining-in-cloud3
- detecting-azure-service-principal-abusemukul975/detecting-azure-service-principal-abuse3
Chiedi tutto quello che il tuo perimetro consente.
Crea un account, aggiungi crediti e fai la prima domanda in chat o nel terminale.
- 1/3
Crea l'account
Privato o azienda. Puoi passare ad azienda in seguito senza perdere saldo o chiavi.
PrivatoAzienda - 2/3
Aggiungi crediti
Con carta. Paghi a token, senza abbonamento.
$5.00ricarica minima - 3/3
Chiedi
In chat, oppure installa la CLI ed esegui notholy login nel terminale.
$ notholy login