trivy-image
БесплатноБез исполняемых скриптовНе проверенUse for any question or task about scanning a container or Docker image for vulnerabilities, secrets, misconfigurations or licenses, including failing CI only…
от testland★ 18 звёзд на GitHubОб этом скилле
trivy-image
Overview
Per trivy.dev/latest/docs/target/container_image/:
Trivy is Aqua Security's open-source scanner. Distinguishing
feature: all-in-one - one CLI invocation covers vuln + secret +
misconfig + license scanning. By contrast, syft-generation's
Grype workflow is a two-step
SBOM-then-scan pattern.
Per tv-img the scanner toggles:
| Scanner | Default? | Use |
|---|---|---|
vuln |
yes | Known CVEs in OS + language packages |
secret |
yes | Exposed credentials (env vars, config files) |
misconfig |
no | Docker / Kubernetes config best-practices |
license |
no | License compliance scanning |
When to use
- Container-image security in one tool (vs separate tools per concern).
- The team uses Aqua Security stack (Trivy is the OSS center of it).
- Pre-prod or registry-side scanning (Trivy's image-by-tag mode).
- Layered with the Grype workflow in
syft-generationfor cross-DB consensus on vuln findings.
Step 1 - Install
Common install paths:
# Homebrew (macOS / Linux)
brew install trivy
# Docker (zero-install for CI)
docker pull aquasec/trivy:latest
# Linux APT
sudo apt-get install trivy
# RPM
sudo dnf install trivy
Step 2 - Basic image scan
Per tv-img:
# Default: vuln + secret scan
trivy image python:3.4-alpine
Example with multiple toggles:
# All scanners (vuln + secret + misconfig + license)
trivy image --scanners vuln,secret,misconfig,license python:3.4-alpine
# Vuln-only (fastest, default if --scanners omitted defaults to vuln+secret)
trivy image --scanners vuln python:3.4-alpine
Step 3 - Severity filtering
Per tv-img:
trivy image --severity HIGH,CRITICAL python:3.4-alpine
Severity levels: UNKNOWN, LOW, MEDIUM, HIGH, CRITICAL.
Combined with exit-code-on-finding:
trivy image --severity HIGH,CRITICAL --exit-code 1 python:3.4-alpine
Exit code semantics: 0 = no findings at the configured severity;
1 = findings present.
Step 4 - Output formats
Per tv-img:
| Format | Use |
|---|---|
json |
For multi-scanner finding prioritization |
sarif |
GitHub Code Scanning upload |
cyclonedx |
CycloneDX SBOM with vuln annotations |
spdx-json |
SPDX SBOM (vuln-only metadata) |
template |
Custom Go template |
| (default) | Table format human-readable |
trivy image --format json --output trivy-image.json my-image:1.0
trivy image --format sarif --output trivy-image.sarif my-image:1.0
trivy image --format cyclonedx --output trivy-cyclonedx.json my-image:1.0
Step 5 - --ignore-unfixed for actionable filter
Per tv-img, --ignore-unfixed excludes vulnerabilities without an
available fix - the practical first-line filter for actionable findings:
trivy image --ignore-unfixed python:3.4-alpine
Combine with a severity threshold for the recommended PR-blocking config (fail only on actionable, high-severity vulns):
trivy image --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 my-image:1.0
Step 6 - Secret scanning
Per tv-img:
"Secret detection runs automatically. The tool scans for exposed credentials and sensitive data, particularly in environment variables."
Secret findings appear alongside vuln findings in the same report.
For deeper secret-scanning patterns, see gitleaks-scanning
gitleaks-scanning(TruffleHog in its references).
Step 7 - Misconfiguration scanning
Per tv-img:
trivy image --scanners misconfig --severity HIGH,CRITICAL my-image:1.0
Detects Docker / Kubernetes config patterns matching CIS Benchmarks
- team-policy issues (e.g., container running as root, missing HEALTHCHECK, exposed sensitive ports).
For comprehensive IaC scanning (not just image-internal config),
use checkov-policy
trivy-configfrom the qa-iac plugin.
Step 8 - False-positive triage (MANDATORY)
Per tv-img: "Use a .trivyignore file to suppress
specific findings. Place this file in your project directory with
CVE IDs or vulnerability identifiers you wish to exclude."
Suppression mechanisms:
| Mechanism | Use |
|---|---|
.trivyignore file |
Per-CVE / per-misconfig-rule ID list |
--ignore-unfixed flag |
Filter to actionable findings only |
--vex (VEX file) |
Standardized status assertions (CycloneDX-VEX or OpenVEX) |
--ignore-policy Rego policy |
Programmatic ignore via OPA Rego |
.trivyignore example:
# .trivyignore
# Reason: log4j-core 2.14.x bundled but not loaded at runtime
# (verified via dependency tree analysis)
# Approved-by: [email protected]
# Re-review-date: 2026-09-15
CVE-2021-44228
CVE-2021-45046
# Misconfiguration ignores
DS013
KSV001
Justification template (mandatory): every entry in .trivyignore
should be preceded by `# Reason: ... # Approved-by: ... # Re-review-date: ..
Установить trivy-image в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл trivy-image?
Use for any question or task about scanning a container or Docker image for vulnerabilities, secrets, misconfigurations or licenses, including failing CI only on fixable critical CVEs and base-image CVEs with no fix: trivy image with severity filters, SARIF or JSON output, .trivyignore suppressions, --ignore-unfixed and scanner toggles. For a standalone SBOM use syft-generation.
Как установить скилл trivy-image?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл trivy-image запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub