dependency-scanning

SkillHub skill.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "dependency-scanning" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-0230723f2174c8719aed0bb908c03d0c6d8f1f7b39f76b87c049b71e22ef1c72. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/dependency-scanning-skillhub before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

SkillHub skill.

0 Downloads

Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: dependency-scanning
description: 扫描项目依赖中的已知漏洞,生成软件物料清单,并在软件供应链中强制执行许可证合规性。

Dependency Scanning

此技能使代理能够分析项目的直接和传递依赖项中的已知安全漏洞、过时包和许可证合规问题。代理解析清单和锁定文件,查询漏洞数据库(NVD、GitHub Advisory、OSV),生成包含CVE标识符和修复指导的结构化报告,并可生成符合标准格式的软件物料清单(SBOM)。

Workflow

  1. 检测包生态系统和清单文件 — 通过定位依赖清单如 package.json 和 package-lock.json(Node.js)、requirements.txt 和 Pipfile.lock(Python)、pom.xml 或 build.gradle(Java)、go.sum(Go)或 Gemfile.lock(Ruby)来识别项目的语言生态系统。检测具有多个清单的单体仓库结构。

  2. 解析完整的依赖树 — 解析锁定文件以构建包括传递依赖在内的完整依赖图。识别依赖深度、共享子依赖项和版本约束。标记在代码中使用但未出现在清单中的幻影依赖项。

  3. 与漏洞数据库进行扫描对比 — 查询国家漏洞数据库(NVD)、GitHub Advisory Database 和 OSV,针对每个解析后的包和版本。通过 CPE 或 PURL 标识符匹配结果。记录 CVE ID、CVSS 分数、严重级别、受影响的版本范围以及可用的修复版本。

  4. 评估许可证合规性 — 提取每个依赖项声明的许可证,并将其与项目的许可证策略进行比较。在专有项目中标记 copyleft 许可证(GPL、AGPL),识别未声明许可证的包,并检测直接和传递依赖之间的许可证冲突。

  5. 生成 SBOM 和漏洞报告 — 生成 CycloneDX 或 SPDX 格式的软件物料清单。生成按严重性排序的漏洞报告,包括 CVE 标识符、受影响的依赖路径、可用的修复版本以及是否存在可访问的漏洞代码路径。

  6. 推荐并应用修复方案 — 建议为解决漏洞所需的最小版本升级,而不引入破坏性更改。在可能的情况下,自动生成更新后的清单和锁定文件。标记无可用修复的情况,并建议替代包或变通方法。

支持的技术

  • Node.js: npm audit, yarn audit, Snyk, Dependabot
  • Python: pip-audit, Safety, Snyk, Dependabot
  • Java: OWASP Dependency-Check, Snyk, Maven Enforcer Plugin
  • Go: govulncheck, Nancy, Snyk
  • 容器: Trivy, Grype(扫描镜像中的操作系统包和应用程序依赖)
  • SBOM 格式: CycloneDX(JSON/XML)、SPDX(JSON/Tag-Value)
  • CI/CD 集成: GitHub Actions, GitLab CI, Jenkins, CircleCI

Usage

向代理提供项目目录路径或特定清单文件。可选择指定许可证策略或目标合规标准。代理将执行完整扫描并交付优先级排序的漏洞报告。

提示示例:

Scan the Node.js project in /app for dependency vulnerabilities. Generate a CycloneDX SBOM and flag any GPL-licensed transitive dependencies.

Examples

示例 1: 扫描 Node.js 项目

Command:

npm audit --json > audit-report.json

漏洞报告(摘录):

# Severity Package Installed Fixed In CVE Dependency Path
1 Critical jsonwebtoken 8.5.1 9.0.0 CVE-2022-23529 direct
2 High minimatch 3.0.4 3.0.5 CVE-2022-3517 express > send > mime > minimatch
3 High qs 6.5.2 6.5.3 CVE-2022-24999 express > qs
4 Medium semver 5.7.1 5.7.2 CVE-2022-25883 nodemon > semver
5 Low cookie 0.4.1 0.4.2 CVE-2024-47764 express > cookie

自动生成的 package.json 修复:

{
  "dependencies": {
    "jsonwebtoken": "^9.0.0",
    "express": "^4.19.2"
  },
  "overrides": {
    "minimatch": "3.0.5",
    "semver": "5.7.2"
  }
}

示例 2: 使用 pip-audit 扫描 Python 项目

Command:

pip-audit -r requirements.txt --format json --output audit.json --fix --dry-run

漏洞报告(摘录):

# Severity Package Installed Fixed In CVE Description
1 Critical cryptography 38.0.0 41.0.6 CVE-2023-49083 NULL pointer dereference when loading PKCS7 certificates
2 High requests 2.28.0 2.31.0 CVE-2023-32681 Leaking Proxy-Authorization header to redirected hosts
3 High Jinja2 3.1.1 3.1.3 CVE-2024-22195 Cross-site scripting via xmlattr filter
4 Medium setuptools 65.0.0 70.0.0 CVE-2024-6345 Remote code execution via download functions

自动生成的 requirements.txt(已修复):

cryptography==41.0.6    # was 38.0.0 — fixes CVE-2023-49083
requests==2.31.0        # was 2.28.0 — fixes CVE-2023-32681
Jinja2==3.1.3           # was 3.1.1 — fixes CVE-2024-22195
setuptools>=70.0.0      # was 65.0.0 — fixes CVE-2024-6345
Flask==3.0.0
gunicorn==21.2.0

最佳实践

  • 每次 CI 构建时扫描 — 将依赖扫描集成到 CI 流水线中,以便在代码合并前而非部署后发现新漏洞。
  • 锁定依赖并使用锁定文件 — 使用锁定文件确保可重现构建,使 CI 中扫描的确切版本与生产环境部署的版本一致。
  • 监控传递依赖项 — 典型项目中超过 80% 的漏洞来自传递依赖。始终解析并扫描完整的依赖树,而不仅仅是直接依赖。
  • 自动化更新 PR — 使用 Dependabot、Renovate 或 Snyk 自动在修复版本可用时打开拉取请求,减少暴露窗口。
  • 维护许可证白名单 — 定义批准的许可证列表(例如 MIT、Apache-2.0、BSD),并阻止引入不被允许许可证的依赖项。
  • 每次发布生成 SBOM — 将 CycloneDX 或 SPDX SBOM 与发布工件一同存储,以支持供应链透明度和事件响应。

Edge Cases

  • 无可用修复的漏洞 — 当 CVE 存在但未发布补丁版本时,评估应用程序中是否存在可访问的漏洞代码路径。如果存在,则考虑替换依赖项或应用本地补丁。
  • 混合生态系统的单体仓库 — 单个仓库可能包含 Node.js、Python 和 Go 服务,各自具有独立清单。独立扫描每个生态系统并生成统一报告。
  • 私有注册表和内部包 — 托管在私有 npm 注册表或内部 PyPI 服务器上的包不会出现在公共漏洞数据库中。维护私有咨询源或使用支持自定义数据源的工具如 Trivy 来扫描内部包。
  • 通过覆盖导致的版本冲突 — 通过 npm overrides 或 pip constraints 强制传递依赖项更新到新版本可能会引入运行时不兼容性。在应用自动化修复后始终运行测试套件。
  • 已归档或未维护的依赖项 — 某个包可能没有已知 CVE,但也没有活跃维护者。将未维护的包视为供应链风险,并计划迁移到积极维护的替代方案。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 解决软件供应链安全这一明确且高频的刚需场景
  • 支持多语言生态系统(Node.js、Python、Java、Go、Ruby)
  • 提供端到端能力:从漏洞扫描到 SBOM 生成与自动化修复
Trigger Precision75/100

Areas to improve

  • description写错位置 Reported severity: Minor

    顶层 frontmatter 中 description 字段为空,实际描述内容位于 skill_body 内部

    Recommendation: 将核心功能描述移至顶层 frontmatter 的 description 字段,以便触发系统准确识别

Highlights

  • 功能边界清晰,覆盖多种触发场景(扫描项目、生成 SBOM、检查许可证)
  • 提供了具体的 usage 示例和提示语句
Structure and Standards95/100

Highlights

  • 结构完整,包含 Workflow、支持技术、Usage、Examples、最佳实践、Edge Cases
  • 步骤清晰,有端到端示例,frontmatter 完整
  • 文档组织良好,易于理解与执行
Execution Reliability90/100

Highlights

  • 工具来源明确(npm audit、pip-audit、Snyk、Trivy 等),参数正确
  • 覆盖主要异常场景(无可用修复、私有包、版本冲突、未维护依赖)
  • 提供修复建议与自动化方案,具备高执行可靠性
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.