/qa-security-scanning:trivy-imagefrom qa-security-scanning
Scans container images for vulnerabilities, secrets, misconfigurations, and licenses using Trivy. Supports severity filters, SARIF/JSON output, .trivyignore suppressions, and --ignore-unfixed for CI pipelines.
Ships in qa-security-scanning. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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 |
syft-generation for
cross-DB consensus on vuln findings.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
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
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.
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
--ignore-unfixed for actionable filterPer 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
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).Per tv-img:
trivy image --scanners misconfig --severity HIGH,CRITICAL my-image:1.0
Detects Docker / Kubernetes config patterns matching CIS Benchmarks
For comprehensive IaC scanning (not just image-internal config),
use checkov-policy
trivy-config
from the qa-iac plugin.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: ...
comment block.
For richer programmatic suppression, use OpenVEX:
trivy image --vex sbom.openvex.json --severity HIGH,CRITICAL my-image:1.0
The VEX file's per-CVE assertions (not_affected etc.) filter the
output.
Cadence: every quarter, audit .trivyignore; expired re-review-date
entries removed.
Wrap the CLI with the aquasecurity/trivy-action GHA to scan the built image
and upload SARIF to GitHub Code Scanning. The full GitHub Actions workflow is
in references/ci-and-composition.md.
Trivy is the all-in-one first line; compose it with syft-generation for a
standalone SBOM plus the Grype scan for cross-DB consensus on findings, and
checkov-policy for deeper IaC scanning. The full composition table is in
references/ci-and-composition.md.
| Anti-pattern | Why it fails | Fix |
|---|---|---|
Skip --ignore-unfixed | Stuck findings (no fix available) flood report | Always for PR gating (Step 5) |
.trivyignore without justification comment | No audit trail | Mandatory template (Step 8) |
| Run all scanners on every PR | Slow; misconfig + license noise on small changes | Default vuln+secret on PR; full scan nightly |
| Skip severity filter | LOW noise drowns CRITICAL signal | --severity CRITICAL,HIGH for PR (Step 3) |
Pin to aquasec/trivy:latest Docker tag | Breaking changes mid-release | Pin specific version |
syft-generation Step 7) for cross-DB
consensus.--vex flag)syft-generation (incl. its SBOM formats reference) - sister toolevals/customer-wants-the-bom-and-the-gate-from-one-run/criteria.json (opens in a new tab)evals/customer-wants-the-bom-and-the-gate-from-one-run/task.md (opens in a new tab)evals/eighteen-base-layer-cves-nobody-can-patch/criteria.json (opens in a new tab)evals/eighteen-base-layer-cves-nobody-can-patch/task.md (opens in a new tab)evals/hardening-change-that-quietly-stopped-cve-scanning/criteria.json (opens in a new tab)evals/hardening-change-that-quietly-stopped-cve-scanning/task.md (opens in a new tab)evals/nine-minute-pr-scan-everyone-has-learned-to-skip/criteria.json (opens in a new tab)evals/nine-minute-pr-scan-everyone-has-learned-to-skip/task.md (opens in a new tab)evals/one-digest-two-jobs-two-different-answers/criteria.json (opens in a new tab)evals/one-digest-two-jobs-two-different-answers/task.md (opens in a new tab)references/ci-and-composition.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
17 skills in this plugin
/codeql-queriesUse for any question or task about CodeQL or deep semantic static analysis (SAST) on a GitHub repo, including setting up code scanning and finding injection that flows through helper functions across files: codeql database create and analyze per language, query packs, SARIF upload to code scanning, and suppressions./cve-exploitability-triageUse when a dependency, image or SBOM scan returned more CVEs than the team can fix and someone must decide what to fix first. Ranks each CVE by EPSS exploit probability and CISA KEV status, applies VEX and reachability, and sorts findings into Fix-Now, This-Sprint, Backlog or Accept-Risk./dependabot-configUse for any question or task about Dependabot or .github/dependabot.yml, including grouping updates into one PR and taming too many update PRs: required keys, ecosystems, directories and schedules, plus ignore rules, grouped PRs, allow lists, labels, PR limits, target branches, versioning strategy and security-only updates./dependency-vulnerability-scanningUse when a repo needs dependency CVE scanning (SCA) in CI, a team is choosing between native audits (npm audit, pip-audit, cargo audit), OSV-Scanner and Snyk, or findings need triage. Scans lockfiles with thresholds, checks packages were seen, outputs SARIF and allows only expiring ignores./gitleaks-scanningUse when a team needs open-source secret scanning on commits and in CI, or is adopting it on a repo with existing leaks: gitleaks git, dir and stdin scans, custom rules and allowlists in .gitleaks.toml, pre-commit and GitHub Action setup, baselines, and TruffleHog live verification./language-native-sastUse when a repo needs security linting inside its own toolchain: Bandit for Python, gosec for Go, eslint-plugin-security and no-unsanitized for JavaScript/TypeScript, or PMD's Apex rules for Salesforce, with justified suppressions, baselines for legacy code, SARIF and CI gates.npx claudepluginhub testland/qa --plugin qa-security-scanningOther plugins' skills for the same job