360 Secure SkillHub
360 安全技能中心

dependency-scanner

该 Skill 通过运行 npm audit 获取 Node.js 项目的依赖漏洞信息,按 critical、high、moderate、low 分级汇总,并输出漏洞列表与修复建议;同时提供 scanDependencies 接口,返回结构化结果,可用于安全审计和 CI/CD 流程。

分类:安全
147258xuan
147258xuan
热度 5.32
最近更新 2026-11-13 18:44:15

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add 147258xuan/dependency-scanner
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
dependency-scanner
description
Scan project dependencies for security vulnerabilities using npm audit. Use when checking for vulnerable packages, security audits, or dependency health.

Dependency Scanner Skill

Scans Node.js project dependencies for known security vulnerabilities using npm audit.

Usage

# Scan current directory
node skills/dependency-scanner/index.js

# Scan specific project
node skills/dependency-scanner/index.js /path/to/project

Features

  • Runs npm audit and parses JSON results
  • Categorizes vulnerabilities by severity (critical, high, moderate, low)
  • Provides actionable recommendations
  • Returns structured data for programmatic use

Output

=== Dependency Security Scan ===
Target: /path/to/project
Time: 2026-06-07T09:12:38.339Z

Summary:
  Total vulnerabilities: 3
  Critical: 1
  High: 1
  Moderate: 1

Vulnerabilities:
  [CRITICAL] lodash@4.17.15
    Via: Prototype Pollution
    Fix available: Yes
  [HIGH] axios@0.19.0
    Via: SSRF
    Fix available: Yes

Recommendations:
  - CRITICAL: Update vulnerable packages immediately
  - Run: npm audit fix --force (review changes first)

API

scanDependencies(targetDir, options)

Returns scan results object:

{
  timestamp: '2026-06-07T09:12:38.339Z',
  target: '/path/to/project',
  summary: {
    total: 3,
    critical: 1,
    high: 1,
    moderate: 1,
    low: 0
  },
  vulnerabilities: [...],
  recommendations: [...]
}

When to Use

  • During security audits
  • Before deploying to production
  • In CI/CD pipelines
  • When updating dependencies
  • Periodic security checks