Dependency Security Audit Skill
This skill scans npm package-lock.json files for known vulnerabilities using trivy's offline vulnerability database and produces a CSV audit report.
Key Concepts
- Uses trivy filesystem scanner with offline DB (no network needed)
- Filters by severity level (HIGH, CRITICAL by default)
- Extracts CVSS scores from the severity source for coherent records
- Deterministic output ordering and deduplication
- Preserves missing fixed versions as "N/A"
Usage
pythonimport sys sys.path.insert(0, '/app/environment/skills/evo-dependency-audit/scripts') from utils import run_audit, validate_audit # Run the full audit pipeline rows = run_audit( lockfile_path='/root/package-lock.json', output_csv_path='/root/security_audit.csv', severity_levels=['HIGH', 'CRITICAL'] ) print(f"Found {len(rows)} vulnerabilities") # Validate the output validate_audit('/root/security_audit.csv')
Individual Functions
All functions are in scripts/utils.py:
run_trivy_scan(lockfile_path, severity_levels, output_json_path)- Run trivy scanextract_vulnerabilities(trivy_data)- Extract vulns from trivy JSONget_cvss_score(vuln)- Get CVSS score using coherent source priorityformat_vulnerability_row(vuln)- Format a vuln into a CSV row dictdeduplicate_rows(rows)- Remove duplicate entriessort_rows(rows)- Deterministic sorting by Package, CVE_IDwrite_csv(rows, output_path)- Write CSV with proper headersrun_audit(lockfile_path, output_csv_path, severity_levels)- End-to-end entry pointvalidate_audit(csv_path)- Validate output CSV meets requirements
CSV Output Format
Columns: Package,Version,CVE_ID,Severity,CVSS_Score,Fixed_Version,Title,Url
CVSS Score Resolution
- Use the severity source (usually ghsa) for coherent record
- Fallback: ghsa -> nvd -> redhat -> any available
- Always use V3Score when available


