grype
БесплатноБез исполняемых скриптовНе проверенGrype is an open-source vulnerability scanner from Anchore that finds known CVEs in container images, directories and SBOMs. Use it to scan images in CI/CD…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Grype — Container Vulnerability Scanner
Overview
Grype (github.com/anchore/grype, latest release v0.120.0 at the time of writing) matches the packages it finds in an image, directory or SBOM against a local vulnerability database built from NVD, GitHub advisories and distro security feeds. It covers OS packages (Alpine, Debian, Ubuntu, RHEL, Amazon Linux, SLES and others) and language packages (Java, JavaScript, Python, Go, Ruby, PHP, .NET, Rust). Findings carry EPSS, KEV and risk scores, and OpenVEX documents can filter them. Its sibling Syft produces the SBOMs.
Instructions
Install
# macOS / Linux with Homebrew
brew tap anchore/grype && brew install grype
# Other package managers: winget install Anchore.Grype, scoop install main/grype,
# sudo port install grype, snap install grype, sudo pacman -S grype-bin
# Linux release archive, verified against the published checksum
VERSION=0.120.0
curl -sSfLO https://github.com/anchore/grype/releases/download/v${VERSION}/grype_${VERSION}_linux_amd64.tar.gz
curl -sSfLO https://github.com/anchore/grype/releases/download/v${VERSION}/grype_${VERSION}_checksums.txt
sha256sum --check --ignore-missing grype_${VERSION}_checksums.txt
tar -xzf grype_${VERSION}_linux_amd64.tar.gz grype && sudo install grype /usr/local/bin/
grype version
Anchore also documents an installer script (get.anchore.io/grype); prefer the steps above so the download is verified before it runs.
Scan
grype alpine:3.20 # image: pulled from the Docker daemon or registry
grype ghcr.io/acme-shop/api:v1.2.3
grype dir:./services/api # project directory (lockfiles, manifests)
grype docker-archive:api.tar # also oci-archive:, oci-dir:, singularity:
grype sbom:./sbom.spdx.json # SBOM file; `cat sbom.json | grype` also works
grype api:latest --fail-on high # exit 2 if any finding is high or critical
grype api:latest --only-fixed # hide vulnerabilities that have no fix yet
grype api:latest -o json > findings.json
grype api:latest -o sarif=grype.sarif # write one format to a file
grype api:latest -o table -o json=findings.json # several outputs at once
grype api:latest --show-suppressed # table output only: lists matches hidden by ignore rules or VEX
Output formats: table (default), json, sarif, cyclonedx, cyclonedx-json, template (Go template via -t). --fail-on accepts negligible, low, medium, high, critical.
Database
Grype downloads its database on first use and refreshes it when it is stale.
grype db status # location, build date, validity
grype db check # is a newer database available?
grype db update # download the latest
grype db list # available databases
In air-gapped CI, set GRYPE_DB_AUTO_UPDATE=false and ship the database directory with GRYPE_DB_CACHE_DIR.
Configuration and ignore rules
Grype reads ./.grype.yaml, ./.grype/config.yaml, ~/.grype.yaml or $XDG_CONFIG_HOME/grype/config.yaml (first found). Every key has a GRYPE_ environment variable, for example GRYPE_FAIL_ON_SEVERITY=high.
# .grype.yaml
fail-on-severity: high
only-fixed: true
ignore:
- vulnerability: CVE-2024-45337
reason: "x/crypto ServerConfig.PublicKeyCallback is not used by this service"
- vulnerability: CVE-2023-5678
package:
name: openssl
type: deb
reason: "Patched in our base image build"
- package:
location: "**/testdata/**"
- fix-state: wont-fix
reason: "Distro will not patch; tracked in SEC-412"
db:
auto-update: true
max-allowed-built-age: 120h
Rules can also match by namespace, match-type, vex-status and vex-justification. For a maintained exception list use OpenVEX: grype api:latest --vex vex.openvex.json.
Combine with Syft and GitHub Actions
syft api:v1.2.3 -o spdx-json=sbom.spdx.json
grype sbom:sbom.spdx.json --fail-on critical
cosign attest --yes --predicate sbom.spdx.json --type spdxjson ghcr.io/acme-shop/api:v1.2.3
# .github/workflows/security.yml
jobs:
scan:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- run: docker build -t api:${{ github.sha }} .
- uses: anchore/scan-action@v7
id: scan
with:
image: api:${{ github.sha }}
fail-build: true
severity-cutoff: high
- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
The action defaults to fail-build: true, severity-cutoff: medium and SARIF output. Pin third-party actions to a full commit SHA in production.
Examples
Example 1: Gate a Node.js image in CI
User request: "Fail our pipeline when the api image has a fixable high or critical CVE."
docker build -t api:ci .
grype api:ci --only-fixed
Установить grype в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл grype?
Grype is an open-source vulnerability scanner from Anchore that finds known CVEs in container images, directories and SBOMs. Use it to scan images in CI/CD, fail builds on severity, triage and suppress false positives, upload SARIF to GitHub code scanning, or scan Syft-generated SBOMs.
Как установить скилл grype?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл grype запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic