---
name: "trivy-container-security-scanner"
description: "Scan container images, file systems, Git repos, and cloud configs for CVEs and misconfigs."
metadata:
  author: "Aqua Security"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "scan container image trivy"
  - "run trivy filesystem scan"
  - "export trivy sarif report"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Trivy All-in-One Container & Filesystem Scanner

Performs comprehensive security scanning using Aqua Security Trivy: OS packages, language dependencies, Terraform misconfigurations, exposed secrets, and Kubernetes security checks.

## When to Invoke
Invoke this skill whenever you need to:
- scan container image trivy
- run trivy filesystem scan
- export trivy sarif report

## Execution SOP & Rules
1. Execute trivy image --severity HIGH,CRITICAL --exit-code 1 <image_name>.
2. Scan repository filesystem with trivy fs --scanners vuln,secret,config .
3. Filter out unfixed vulnerabilities with --ignore-unfixed to reduce notification fatigue.
4. Cache the Trivy vulnerability database in CI runners to minimize scan turnaround time.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
