Dependency Security
Purpose
Reduce the risk that a dependency compromises the system: find known-vulnerable packages, harden the supply chain (integrity, pinning, provenance), catch malicious/typosquatted packages, and enforce it in CI — prioritized by real exploitability. The general inventory is ../../dependency-audit; this is its security lens.
When to Use
- Auditing dependencies for security, in
../../security-review, or setting up supply-chain defenses.
- Not for general dependency inventory/licensing (
../../dependency-audit) or secret leaks (secrets-audit).
Inputs
- The dependency tree + lockfiles across apps (
../../dependency-audit inventory).
- CI/build setup (
../../devops/ci-cd, ../../devops/github-actions), image base (../../devops/docker-foundation).
Discovery Questions
- What known vulnerabilities exist in the tree (direct + transitive), and which are actually reachable/exploitable in this app?
- Are installs reproducible and pinned (committed lockfile, frozen installs, pinned base images/actions)?
- Any signs of malicious or typosquatted packages (suspicious names, install scripts, recent ownership changes)?
- Is dependency scanning enforced in CI, and are updates a managed process?
Responsibilities
- Vulnerability assessment: audit direct + transitive deps against advisory databases; prioritize by reachability + severity — a critical CVE in unused code path is lower than a medium one in the request path (don't blindly chase every advisory, but never ignore reachable criticals).
- Supply-chain integrity: committed lockfiles, frozen/
ci installs (../../devops/pnpm-workspaces/npm-workspaces), pinned base images and CI actions (../../devops/docker-foundation, ../../devops/github-actions) — floating versions are an injection surface; provenance/signature checks where available.
- Malicious-package detection: watch for typosquats, unexpected install scripts, packages with sudden maintainer changes or huge unexplained dependency additions; scrutinize new dependencies in review.
- Enforcement: dependency scanning as a CI job (
../../devops/ci-cd), a managed update cadence, and review discipline for adding dependencies (../../code-review).
- Drive prioritized upgrades/removals; record accepted risks with justification.
Required Workflow
- Inventory direct + transitive deps + lockfile state (
../../dependency-audit).
- Assess known vulnerabilities; prioritize by reachability × severity.
- Check supply-chain integrity (pinning, frozen installs, provenance).
- Scan for malicious/typosquatted packages.
- Recommend prioritized upgrades/removals; wire CI scanning + update process.
Decision Rules
- Prioritize by exploitability in this app — reachable criticals first; don't drown in unreachable advisories, but never wave one through unassessed.
- Pin everything that runs your build/deploy (packages, base images, CI actions) — floating refs are supply-chain risk.
- A new dependency is a trust decision; scrutinize provenance and install scripts before adding.
- Accepted risks are recorded with justification and an owner, not silently ignored.
Rules
- Lockfiles committed; installs frozen; build inputs pinned.
- Dependency scanning enforced in CI, not run ad hoc.
- Reachable critical/high vulns are fixed or explicitly risk-accepted with justification.
Anti-Patterns
- Ignoring transitive dependencies (most vulns live there).
- Floating versions / unpinned base images and CI actions.
- Blindly bumping to satisfy a scanner without checking reachability or breakage.
- Adding dependencies without vetting provenance/install scripts.
- Audit run once manually, never enforced in CI.
Validation Checklist
Definition of Done
A recorded dependency security assessment — reachability-prioritized vulnerabilities, hardened supply chain (pinned, frozen, provenance-checked), malicious-package scan — with prioritized remediation, enforced CI scanning, and any accepted risk justified.
Related Skills
../../dependency-audit, secrets-audit, ../../devops/ci-cd, ../../devops/github-actions, ../../devops/docker-foundation, ../../devops/pnpm-workspaces, ../../devops/npm-workspaces, ../../security-review, security-regression-testing.
Related Knowledge
../../../knowledge/ (dependency tree, accepted risks).
Related References
../../../references/security/ (supply-chain checklists, when populated).
Context Loading Guidance
- Requires: dependency tree + lockfiles, CI/build setup, image bases.
- Does not require: app feature logic, license detail (that's
../../dependency-audit).
- May load:
../../dependency-audit, ../../devops/ci-cd.
- Stop when: prioritized findings + enforced scanning are recorded.
Token Efficiency Guidance
The vuln table (package, path, severity, reachable?, fix) plus the pinning checklist are the artifacts; don't dump the full tree.
1---2name: dependency-security3description: Use to assess third-party dependency risk from a security angle — known vulnerabilities, supply-chain integrity (lockfiles, pinning, provenance), typosquats/malicious packages, and CI enforcement — driving prioritized upgrades. The security lens on dependencies; dependency-audit is the general inventory.4---56# Dependency Security78## Purpose910Reduce the risk that a dependency compromises the system: find known-vulnerable packages, harden the supply chain (integrity, pinning, provenance), catch malicious/typosquatted packages, and enforce it in CI — prioritized by real exploitability. The general inventory is `../../dependency-audit`; this is its security lens.1112## When to Use1314- Auditing dependencies for security, in `../../security-review`, or setting up supply-chain defenses.15- **Not** for general dependency inventory/licensing (`../../dependency-audit`) or secret leaks (`secrets-audit`).1617## Inputs1819- The dependency tree + lockfiles across apps (`../../dependency-audit` inventory).20- CI/build setup (`../../devops/ci-cd`, `../../devops/github-actions`), image base (`../../devops/docker-foundation`).2122## Discovery Questions2324- What **known vulnerabilities** exist in the tree (direct + transitive), and which are actually reachable/exploitable in this app?25- Are installs **reproducible and pinned** (committed lockfile, frozen installs, pinned base images/actions)?26- Any signs of **malicious or typosquatted** packages (suspicious names, install scripts, recent ownership changes)?27- Is dependency scanning **enforced in CI**, and are updates a managed process?2829## Responsibilities3031- **Vulnerability assessment**: audit direct + transitive deps against advisory databases; **prioritize by reachability + severity** — a critical CVE in unused code path is lower than a medium one in the request path (don't blindly chase every advisory, but never ignore reachable criticals).32- **Supply-chain integrity**: committed lockfiles, **frozen/`ci` installs** (`../../devops/pnpm-workspaces`/`npm-workspaces`), pinned base images and CI actions (`../../devops/docker-foundation`, `../../devops/github-actions`) — floating versions are an injection surface; provenance/signature checks where available.33- **Malicious-package detection**: watch for typosquats, unexpected install scripts, packages with sudden maintainer changes or huge unexplained dependency additions; scrutinize new dependencies in review.34- **Enforcement**: dependency scanning as a CI job (`../../devops/ci-cd`), a managed update cadence, and review discipline for adding dependencies (`../../code-review`).35- Drive **prioritized upgrades/removals**; record accepted risks with justification.3637## Required Workflow38391. Inventory direct + transitive deps + lockfile state (`../../dependency-audit`).402. Assess known vulnerabilities; prioritize by reachability × severity.413. Check supply-chain integrity (pinning, frozen installs, provenance).424. Scan for malicious/typosquatted packages.435. Recommend prioritized upgrades/removals; wire CI scanning + update process.4445## Decision Rules4647- Prioritize by exploitability in *this* app — reachable criticals first; don't drown in unreachable advisories, but never wave one through unassessed.48- Pin everything that runs your build/deploy (packages, base images, CI actions) — floating refs are supply-chain risk.49- A new dependency is a trust decision; scrutinize provenance and install scripts before adding.50- Accepted risks are recorded with justification and an owner, not silently ignored.5152## Rules5354- Lockfiles committed; installs frozen; build inputs pinned.55- Dependency scanning enforced in CI, not run ad hoc.56- Reachable critical/high vulns are fixed or explicitly risk-accepted with justification.5758## Anti-Patterns5960- Ignoring transitive dependencies (most vulns live there).61- Floating versions / unpinned base images and CI actions.62- Blindly bumping to satisfy a scanner without checking reachability or breakage.63- Adding dependencies without vetting provenance/install scripts.64- Audit run once manually, never enforced in CI.6566## Validation Checklist6768- [ ] Direct + transitive vulns assessed, prioritized by reachability × severity.69- [ ] Lockfiles committed; frozen installs; pinned images/actions.70- [ ] Malicious/typosquat scan done.71- [ ] Prioritized upgrades/removals recommended.72- [ ] CI scanning + managed update cadence wired; accepted risks recorded.7374## Definition of Done7576A recorded dependency security assessment — reachability-prioritized vulnerabilities, hardened supply chain (pinned, frozen, provenance-checked), malicious-package scan — with prioritized remediation, enforced CI scanning, and any accepted risk justified.7778## Related Skills7980`../../dependency-audit`, `secrets-audit`, `../../devops/ci-cd`, `../../devops/github-actions`, `../../devops/docker-foundation`, `../../devops/pnpm-workspaces`, `../../devops/npm-workspaces`, `../../security-review`, `security-regression-testing`.8182## Related Knowledge8384`../../../knowledge/` (dependency tree, accepted risks).8586## Related References8788`../../../references/security/` (supply-chain checklists, when populated).8990## Context Loading Guidance9192- **Requires:** dependency tree + lockfiles, CI/build setup, image bases.93- **Does not require:** app feature logic, license detail (that's `../../dependency-audit`).94- **May load:** `../../dependency-audit`, `../../devops/ci-cd`.95- **Stop when:** prioritized findings + enforced scanning are recorded.9697## Token Efficiency Guidance9899The vuln table (package, path, severity, reachable?, fix) plus the pinning checklist are the artifacts; don't dump the full tree.