trivy
БесплатноБез исполняемых скриптовНе проверенTrivy is an open-source scanner from Aqua Security that finds vulnerabilities, exposed secrets, misconfigurations and license problems in container images…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Trivy
Overview
Trivy is an open-source vulnerability scanner by Aqua Security (current release v0.75.0). One binary scans container images, filesystems and lockfiles, git repositories, SBOMs, and IaC (Terraform, Kubernetes, Dockerfile, CloudFormation, Helm) for known CVEs, misconfigurations, hard-coded secrets and licenses. It needs no account; it downloads a vulnerability database on first use and caches it. Docs: https://trivy.dev/docs/.
Instructions
Step 1: Install
Use a package manager, or a release archive verified against its published checksum. Do not pipe the install script into a shell.
brew install trivy # macOS / Linux
# Debian/Ubuntu: add the signed apt repository from the install docs, then: sudo apt-get install trivy
# Or a release archive, verified:
VERSION=0.75.0
curl -sLO https://github.com/aquasecurity/trivy/releases/download/v${VERSION}/trivy_${VERSION}_Linux-64bit.tar.gz
curl -sLO https://github.com/aquasecurity/trivy/releases/download/v${VERSION}/trivy_${VERSION}_checksums.txt
sha256sum --check --ignore-missing trivy_${VERSION}_checksums.txt
tar -xzf trivy_${VERSION}_Linux-64bit.tar.gz trivy
trivy --version
Official container images: aquasec/trivy, ghcr.io/aquasecurity/trivy. Never use v0.69.4 (see Guidelines).
Step 2: Container image scanning
trivy image node:20-alpine
trivy image --severity HIGH,CRITICAL --ignore-unfixed registry.lumenshop.io/api:1.8.2
trivy image --format json --output results.json registry.lumenshop.io/api:1.8.2
trivy image --input api-image.tar # image saved with `docker save`
By default Trivy looks for the image in the local Docker, containerd and Podman stores, then the remote registry (--image-src changes the order). It scans OS packages and language dependencies inside the image.
Step 3: Filesystem, repo and secret scan
trivy fs reads lockfiles (package-lock.json, poetry.lock, go.mod, Gemfile.lock ...) without installing anything. Default scanners are vuln,secret; add misconfig or license explicitly.
trivy fs .
trivy fs --scanners vuln,secret,misconfig --severity HIGH,CRITICAL .
trivy fs --scanners license .
trivy repo https://github.com/aquasecurity/trivy-ci-test # scan a remote git repo
Step 4: IaC scanning
trivy config ./terraform/
trivy config --severity HIGH,CRITICAL ./k8s/
Each finding has an ID (for example AWS-0107), the file and line range, and a link to the check at avd.aquasec.com.
Step 5: SBOM, output formats, CI gating
trivy fs --format cyclonedx --output sbom.cdx.json . # also: spdx-json
trivy image --format sarif --output trivy.sarif registry.lumenshop.io/api:1.8.2
trivy sbom sbom.cdx.json # scan an existing SBOM for vulnerabilities
trivy image --exit-code 1 --severity CRITICAL --ignore-unfixed registry.lumenshop.io/api:1.8.2
--exit-code 1 makes the command fail when findings match the severity filter (the default exit code is 0 even with findings). Suppress accepted risks with a .trivyignore file (one ID per line, for example CVE-2020-8203) or .trivyignore.yaml with expiry dates. In air-gapped or rate-limited CI, cache ~/.cache/trivy and use --skip-db-update after a first download.
Examples
Example 1: Scan a repo before release
User request: "Check this Node project for vulnerable dependencies and leaked keys before I tag a release."
trivy fs --scanners vuln,secret --severity HIGH,CRITICAL .
Result (tested against a lockfile pinning lodash 4.17.15): a summary table with package-lock.json npm 4 vulnerabilities, then rows such as lodash CVE-2020-8203 HIGH fixed 4.17.15 4.17.19. The agent bumps lodash to the fixed version, reinstalls to refresh the lockfile, and re-runs the scan until the table shows 0.
Example 2: Gate CI on images and Terraform
User request: "Fail the pipeline if our Docker image has fixable critical CVEs, and check the Terraform in infra/."
trivy image --exit-code 1 --severity CRITICAL --ignore-unfixed registry.lumenshop.io/api:${GIT_SHA}
trivy config --exit-code 1 --severity HIGH,CRITICAL infra/
On a bucket without a public access block and a security group open to 0.0.0.0/0 on port 22, trivy config reports AWS-0093 and AWS-0107 with the offending lines and exits 1, which fails the job. Install Trivy in the CI job with the verified-download steps above.
Guidelines
- Supply-chain incident (March 2026): Trivy v0.69.4 binaries, the Docker Hub images of v0.69.5 and v0.69.6, and the version tags of
aquasecurity/trivy-actionandsetup-trivywere replaced with credential-stealing code. Use current releases, verify checksums, and in GitHub Actions pin third-party actions to a full commit SHA, never a tag. Details: https://github.com/aquasecurity/trivy/security/advisories/GHSA-69fq-xp46-6x23. - Results are only as fresh as the vulnerability dat
Установить trivy в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл trivy?
Trivy is an open-source scanner from Aqua Security that finds vulnerabilities, exposed secrets, misconfigurations and license problems in container images, filesystems, git repos and IaC files. Use when a user asks to scan a Docker image for CVEs, audit a repo for leaked secrets, check Terraform or Kubernetes manifests for misconfigurations, generate an SBOM, or add security scanning to CI.
Как установить скилл trivy?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл trivy запускает скрипты?
Нет, скилл состоит только из инструкций (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