Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

trivy-config

БесплатноБез исполняемых скриптовНе проверен

Use for any question or task about scanning infrastructure code for misconfigurations with one tool, including Kubernetes manifests, Terraform…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

trivy-config

Overview

Trivy is Aqua Security's consolidated misconfiguration scanner (trivy config) and the forward path from tfsec. Per the tfsec legacy reference, trivy.dev misconfiguration docs, and Aqua's own documentation, new projects should evaluate Trivy first; tfsec's checks ship inside Trivy under trivy config.

Pinned versions

Bump these together when updating; they are the only version-sensitive tokens in this skill. GitHub release assets are version-stamped, so the RPM URL in Step 1 pins a tag rather than using latest/download.

Component Pin Used in
Trivy v0.72.0 (latest as of 2026-06-30) Step 1 install
aquasecurity/trivy-action 0.31.0 CI workflow (Step 7)
actions/checkout v5 CI workflow (Step 7)
github/codeql-action/upload-sarif v3 CI workflow (Step 7)

Step 1 - Install

Per trivy.dev installation docs:

# macOS
brew install trivy

# Docker (no local install)
docker run --rm -v $(pwd):/workspace aquasec/trivy config /workspace

Debian / Ubuntu and RHEL / Fedora hosts can also install Trivy from the project's apt repository or a release .rpm package (pin the tag from the Pinned versions section above), per inst. Both add a system package source and need root, so bake them into the runner image or config management rather than running them from a scan session. In CI, use the pinned aquasecurity/trivy-action from Step 7 instead.

Verify: trivy --version.

Step 2 - First scan

Per cli reference, trivy config accepts a path (file or directory). Trivy auto-detects IaC types - Terraform, CloudFormation, Kubernetes manifests, Helm charts, Dockerfiles, and Azure ARM templates can all coexist in the same directory per mc docs.

# Scan the current directory (all IaC types)
trivy config .

# Scan a specific subdirectory
trivy config ./infra/

# Show only HIGH and CRITICAL findings
trivy config --severity HIGH,CRITICAL .

# Fail CI when any finding is found (exit code 1)
trivy config --exit-code 1 --severity HIGH,CRITICAL .

# Include passed checks alongside failures
trivy config --include-non-failures .

Built-in checks are distributed as an OPA bundle at ghcr.io/aquasecurity/trivy-checks (per checks repo). Trivy caches the bundle locally and refreshes every 24 hours. An embedded fallback is included in the binary for air-gapped environments.

Step 3 - Severity gating

Per cli reference, --exit-code and --severity are the two levers for CI gating:

Flag Purpose Example
--exit-code int Exit code when findings match --exit-code 1
--severity strings Comma-separated severity filter HIGH,CRITICAL

Pattern: gate hard on CRITICAL first; expand to HIGH after the team has reviewed the initial finding set.

# Hard fail on CRITICAL only (bootstrap phase)
trivy config --exit-code 1 --severity CRITICAL .

# Ratchet: add HIGH once existing findings are triaged
trivy config --exit-code 1 --severity HIGH,CRITICAL .

Step 4 - Output formats

Per trivy.dev reporting docs, --format accepts:

Value Use case
table (default) Human-readable terminal output
json Machine-parseable; pipe to jq
sarif GitHub Code Scanning / SARIF 2.1.0
template Custom templates (JUnit, ASFF, HTML via contrib/)
# JSON for parsing / badge generation
trivy config --format json --output trivy.json .

# SARIF for GitHub Code Scanning
trivy config --format sarif --output trivy.sarif .

# JUnit XML for CI test reporting
trivy config --format template \
  --template "@contrib/junit.tpl" \
  --output trivy-junit.xml .

Step 5 - Suppressing findings

Per trivy.dev filtering docs:

.trivyignore (check-ID list)

# .trivyignore
# Suppress a specific misconfig check
AVD-DS-0002

# Suppress a CVE alongside a misconfig in the same file
CVE-2018-14618

.trivyignore.yaml (structured suppression)

Per filter docs, the YAML variant supports scoped expiring suppressions:

# .trivyignore.yaml
misconfigurations:
  - id: AVD-DS-0001
  - id: AVD-DS-0002
    paths:
      - "infra/legacy/Dockerfile"
    statement: "Legacy image; migration tracked in JIRA-4321"
    expired_at: "2026-12-31"

Run with: trivy config --ignorefile ./.trivyignore.yaml .

Per cli reference, --ignorefile

Полный SKILL.md на GitHub

Установить trivy-config в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonreferences/tfsec-custom-rules-and-ci.mdreferences/tfsec-legacy.mdreferences/trivy-config.md

FAQ

Что делает скилл trivy-config?

Use for any question or task about scanning infrastructure code for misconfigurations with one tool, including Kubernetes manifests, Terraform, CloudFormation, Helm, ARM and Dockerfiles that run as root, or migrating off tfsec: trivy config with severity gating, .trivyignore suppressions, custom Rego checks and SARIF for GitHub code scanning. Legacy tfsec is in its references.

Как установить скилл trivy-config?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл trivy-config запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить trivy-config с