Dependency security
Skill ComeOnOliver/skillshub/skills/aiskillstore/marketplace/doyajin174/dependency-security
๐ง The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.
npx -y skills add ComeOnOliver/skillshub --skill dependency-securityAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Enforce dependency security scanning and SBOM generation. Use when adding dependencies, reviewing package.json, or during security audits. Covers OWASP dependency check, npm audit, and supply chain security.
The file declares its own license as MIT. That is the authorโs claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
6.1 KB, as published. Nobody here has run it
Dependency Security
์์กด์ฑ ๋ณด์ ์ค์บ ๋ฐ SBOM(Software Bill of Materials) ์์ฑ์ ๊ฐ์ ํ๋ ์คํฌ์ ๋๋ค.
2025 Context
OWASP Top 10 2025์์ "Vulnerable and Outdated Components"๊ฐ A03์ผ๋ก ์์น EU Cyber Resilience Act: 2024๋ ๋ถํฐ SBOM ์๋ฌดํ ์์ Supply Chain ๊ณต๊ฒฉ ๊ธ์ฆ: 2024๋ ๋๋น 300% ์ฆ๊ฐ
Core Rules
| ๊ท์น | ์ํ | ์ค๋ช |
|---|---|---|
| npm audit ํต๊ณผ | ๐ด ํ์ | high/critical ์ทจ์ฝ์ 0๊ฐ |
| ์์กด์ฑ ์ต์ ํ | ๐ก ๊ถ์ฅ | ์ฃผ์ ๋ณด์ ํจ์น ์ ์ฉ |
| SBOM ์์ฑ | ๐ก ๊ถ์ฅ | ์์กด์ฑ ๋ชฉ๋ก ๋ฌธ์ํ |
| lockfile ์ปค๋ฐ | ๐ด ํ์ | ์ฌํ ๊ฐ๋ฅํ ๋น๋ |
Security Audit
npm audit
# ์ทจ์ฝ์ ๊ฒ์ฌ
npm audit
# ์๋ ์์ (๊ฐ๋ฅํ ๊ฒฝ์ฐ)
npm audit fix
# ๊ฐ์ ์์ (major ๋ฒ์ ์
๋ฐ์ดํธ ํฌํจ)
npm audit fix --force # โ ๏ธ ์ฃผ์: ํธํ์ฑ ๋ฌธ์ ๊ฐ๋ฅ
# JSON ์ถ๋ ฅ (CI์ฉ)
npm audit --json
๊ฒฐ๊ณผ ํด์
Severity levels:
- critical: ๐ด ์ฆ์ ์์ ํ์
- high: ๐ด ์ฆ์ ์์ ํ์
- moderate: ๐ก ์กฐ์ํ ์์
- low: ๐ข ๋ค์ ์
๋ฐ์ดํธ ์ ์์
CI ํตํฉ ์์
# GitHub Actions
- name: Security Audit
run: |
npm audit --audit-level=high
if [ $? -ne 0 ]; then
echo "Security vulnerabilities found!"
exit 1
fi
Dependency Management
์์กด์ฑ ์ ๋ฐ์ดํธ ํ์ธ
# ์ค๋๋ ํจํค์ง ํ์ธ
npm outdated
# ์
๋ฐ์ดํธ ๊ฐ๋ฅํ ํจํค์ง
npx npm-check-updates
# ๋ํํ ์
๋ฐ์ดํธ
npx npm-check-updates -i
์์ ํ ์ ๋ฐ์ดํธ ์ ๋ต
# 1. ํ์ฌ ์ํ ๊ธฐ๋ก
npm outdated > outdated-$(date +%Y%m%d).txt
# 2. patch ๋ฒ์ ๋ง ์
๋ฐ์ดํธ (๊ฐ์ฅ ์์ )
npx npm-check-updates -u --target patch
# 3. minor ๋ฒ์ ์
๋ฐ์ดํธ
npx npm-check-updates -u --target minor
# 4. ํ
์คํธ ์คํ
npm test
# 5. lockfile ์ปค๋ฐ
git add package-lock.json
git commit -m "chore: update dependencies (security patch)"
SBOM (Software Bill of Materials)
SBOM ์์ฑ
# CycloneDX ํ์ (๊ถ์ฅ)
npx @cyclonedx/cyclonedx-npm --output-file sbom.json
# SPDX ํ์
npx spdx-sbom-generator
SBOM ํฌํจ ์ ๋ณด
{
"bomFormat": "CycloneDX",
"specVersion": "1.4",
"components": [
{
"name": "react",
"version": "18.2.0",
"purl": "pkg:npm/[email protected]",
"licenses": [{ "license": { "id": "MIT" } }]
}
]
}
CI์์ SBOM ์๋ ์์ฑ
# GitHub Actions
- name: Generate SBOM
run: npx @cyclonedx/cyclonedx-npm --output-file sbom.json
- name: Upload SBOM
uses: actions/upload-artifact@v3
with:
name: sbom
path: sbom.json
Supply Chain Security
Lockfile ๋ณด์
# package-lock.json ํญ์ ์ปค๋ฐ
git add package-lock.json
# CI์์ ์ ํํ ๋ฒ์ ์ค์น
npm ci # (npm install์ด ์๋!)
.npmrc ๋ณด์ ์ค์
# .npmrc
# ์คํฌ๋ฆฝํธ ์๋ ์คํ ๊ธ์ง
ignore-scripts=true
# ์๊ฒฉํ SSL
strict-ssl=true
# ๋ ์ง์คํธ๋ฆฌ ๊ณ ์
registry=https://registry.npmjs.org/
์์ฌ์ค๋ฌ์ด ํจํค์ง ํ์ธ
# ํจํค์ง ์ ๋ณด ํ์ธ
npm info <package-name>
# ๋ค์ด๋ก๋ ์, ์ ์ง๋ณด์ ์ํ ํ์ธ
npx npm-check <package-name>
# ๋ผ์ด์ ์ค ํ์ธ
npx license-checker
Detection Patterns
์ํ ์ ํธ
๐ด ์ํ:
- critical/high ์ทจ์ฝ์ ์กด์ฌ
- 1๋
์ด์ ์
๋ฐ์ดํธ ์๋ ์์กด์ฑ
- deprecated ํจํค์ง ์ฌ์ฉ
- ์ ์ ์๋ ์ถ์ฒ์ ํจํค์ง
๐ก ์ฃผ์:
- moderate ์ทจ์ฝ์
- 6๊ฐ์ ์ด์ ์
๋ฐ์ดํธ ์์
- ๋ฎ์ ๋ค์ด๋ก๋ ์
๊ฒ์ฌ ๋ช ๋ น์ด
# deprecated ํจํค์ง ํ์ธ
npm ls 2>&1 | grep -i deprecated
# ๋ผ์ด์ ์ค ๋ฌธ์ ํ์ธ
npx license-checker --failOn "GPL;AGPL"
# ์์กด์ฑ ํธ๋ฆฌ ํ์ธ
npm ls --depth=0
Workflow
1. ์ ์์กด์ฑ ์ถ๊ฐ ์
์ถ๊ฐ ์ ์ฒดํฌ:
1. npm info๋ก ํจํค์ง ์ ๋ณด ํ์ธ
2. ๋ค์ด๋ก๋ ์ ๋ฐ ์ ์ง๋ณด์ ์ํ ํ์ธ
3. ๋ผ์ด์ ์ค ํธํ์ฑ ํ์ธ
4. ๋์ ํจํค์ง ๊ฒํ
์ถ๊ฐ ํ:
1. npm audit ์คํ
2. lockfile ์ปค๋ฐ
2. ์ ๊ธฐ ๋ณด์ ์ ๊ฒ (์ฃผ๊ฐ/์๊ฐ)
# 1. ์ทจ์ฝ์ ๊ฒ์ฌ
npm audit
# 2. ์ค๋๋ ํจํค์ง ํ์ธ
npm outdated
# 3. SBOM ์
๋ฐ์ดํธ
npx @cyclonedx/cyclonedx-npm --output-file sbom.json
# 4. ๊ฒฐ๊ณผ ๊ธฐ๋ก
3. CI/CD ํ์ดํ๋ผ์ธ
name: Security Check
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Security audit
run: npm audit --audit-level=high
- name: Check outdated
run: npm outdated || true
- name: Generate SBOM
run: npx @cyclonedx/cyclonedx-npm --output-file sbom.json
๋๊ตฌ ์ถ์ฒ
| ๋๊ตฌ | ์ฉ๋ | ๋ช ๋ น์ด |
|---|---|---|
| npm audit | ์ทจ์ฝ์ ์ค์บ | npm audit |
| Snyk | ๊ณ ๊ธ ์ทจ์ฝ์ ๋ถ์ | npx snyk test |
| OWASP Dependency-Check | OWASP ํ์ค ์ค์บ | CLI ๋๊ตฌ |
| CycloneDX | SBOM ์์ฑ | npx @cyclonedx/cyclonedx-npm |
| npm-check-updates | ์์กด์ฑ ์ ๋ฐ์ดํธ | npx ncu |
Checklist
์ ํ๋ก์ ํธ
- .npmrc ๋ณด์ ์ค์ ์ ์ฉ
- package-lock.json ์ปค๋ฐ
- npm audit ํต๊ณผ ํ์ธ
- CI์ ๋ณด์ ๊ฒ์ฌ ์ถ๊ฐ
์์กด์ฑ ์ถ๊ฐ ์
- ํจํค์ง ์ ๋ขฐ์ฑ ํ์ธ
- ๋ผ์ด์ ์ค ํธํ์ฑ ํ์ธ
- npm audit ์ฌ์คํ
- lockfile ์ปค๋ฐ
์ ๊ธฐ ์ ๊ฒ
- npm audit ์คํ
- npm outdated ํ์ธ
- SBOM ์ ๋ฐ์ดํธ
- ๋ณด์ ํจ์น ์ ์ฉ