360 Secure SkillHub
360 安全技能中心

sca-audit

面向 package.json、requirements.txt、go.mod 等依赖清单与锁文件,调用 osv-scanner、npm audit、pip-audit 等外部扫描器发现已知 CVE,分析可达性与修复方式,结合依赖健康度输出按严重度排序的发现和修复命令;未安装扫描器时需先安装,否则无法完成分析。

分类:安全
OWASP
热度 0.00
最近更新 2026-10-29 17:17:55

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add owasp/secure-agent-playbook/sca-audit
兼容性
通用兼容
联网要求
需要联网
数据出网
可选出网
Metadata
name
sca-audit
description
Scan project dependencies for known vulnerabilities (CVEs). Use when reviewing dependency files (package.json, requirements.txt, go.mod, pom.xml, Gemfile, Cargo.toml, etc.), triaging Dependabot/Renovate alerts, or performing pre-deployment security checks.
license
CC-BY-4.0

Software Composition Analysis Audit

Scan dependencies for known CVEs by following the full procedure in plays/sca-audit.md.

Steps

  1. Identify Dependency Manifests — Scan for all dependency files and lockfiles across ecosystems (Node.js, Python, Go, Java, Ruby, Rust, .NET, PHP). Prefer lockfiles for exact resolved versions.

  2. Run Vulnerability Scan — Use available tools in preference order:

    • osv-scanner --lockfile=<path> --format=json (recommended, multi-ecosystem)
    • npm audit --json (Node.js)
    • pip-audit -r requirements.txt --format=json (Python)
    • govulncheck ./... (Go)
    • trivy fs --format json --scanners vuln <path> (multi-ecosystem)
    • If no scanner is installed, stop and ask the user to install one (e.g., brew install osv-scanner). Manual analysis is not viable — even small projects have 50+ dependencies. For individual package triage, point the user to OSV.dev.
  3. Analyze Results — For each vulnerability: determine reachability (is the vulnerable code path used?), check exploitability context (deployment matters), and identify fix availability (patch vs major version bump).

  4. Dependency Health — Beyond CVEs, flag unmaintained packages (2+ years inactive), typosquatting risks, license concerns, and version pinning issues.

Output

Scan summary (ecosystems, dependency count, scanner used), findings sorted by severity using templates/finding.md, condensed table for medium/low, dependency health flags, and exact remediation commands.

OWASP References

  • A06:2021: Vulnerable and Outdated Components
  • OWASP Dependency-Check
  • OWASP SCVS