| name | dependency-audit |
| description | Dependency security and compliance: per-language vulnerability scanning (npm audit, cargo audit, pip-audit, govulncheck, OWASP Dependency-Check), license compliance (FOSSA, license-checker), transitive dependency risk, dependency confusion attacks, and Renovate/Dependabot setup. |
Dependency Audit Skill
Your dependencies are your attack surface. Log4Shell, colors.js, event-stream — high-severity supply chain incidents keep happening. This skill covers systematic dependency security and license compliance.
When to Activate
- Running a security audit before a release
- Responding to a reported CVE in a dependency
- Setting up automated dependency updates (Renovate/Dependabot)
- License compliance review before open-sourcing or commercial distribution
- Investigating a suspicious transitive dependency
- Verifying that internal package names are protected against dependency confusion attacks
- Adding automated vulnerability scanning to a CI/CD pipeline for the first time
Vulnerability Scanning by Language
Node.js / npm
npm audit
npm audit --audit-level=high
npm audit fix
npm audit fix --force
npm audit --json | jq '.vulnerabilities | to_entries[] | select(.value.severity == "critical")'
npx snyk test
npx snyk monitor
npx better-npm-audit audit
Rust / Cargo
cargo install cargo-audit
cargo audit
cargo audit --json
Python
pip install pip-audit
pip-audit
pip-audit -r requirements.txt
pip-audit --format json
pip install safety
safety check
safety check -r requirements.txt
pip-audit --fix
Go
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
govulncheck -json ./...
Java / Maven / Gradle
mvn org.owasp:dependency-check-maven:check
./mvnw dependency-check:check
snyk test --all-projects
License Compliance
Why It Matters
| License | Risk Level | Can Use In Proprietary? | Notes |
|---|
| MIT, ISC, BSD-2/3 | ✅ Low | Yes | Attribution required |
| Apache 2.0 | ✅ Low | Yes | Attribution + NOTICE file |
| LGPL | ⚠️ Medium | Yes (with conditions) | Dynamic linking required |
| GPL v2/v3 | ❌ High | No | Must open-source your code |
| AGPL | ❌ High | No | Even SaaS must open-source |
| SSPL | ❌ High | No | MongoDB's controversial license |
| CC BY-ND | ❌ High | No for modifications | No derivatives |
npm — license-checker
npx license-checker --summary
npx license-checker --json
npx license-checker --csv
npx license-checker --onlyAllow "MIT;ISC;Apache-2.0;BSD-2-Clause;BSD-3-Clause"
npx license-checker --failOn "GPL;AGPL"
Python — pip-licenses
pip install pip-licenses
pip-licenses
pip-licenses --format=json
pip-licenses --allow-only="MIT;Apache Software License;BSD License"
pip-licenses --fail-on="GNU General Public License"
Go
go install github.com/google/go-licenses@latest
go-licenses check ./... --allowed_licenses=MIT,Apache-2.0,BSD-2-Clause,BSD-3-Clause,ISC
go-licenses report ./...
go-licenses save ./... --save_path=third_party/
FOSSA (Commercial — recommended for enterprises)
- Automatically scans all dependency types
- Tracks licenses across dependency updates
- Generates attribution documents
- Integrates with GitHub PRs
Automated Updates — Renovate vs Dependabot
Renovate (recommended — more configurable)
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"packageRules": [
{
"matchUpdateTypes": ["patch", "minor"],
"matchCurrentVersion": "!/^0/",
"automerge": true
},
{
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["major"],
"labels": ["dependencies", "major-update"],
"reviewers":
Dependabot
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
groups:
dev-dependencies:
patterns: ["@types/*", "eslint*", "jest*"]
ignore:
- dependency-name: "lodash"
versions: ["4.x"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
Transitive Dependency Analysis
The most dangerous vulnerabilities are often in dependencies of dependencies.
npm ls --all
npm ls lodash
npm why lodash
npx depcheck
cargo tree
cargo tree -i openssl
go mod graph | grep vulnerable-pkg
pipdeptree
pipdeptree --reverse --packages urllib3
Dependency Confusion Attacks
Attack: Attacker publishes a public package with the same name as your private package. Package managers prefer the higher version, which may be the malicious public one.
Detection
npm view @mycompany/internal-auth
Mitigations
- Use scoped packages (
@mycompany/...) — and register the scope on npm
- Always-auth for scoped packages in .npmrc:
@mycompany:registry=https://registry.mycompany.com
//registry.mycompany.com/:always-auth=true
- Private npm registry with allowlist (Artifactory, Verdaccio, GitHub Packages)
- Yarn PnP or npm
--ignore-scripts — prevent install script execution
CI Integration
name: Dependency Audit
on:
push:
branches: [main]
schedule:
- cron: '0 8 * * 1'
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: npm audit
run: npm audit --audit-level=high
- name: License check
run: |
npx license-checker \
--onlyAllow "MIT;ISC;Apache-2.0;BSD-2-Clause;BSD-3-Clause" \
--excludePrivatePackages
- name: SBOM scan
uses: anchore/scan-action@v3
with:
path: "."
fail-build: true
severity-cutoff: high
Reference Commands
/dep-audit — run full dependency audit workflow
/sbom — generate SBOM and attach to release
supply-chain-security skill — SLSA, cosign, reproducible builds