Run2 Trivy Offline

Optimized Trivy offline scanning for lock files, including all dependency types.

cxcscmu Updated

File contents

Optimized Trivy Offline Scanning

This skill covers enhanced offline scanning techniques using Trivy.

Scanning All Dependencies

By default, Trivy might skip dev dependencies. For a complete audit of a package-lock.json, use the --include-dev-deps flag.

trivy fs /path/to/target \
  --format json \
  --output report.json \
  --scanners vuln \
  --include-dev-deps \
  --skip-db-update \
  --offline-scan \
  --cache-dir /path/to/trivy/cache

Troubleshooting Database Issues

If the scan fails due to database initialization, verify the path:

  1. Ensure trivy.db is in <cache-dir>/db/.
  2. Ensure the user has read permissions to the database file.

cxcscmu/SkillLearnBench commit b6b2d84073

Frequently asked questions

npx get-skill add cxcscmu/run2-trivy-offline-2