dependency-security-audit
Generate a HIGH/CRITICAL dependency vulnerability report for a Node.js package-lock.json using offline-first scanning (Trivy if available) and deterministic CSV output.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- dependency-security-audit
- description
- Generate a HIGH/CRITICAL dependency vulnerability report for a Node.js package-lock.json using offline-first scanning (Trivy if available) and deterministic CSV output.
02 资源文件 1
- 脚本audit_package_lock.py5.4 KB
03 SKILL.md 正文
Dependency Security Audit (offline-first)
What this skill provides
A small, deterministic audit procedure that:
- Reads a Node.js
package-lock.json - Detects HIGH and CRITICAL vulnerabilities using offline-first methods
- Normalizes findings into a required CSV schema
- Always writes the CSV (at minimum a header row) so downstream verifiers don’t fail on missing output
Supported scanners (offline-first)
-
Trivy (preferred, if present)
- Uses
trivy fswith--offline-scanand--skip-db-update - Requires a pre-existing Trivy vulnerability DB in a cache directory
- Uses
-
Fallback behavior
- If Trivy is not installed or the offline DB is missing, the script still writes a valid CSV with only the header row.
- This is intentional: it makes the behavior deterministic and avoids producing incorrect vulnerability claims without a database.
Entry point
- Script:
audit_package_lock.py
Usage
python3 skills/dependency-security-audit/audit_package_lock.py \
--lockfile /root/package-lock.json \
--output /root/security_audit.csv
Trivy configuration
By default the script looks for a Trivy DB under:
TRIVY_CACHE_DIRenv var, else./trivy-cacherelative to the current working directory
The expected DB file is:
<cache-dir>/db/trivy.db
Example:
TRIVY_CACHE_DIR=./trivy-cache python3 skills/dependency-security-audit/audit_package_lock.py \
--lockfile /root/package-lock.json \
--output /root/security_audit.csv
Output
The CSV is written with exactly these columns:
Package,Version,CVE_ID,Severity,CVSS_Score,Fixed_Version,Title,Url
Only severities HIGH and CRITICAL are included.
Notes on CVSS
When Trivy provides multiple CVSS sources, the script selects scores with this priority:
nvd → ghsa → redhat → (nvd v2) → N/A
Runtime requirements
- Python 3 (standard library only)
- Optional:
trivybinary available inPATH - Optional: offline Trivy DB present in cache dir
04 同仓库更多 Skills
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms