skills/depscan/SKILL.md
Run OWASP Depscan for advanced Software Composition Analysis with VDR, CSAF, and license compliance. Use when scanning dependencies with deep SCA, generating VEX documents, SBOM+VDR analysis, or comprehensive license auditing.
npx skillsauth add igbuend/grimbard depscanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ideal scenarios:
Complements other tools:
Do NOT use this skill for:
# pip/pipx (recommended)
pipx install owasp-depscan
# pip
pip install owasp-depscan
# With SARIF tools
pipx install owasp-depscan sarif-tools
# Docker
docker pull ghcr.io/owasp-dep-scan/dep-scan:latest
# From source
git clone https://github.com/owasp-dep-scan/dep-scan.git
cd dep-scan
pip install .
# Verify
depscan --version
# Scan current directory
depscan --src .
# Scan specific directory
depscan --src /path/to/project
# Scan with reports directory
depscan --src /path/to/project --reports-dir ./reports
# Generate SARIF report
depscan --src /path/to/project \
--reports-dir ./reports \
--report-template sarif
# Multiple report formats
depscan --src /path/to/project \
--reports-dir ./reports \
--report-template sarif,json,html
# Critical vulnerabilities only (SARIF)
depscan --src /path/to/project \
--reports-dir ./reports \
--report-template sarif-critical
# Create CycloneDX SBOM
depscan --src /path/to/project \
--reports-dir ./reports \
--type bom
# SBOM with VDR (Vulnerability Disclosure Report)
depscan --src /path/to/project \
--reports-dir ./reports \
--type sbom-vdr
# Use existing SBOM
depscan --bom /path/to/sbom.json --reports-dir ./reports
# Generate CSAF 2.0 VEX
depscan --src /path/to/project \
--reports-dir ./reports \
--vex
# VEX with existing SBOM
depscan --bom sbom.json \
--reports-dir ./reports \
--vex
| Ecosystem | Manifest Files | Lock Files | |-----------|----------------|------------| | npm | package.json | package-lock.json, yarn.lock, pnpm-lock.yaml | | Python | requirements.txt, setup.py, pyproject.toml | Pipfile.lock, poetry.lock, pdm.lock | | Go | go.mod | go.sum | | Rust | Cargo.toml | Cargo.lock | | Java/Maven | pom.xml | - | | Gradle | build.gradle, build.gradle.kts | - | | Ruby | Gemfile | Gemfile.lock | | PHP | composer.json | composer.lock | | .NET | packages.config, *.csproj | packages.lock.json, paket.lock | | Dart | pubspec.yaml | pubspec.lock | | Swift | Package.swift | Package.resolved |
# Enable risk audit
depscan --src /path/to/project \
--reports-dir ./reports \
--risk-audit
# Risk score is calculated based on:
# - Vulnerability severity
# - CVSS scores
# - Exploitability
# - Attack complexity
# - Package popularity
# - Maintenance status
# License audit
depscan --src /path/to/project \
--reports-dir ./reports \
--license-scan
# Fail on license violations
depscan --src /path/to/project \
--reports-dir ./reports \
--license-scan \
--no-banner \
--fail-on-license-violation
Depscan includes CDXGen for SBOM generation:
# Use cdxgen directly
cdxgen -r /path/to/project -o sbom.json
# Generate SBOM with evidence
cdxgen -r /path/to/project -o sbom.json --evidence
# Multiple languages
cdxgen -r /monorepo -o sbom.json --multi-language
# Then scan SBOM
depscan --bom sbom.json --reports-dir ./reports
# Python specific
depscan --src /python/project --type python --reports-dir ./reports
# Node.js specific
depscan --src /nodejs/project --type nodejs --reports-dir ./reports
# Java specific
depscan --src /java/project --type java --reports-dir ./reports
# Go specific
depscan --src /go/project --type go --reports-dir ./reports
name: OWASP Depscan
on:
push:
branches: [main]
pull_request:
schedule:
- cron: '0 0 * * *' # Daily
jobs:
depscan:
runs-on: ubuntu-latest
container: ghcr.io/owasp-dep-scan/dep-scan:latest
steps:
- uses: actions/checkout@v4
- name: Run Depscan
run: |
depscan --src ${{ github.workspace }} \
--reports-dir ${{ github.workspace }}/reports \
--report-template sarif,json,html \
--risk-audit \
--license-scan
- name: Upload SARIF
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: reports/depscan.sarif
category: depscan
- name: Upload Reports
if: always()
uses: actions/upload-artifact@v4
with:
name: depscan-reports
path: reports/
- name: Generate SBOM
run: |
cdxgen -r ${{ github.workspace }} \
-o reports/sbom.json \
--evidence
- name: Upload SBOM
uses: actions/upload-artifact@v4
with:
name: sbom
path: reports/sbom.json
# SARIF (all vulnerabilities)
--report-template sarif
# SARIF (critical only)
--report-template sarif-critical
# JSON format
--report-template json
# HTML report
--report-template html
# Custom template
--report-template custom.j2
Create custom-report.j2:
# Vulnerability Report
Project: {{ project_name }}
Scan Date: {{ scan_date }}
## Summary
Total Vulnerabilities: {{ total_vulnerabilities }}
- Critical: {{ critical_count }}
- High: {{ high_count }}
- Medium: {{ medium_count }}
- Low: {{ low_count }}
## Vulnerabilities
{% for vuln in vulnerabilities %}
### {{ vuln.id }} - {{ vuln.severity }}
**Package:** {{ vuln.package }}@{{ vuln.version }}
**Fixed in:** {{ vuln.fixed_version }}
**CVSS:** {{ vuln.cvss_score }}
{{ vuln.description }}
---
{% endfor %}
Use custom template:
depscan --src /path/to/project \
--reports-dir ./reports \
--report-template custom-report.j2
Create depscan.toml:
# Source paths
src = "/path/to/project"
reports_dir = "./reports"
# Scan options
risk_audit = true
license_scan = true
no_banner = true
# Report formats
report_template = ["sarif", "json", "html"]
# VEX generation
vex = true
# Fail conditions
fail_on_license_violation = false
# Exclude paths
exclude = [
"**/test/**",
"**/tests/**",
"**/node_modules/**",
"**/.venv/**"
]
# License allowlist
allowed_licenses = [
"MIT",
"Apache-2.0",
"BSD-3-Clause",
"BSD-2-Clause",
"ISC"
]
Use config:
depscan --config depscan.toml
# Full audit with all features
depscan --src /path/to/project \
--reports-dir ./audit-reports \
--report-template sarif,json,html \
--risk-audit \
--license-scan \
--vex
# Review reports
ls -la ./audit-reports/
# - depscan.sarif
# - depscan.json
# - depscan.html
# - bom.json (SBOM)
# - vex.json (VEX document)
# Step 1: Generate SBOM with evidence
cdxgen -r /path/to/project -o sbom.json --evidence
# Step 2: Scan SBOM for vulnerabilities
depscan --bom sbom.json \
--reports-dir ./reports \
--type sbom-vdr
# Step 3: Generate VEX
depscan --bom sbom.json \
--reports-dir ./reports \
--vex
# Outputs:
# - sbom.json (Software Bill of Materials)
# - vdr.json (Vulnerability Disclosure Report)
# - vex.json (Vulnerability Exploitability eXchange)
# Audit licenses
depscan --src /path/to/project \
--license-scan \
--reports-dir ./compliance
# Review license report
cat ./compliance/license-report.json | jq '.licenses[] | select(.approved == false)'
# Fail build on violations
depscan --src /path/to/project \
--license-scan \
--fail-on-license-violation
# Extract container filesystem
docker export $(docker create myimage:latest) | tar -C /tmp/container-fs -xf -
# Scan extracted filesystem
depscan --src /tmp/container-fs \
--reports-dir ./container-reports \
--report-template sarif
# Or use with Docker
docker run --rm -v $(pwd):/app ghcr.io/owasp-dep-scan/dep-scan \
depscan --src /app --reports-dir /app/reports
Depscan SARIF includes:
Vulnerability Disclosure Report (VDR) in CycloneDX format:
{
"vulnerabilities": [
{
"id": "CVE-2024-12345",
"source": {
"name": "NVD",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-12345"
},
"ratings": [
{
"score": 9.8,
"severity": "critical",
"method": "CVSSv3",
"vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}
],
"affects": [
{
"ref": "pkg:npm/[email protected]"
}
],
"recommendation": "Upgrade to version 4.17.21 or later"
}
]
}
CSAF 2.0 VEX document:
{
"document": {
"category": "csaf_vex",
"title": "Vulnerability Exploitability eXchange"
},
"vulnerabilities": [
{
"cve": "CVE-2024-12345",
"product_status": {
"known_affected": ["pkg:npm/[email protected]"]
},
"remediation": [
{
"category": "vendor_fix",
"details": "Update to version 4.17.21"
}
]
}
]
}
depscan --src /project \
--reports-dir ./reports \
--report-template json,sarif \
--risk-audit
# Extract high-risk vulnerabilities
jq '.results[] | select(.risk_score > 7)' reports/depscan.json
# Group by package
jq -r '.results[] | "\(.package): \(.vulnerabilities | length) vulns"' reports/depscan.json | sort
# Review fix recommendations
jq -r '.results[] | "\(.package)@\(.version) -> \(.fixed_version // "No fix available")"' reports/depscan.json
# Apply updates
npm update
pip install --upgrade -r requirements.txt
# Rescan
depscan --src /project --reports-dir ./post-fix
# Compare
diff <(jq '.results[].id' reports/depscan.json | sort) \
<(jq '.results[].id' post-fix/depscan.json | sort)
# Skip network calls for faster offline scanning
depscan --src /project --offline
# Limit report generation
depscan --src /project --report-template sarif
# Exclude test directories
depscan --src /project --exclude "**/test/**,**/tests/**"
# Use existing SBOM instead of regenerating
depscan --bom sbom.json --reports-dir ./reports
# Generate SARIF
depscan --src /project --reports-dir ./reports --report-template sarif
# Analyze with sarif-tools
pip install sarif-tools
sarif summary reports/depscan.sarif
sarif ls reports/depscan.sarif
sarif trends reports/*.sarif
# Generate SBOM+VDR for Dependency Track
depscan --src /project \
--reports-dir ./reports \
--type sbom-vdr
# Upload to Dependency Track
curl -X POST "https://dependency-track/api/v1/bom" \
-H "X-API-Key: ${API_KEY}" \
-F "bom=@reports/bom.json"
| Shortcut | Why It's Wrong | |----------|----------------| | "OSV-Scanner is enough" | Depscan provides VDR, VEX, risk scoring, and license compliance OSV lacks | | "Skip VEX generation" | VEX documents are critical for communicating vulnerability status to stakeholders | | "Disable risk audit for speed" | Risk scores help prioritize fixes; speed shouldn't compromise decision quality | | "Ignore license violations" | License compliance is legal requirement; violations can block product release | | "Only scan production dependencies" | Dev dependencies can introduce supply chain attacks |
development
Security anti-pattern for Cross-Site Scripting vulnerabilities (CWE-79). Use when generating or reviewing code that renders HTML, handles user input in web pages, uses innerHTML/document.write, or builds dynamic web content. Covers Reflected, Stored, and DOM-based XSS. AI code has 86% XSS failure rate.
development
Security anti-pattern for XPath injection vulnerabilities (CWE-643). Use when generating or reviewing code that queries XML documents, constructs XPath expressions, or handles user input in XML operations. Detects unescaped quotes and special characters in XPath queries.
development
Security anti-pattern for weak password hashing (CWE-327, CWE-759). Use when generating or reviewing code that stores or verifies user passwords. Detects use of MD5, SHA1, SHA256 without salt, or missing password hashing entirely. Recommends bcrypt, Argon2, or scrypt.
development
Security anti-pattern for weak encryption (CWE-326, CWE-327). Use when generating or reviewing code that encrypts data, handles encryption keys, or uses cryptographic modes. Detects DES, ECB mode, static IVs, and custom crypto implementations.