sca-trivy
Skill0 starsChanged 28 days agoMITView on GitHub
Software Composition Analysis (SCA) and container vulnerability scanning using Aqua Trivy for identifying CVE vulnerabilities in dependencies, container images, IaC misconfigurations, and license compliance risks. Use when: (1) Scanning container images and filesystems for vulnerabilities and misconfigurations, (2) Analyzing dependencies for known CVEs across multiple languages (Go, Python, Node.js, Java, etc.), (3) Detecting IaC security issues in Terraform, Kubernetes, Dockerfile, (4) Integrating vulnerability scanning into CI/CD pipelines with SARIF output, (5) Generating Software Bill of Materials (SBOM) in CycloneDX or SPDX format, (6) Prioritizing remediation by CVSS score and exploitability.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- morshed272/claude-build-workflowword for word, first seen Jan 18, 2026
Other versions1 project uses a version of this.
Word for word · 1
- morshed272/claude-build-workflow★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository137 other files it gives its agents.
- skills/marketing-e-vendas/humanizer/AGENTS.mdAGENTS.md
- skills/publicar-e-banco/vercel-optimize/AGENTS.mdAGENTS.md
- skills/sites-e-design/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-builderSkill
- find-skillsSkill
- kit-syncSkill
- mcp-builderSkill
- publicar-skills-githubSkill
- skill-creatorSkill
- skill-hunterSkill
- skill-inspectorSkill
- writing-skillsSkill
- curriculo-jovem-aprendizSkill
- formatador-abntSkill
- matematica-passo-a-passoSkill
- organizador-de-estudosSkill
- projeto-senai-desafioSkill
- redacao-enemSkill
- revisao-flashcardsSkill
- sympySkill
- trabalho-escolarSkill
- tutor-inglesSkill
- tutor-sqlSkill
- minecraft-construcoesSkill
- abordagem-whatsapp-vendasSkill
- adsSkill
- ai-seoSkill
- cardapio-digitalSkill
- copywritingSkill
- croSkill
- humanizar-texto-ptSkill
- humanizerSkill
- legenda-instagram-negocioSkill
- marketing-psychologySkill
- offersSkill
- orcamento-servicosSkill
- prospeccao-local-brSkill
- schemaSkill
- seo-auditSkill
- socialSkill
- brainstormingSkill
- caveman-compressSkill
- cavemanSkill
- diagnosing-superpowersSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- investigate-firstSkill
- planning-with-filesSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- surgical-patchSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- verify-and-stopSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 9 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 92
Check if fixed version is available
- Distinctive: line 94
Update dependency to patched version
- Very specific: line 164
Use bundled templates from assets/ci_integration/ for additional platforms.
- Distinctive: line 184
Supply chain security: Verify component provenance
- Distinctive: line 191
Registry credentials: Use environment variables or credential helpers, never hardcode
- Distinctive: line 199
Filesystem access: Read permissions for dependency manifests and IaC files
- Distinctive: line 214
PCI-DSS 6.2: Ensure system components protected from known vulnerabilities
- Distinctive: line 219
CWE-1104: Use of Unmaintained Third-Party Components
- Distinctive: line 332
Vulnerability Management: Import SARIF/JSON into Snyk, Qualys, or Rapid7
- Very specific: line 343
Use .trivyignore file to suppress specific CVEs with justification
- Very specific: line 354
Use cached DB: trivy image --cache-dir /path/to/cache myapp:latest
- Very specific: line 356
Use offline mode after initial DB download: --offline-scan
- Distinctive: line 365
Verify language support: Check supported languages and file patterns
- Very specific: line 366
Ensure dependency manifests are present (package.json, go.mod, requirements.txt)
- Very specific: line 394
Create trivy.yaml configuration file:
- Very specific: line 422
Create .trivyignore to suppress specific CVEs:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Software Composition Analysis with Trivy
Overview
Trivy is a comprehensive security scanner for containers, filesystems, and git repositories. It detects vulnerabilities (CVEs) in OS packages and application dependencies, IaC misconfigurations, exposed secrets, and software licenses. This skill provides workflows for vulnerability scanning, SBOM generation, CI/CD integration, and remediation prioritization aligned with CVSS and OWASP standards.
Quick Start
Scan a container image for vulnerabilities:
# Install Trivy
brew install trivy # macOS
# or: apt-get install trivy # Debian/Ubuntu
# or: docker pull aquasec/trivy:latest
# Scan container image
trivy image nginx:latest
# Scan local filesystem for dependencies
trivy fs .
# Scan IaC files for misconfigurations
trivy config .
# Generate SBOM
trivy image --format cyclonedx --output sbom.json nginx:latestCore Workflows
Workflow 1: Container Image Security Assessment
Progress:
[ ] 1. Identify target container image (repository:tag)
[ ] 2. Run comprehensive Trivy scan with trivy image <image-name>
[ ] 3. Analyze vulnerability findings by severity (CRITICAL, HIGH, MEDIUM, LOW)
[ ] 4. Map CVE findings to CWE categories and OWASP references
[ ] 5. Check for available patches and updated base images
[ ] 6. Generate prioritized remediation report with upgrade recommendations
Work through each step systematically. Check off completed items.
Workflow 2: Dependency Vulnerability Scanning
Scan project dependencies for known vulnerabilities:
# Scan filesystem for all dependencies
trivy fs --severity CRITICAL,HIGH .
# Scan specific package manifest
trivy fs --scanners vuln package-lock.json
# Generate JSON report for analysis
trivy fs --format json --output trivy-report.json .
# Generate SARIF for GitHub/GitLab integration
trivy fs --format sarif --output trivy.sarif .For each vulnerability:
- Review CVE details and CVSS score
- Check if fixed version is available
- Consult
references/remediation_guide.mdfor language-specific guidance - Update dependency to patched version
- Re-scan to validate fix
Workflow 3: Infrastructure as Code Security
Detect misconfigurations in IaC files:
# Scan Terraform configurations
trivy config ./terraform --severity CRITICAL,HIGH
# Scan Kubernetes manifests
trivy config ./k8s --severity CRITICAL,HIGH
# Scan Dockerfile best practices
trivy config --file-patterns dockerfile:Dockerfile .
# Generate report with remediation guidance
trivy config --format json --output iac-findings.json .Review findings by category:
- Security: Authentication, authorization, encryption
- Compliance: CIS benchmarks, security standards
- Best Practices: Resource limits, immutability, least privilege
Workflow 4: CI/CD Pipeline Integration
GitHub Actions
name: Trivy Security Scan
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload results to GitHub Security
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'GitLab CI
trivy-scan:
stage: test
image: aquasec/trivy:latest
script:
- trivy fs --exit-code 1 --severity CRITICAL,HIGH --format json --output trivy-report.json .
artifacts:
reports:
dependency_scanning: trivy-report.json
when: always
allow_failure: falseUse bundled templates from assets/ci_integration/ for additional platforms.
Workflow 5: SBOM Generation
Generate Software Bill of Materials for supply chain transparency:
# Generate CycloneDX SBOM
trivy image --format cyclonedx --output sbom-cyclonedx.json nginx:latest
# Generate SPDX SBOM
trivy image --format spdx-json --output sbom-spdx.json nginx:latest
# SBOM for filesystem/project
trivy fs --format cyclonedx --output project-sbom.json .SBOM use cases:
- Vulnerability tracking: Monitor dependencies for new CVEs
- License compliance: Identify license obligations and risks
- Supply chain security: Verify component provenance
- Regulatory compliance: Meet CISA SBOM requirements
Security Considerations
Sensitive Data Handling
- Registry credentials: Use environment variables or credential helpers, never hardcode
- Scan reports: Contain vulnerability details and package versions - treat as sensitive
- SBOM files: May reveal internal architecture - control access appropriately
- Secret scanning: Enable with
--scanners secretto detect exposed credentials in images
Access Control
- Container registry access: Requires pull permissions for image scanning
- Filesystem access: Read permissions for dependency manifests and IaC files
- CI/CD integration: Secure API tokens and registry credentials in secrets management
- Report storage: Restrict access to vulnerability reports and SBOM artifacts
Audit Logging
Log the following for compliance and incident response:
- Scan execution timestamps and scope (image, filesystem, repository)
- Vulnerability counts by severity level
- Policy violations and blocking decisions
- SBOM generation and distribution events
- Remediation actions and version updates
Compliance Requirements
- PCI-DSS 6.2: Ensure system components protected from known vulnerabilities
- SOC2 CC7.1: Detect and act upon changes that could affect security
- NIST 800-53 SI-2: Flaw remediation and vulnerability scanning
- CIS Benchmarks: Container and Kubernetes security hardening
- OWASP Top 10 A06: Vulnerable and Outdated Components
- CWE-1104: Use of Unmaintained Third-Party Components
Bundled Resources
Scripts (scripts/)
trivy_scan.py- Comprehensive scanning with JSON/SARIF output and severity filteringsbom_generator.py- SBOM generation with CycloneDX and SPDX format supportvulnerability_report.py- Parse Trivy output and generate remediation reports with CVSS scoresbaseline_manager.py- Baseline creation for tracking new vulnerabilities only
References (references/)
scanner_types.md- Detailed guide for vulnerability, misconfiguration, secret, and license scanningremediation_guide.md- Language and ecosystem-specific remediation strategiescvss_prioritization.md- CVSS score interpretation and vulnerability prioritization frameworkiac_checks.md- Complete list of IaC security checks with CIS benchmark mappings
Assets (assets/)
trivy.yaml- Custom Trivy configuration with security policies and ignore rulesci_integration/github-actions.yml- Complete GitHub Actions workflow with security gatesci_integration/gitlab-ci.yml- Complete GitLab CI pipeline with dependency scanningci_integration/jenkins.groovy- Jenkins pipeline with Trivy integrationpolicy_template.rego- OPA policy template for custom vulnerability policies
Common Patterns
Pattern 1: Multi-Stage Security Scanning
Comprehensive security assessment combining multiple scan types:
# 1. Scan container image for vulnerabilities
trivy image --severity CRITICAL,HIGH myapp:latest
# 2. Scan IaC for misconfigurations
trivy config ./infrastructure --severity CRITICAL,HIGH
# 3. Scan filesystem for dependency vulnerabilities
trivy fs --severity CRITICAL,HIGH ./app
# 4. Scan for exposed secrets
trivy fs --scanners secret ./app
# 5. Generate comprehensive SBOM
trivy image --format cyclonedx --output sbom.json myapp:latestPattern 2: Baseline Vulnerability Tracking
Implement baseline scanning to track only new vulnerabilities:
# Initial scan - create baseline
trivy image --format json --output baseline.json nginx:latest
# Subsequent scans - detect new vulnerabilities
trivy image --format json --output current.json nginx:latest
./scripts/baseline_manager.py --baseline baseline.json --current current.jsonPattern 3: License Compliance Scanning
Detect license compliance risks:
# Scan for license information
trivy image --scanners license --format json --output licenses.json myapp:latest
# Filter by license type
trivy image --scanners license --severity HIGH,CRITICAL myapp:latestReview findings:
- High Risk: GPL, AGPL (strong copyleft)
- Medium Risk: LGPL, MPL (weak copyleft)
- Low Risk: Apache, MIT, BSD (permissive)
Pattern 4: Custom Policy Enforcement
Apply custom security policies with OPA:
# Create Rego policy in assets/policy_template.rego
# Deny images with CRITICAL vulnerabilities or outdated packages
# Run scan with policy enforcement
trivy image --format json --output scan.json myapp:latest
trivy image --ignore-policy assets/policy_template.rego myapp:latestIntegration Points
CI/CD Integration
- GitHub Actions: Native
aquasecurity/trivy-actionwith SARIF upload to Security tab - GitLab CI: Dependency scanning report format for Security Dashboard
- Jenkins: Docker-based scanning with JUnit XML report generation
- CircleCI: Docker executor with artifact storage
- Azure Pipelines: Task-based integration with results publishing
Container Platforms
- Docker: Image scanning before push to registry
- Kubernetes: Admission controllers with trivy-operator for runtime scanning
- Harbor: Built-in Trivy integration for registry scanning
- AWS ECR: Scan images on push with enhanced scanning
- Google Artifact Registry: Vulnerability scanning integration
Security Tools Ecosystem
- SIEM Integration: Export JSON findings to Splunk, ELK, or Datadog
- Vulnerability Management: Import SARIF/JSON into Snyk, Qualys, or Rapid7
- SBOM Tools: CycloneDX and SPDX compatibility with dependency-track and GUAC
- Policy Enforcement: OPA/Rego integration for custom policy as code
Troubleshooting
Issue: High False Positive Rate
Symptoms: Many vulnerabilities reported that don't apply to your use case
Solution:
- Use
.trivyignorefile to suppress specific CVEs with justification - Filter by exploitability:
trivy image --ignore-unfixed myapp:latest - Apply severity filtering:
--severity CRITICAL,HIGH - Review vendor-specific security advisories for false positive validation
- See
references/false_positives.mdfor common patterns
Issue: Performance Issues on Large Images
Symptoms: Scans taking excessive time or high memory usage
Solution:
- Use cached DB:
trivy image --cache-dir /path/to/cache myapp:latest - Skip unnecessary scanners:
--scanners vuln(exclude config, secret) - Use offline mode after initial DB download:
--offline-scan - Increase timeout:
--timeout 30m - Scan specific layers:
--removed-pkgsto exclude removed packages
Issue: Missing Vulnerabilities for Specific Languages
Symptoms: Expected CVEs not detected in application dependencies
Solution:
- Verify language support: Check supported languages and file patterns
- Ensure dependency manifests are present (package.json, go.mod, requirements.txt)
- Include lock files for accurate version detection
- For compiled binaries, scan source code separately
- Consult
references/scanner_types.mdfor language-specific requirements
Issue: Registry Authentication Failures
Symptoms: Unable to scan private container images
Solution:
# Use Docker credential helper
docker login registry.example.com
trivy image registry.example.com/private/image:tag
# Or use environment variables
export TRIVY_USERNAME=user
export TRIVY_PASSWORD=pass
trivy image registry.example.com/private/image:tag
# Or use credential file
trivy image --username user --password pass registry.example.com/private/image:tagAdvanced Configuration
Custom Trivy Configuration
Create trivy.yaml configuration file:
# trivy.yaml
vulnerability:
type: os,library
severity: CRITICAL,HIGH,MEDIUM
ignorefile: .trivyignore
ignore-unfixed: false
skip-files:
- "test/**"
- "**/node_modules/**"
cache:
dir: /tmp/trivy-cache
db:
repository: ghcr.io/aquasecurity/trivy-db:latest
output:
format: json
severity-sort: trueUse with: trivy image --config trivy.yaml myapp:latest
Trivy Ignore File
Create .trivyignore to suppress specific CVEs:
# .trivyignore
# False positive - patched in vendor fork
CVE-0000-12345
# Risk accepted by security team - JIRA-1234
CVE-0000-67890
# No fix available, compensating controls in place
CVE-0000-11111Offline Air-Gapped Scanning
For air-gapped environments:
# On internet-connected machine:
trivy image --download-db-only --cache-dir /path/to/db
# Transfer cache to air-gapped environment
# On air-gapped machine:
trivy image --skip-db-update --cache-dir /path/to/db --offline-scan myapp:latestReferences
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

