safedep/vet

GitHub: safedep/vet

vet 是一个用于实时检测恶意开源包和分析依赖漏洞的开源工具,专注于保护软件供应链安全。

Stars: 1068 | Forks: 101

SafeDep VET - Real-time malicious package detection & software supply chain security

快速入门文档社区

[![Go Report Card](https://goreportcard.com/badge/github.com/safedep/vet)](https://goreportcard.com/report/github.com/safedep/vet) [![License](https://img.shields.io/github/license/safedep/vet)](https://github.com/safedep/vet/blob/main/LICENSE) [![Release](https://img.shields.io/github/v/release/safedep/vet)](https://github.com/safedep/vet/releases) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/safedep/vet/badge)](https://api.securityscorecards.dev/projects/github.com/safedep/vet) [![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://slsa.dev) [![CodeQL](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/6460bb0d28113559.svg)](https://github.com/safedep/vet/actions/workflows/codeql.yml) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/safedep/vet) ## 为什么选择 vet? 传统的 SCA 工具会让您淹没在 CVE 噪音中。**vet** 采取了不同的方法: - **影子 AI 发现** — 发现跨各种工具和配置的 AI 工具使用信号 - **在发布前捕获恶意软件** — 通过静态和动态行为分析进行零日检测(需要访问 SafeDep Cloud) - **穿透漏洞噪音** — 分析实际代码使用情况,只呈现真正重要的风险 - **策略即代码** — 将安全、许可和质量要求表达为 [CEL](https://cel.dev/) 表达式 - **CI/CD 集成** — 在 CI/CD 中实现零配置的安全护栏 ## 快速入门 **秒级安装:** ``` # macOS 与 Linux brew install safedep/tap/vet # 使用 npm npm install -g @safedep/vet ``` 或下载 [预构建二进制文件](https://github.com/safedep/vet/releases) **立即开始:** ``` # 检查依赖项中的恶意软件 vet scan -D . --malware-query # 在存在关键漏洞时使 CI 失败 vet scan -D . --filter 'vulns.critical.exists(p, true)' --filter-fail # 获取用于高级恶意软件检测的 API 密钥 vet cloud quickstart ``` ## 架构 `vet` 遵循流水线架构:**读取器** 从多种来源(目录、代码仓库、容器镜像、SBOM)获取包清单,**丰富器** 使用来自 SafeDep Cloud 的漏洞、恶意软件和记分卡数据增强每个包的信息,**CEL 策略引擎** 根据丰富后的数据评估安全策略,**报告器** 以 SARIF、JSON 和 Markdown 等格式生成可操作的输出。
查看架构图 ``` graph TB subgraph "OSS Ecosystem" R1[npm Registry] R2[PyPI Registry] R3[Maven Central] R4[Other Registries] end subgraph "SafeDep Cloud" M[Continuous Monitoring] A[Real-time Code Analysis
Malware Detection] T[Threat Intelligence DB
Vulnerabilities • Malware • Scorecard] end subgraph "vet CLI" S[Source Repository
Scanner] P[CEL Policy Engine] O[Reports & Actions
SARIF/JSON/CSV] end R1 -->|New Packages| M R2 -->|New Packages| M R3 -->|New Packages| M R4 -->|New Packages| M M -->|Behavioral Analysis| A A -->|Malware Signals| T S -->|Query Package Info| T T -->|Security Intelligence| S S -->|Analysis Results| P P -->|Policy Decisions| O style M fill:#7CB9E8,stroke:#5A8DB8,color:#1a1a1a style A fill:#E8A87C,stroke:#B88A5A,color:#1a1a1a style T fill:#7CB9E8,stroke:#5A8DB8,color:#1a1a1a style S fill:#90C695,stroke:#6B9870,color:#1a1a1a style P fill:#E8C47C,stroke:#B89B5A,color:#1a1a1a style O fill:#B8A3D4,stroke:#9478AA,color:#1a1a1a ```
## 关键特性 ### **恶意软件包检测** 由 [SafeDep Cloud](https://docs.safedep.io/cloud/malware-analysis) 驱动的针对恶意软件包的实时保护。 对开源项目免费。通过主动代码分析检测零日恶意软件。 ### **漏洞分析** 与淹没在噪音中的依赖项扫描器不同,`vet` 分析您的 **实际代码使用情况**,以优先处理真正的风险。 详情请参见 [依赖项使用证据](https://docs.safedep.io/vet/guides/dependency-usage-identification)。 ### **策略即代码** 使用 CEL 表达式定义安全策略,以强制执行特定于上下文的要求: ``` # 阻止具有关键 CVE 的软件包 vet scan --filter 'vulns.critical.exists(p, true)' --filter-fail # 强制执行许可证合规性 vet scan --filter 'licenses.contains_license("GPL-3.0")' --filter-fail # 要求最低 OpenSSF Scorecard 评分 vet scan --filter 'scorecard.scores.Maintained < 5' --filter-fail ``` ### **多生态系统支持** 包管理器:**npm**、**PyPI**、**Maven**、**Go**、**Ruby**、**Rust**、**PHP** 容器镜像:**Docker**、**OCI** SBOM 格式:**CycloneDX**、**SPDX** 源代码仓库:**GitHub**、**GitLab** ## 恶意软件包检测 通过主动扫描和行为分析,实现针对 **恶意软件包的实时保护**。 ### 快速设置 ``` # 一次性设置高级扫描 vet cloud quickstart # 使用主动扫描检查恶意软件(需要 API 密钥) vet scan -D . --malware # 查询已知恶意软件包(无需 API 密钥) vet scan -D . --malware-query ``` **检测示例:** - [MAL-2025-3541: express-cookie-parser](https://safedep.io/malicious-npm-package-express-cookie-parser/) - [MAL-2025-4339: eslint-config-airbnb-compat](https://safedep.io/digging-into-dynamic-malware-analysis-signals/) - [MAL-2025-4029: ts-runtime-compat-check](https://safedep.io/digging-into-dynamic-malware-analysis-signals/) **关键安全特性:** - 针对已知恶意软件数据库进行实时分析 - 使用静态和动态分析的行为分析 - 通过主动代码扫描进行零日保护 - 对高影响发现进行人工参与的分流 - 公开的 [分析日志](https://vetpkg.dev/mal) 以确保透明度 ### 高级用法 ``` # 专项扫描 vet scan --vsx --malware # VS Code extensions vet scan -D .github/workflows --malware # GitHub Actions vet scan --image nats:2.10 --malware # Container images # 分析特定软件包 vet inspect malware --purl pkg:npm/nyc-config@10.0.0 ``` ## 生产就绪集成 ### GitHub Actions 在 CI/CD 中实现零配置的安全护栏: ``` - uses: safedep/vet-action@v1 with: policy: ".github/vet/policy.yml" ``` 参见 [vet-action](https://github.com/safedep/vet-action) 文档。 ### GitLab CI 使用 [vet CI Component](https://docs.safedep.io/vet/guides/gitlab-dependency-scanning) 进行企业级扫描: ``` include: - component: gitlab.com/safedep/ci-components/vet/scan@main ``` ### 容器集成 使用我们的容器镜像在任何地方运行 `vet`: ``` docker run --rm -v $(pwd):/app ghcr.io/safedep/vet:latest scan -D /app --malware ``` ## 安装 ### Homebrew(推荐) ``` brew install safedep/tap/vet ``` ### npm ``` npm install @safedep/vet ``` ### 直接下载 参见 [releases](https://github.com/safedep/vet/releases) 获取预构建的二进制文件。 ### Go Install ``` go install github.com/safedep/vet@latest ``` ### 容器镜像 ``` # 快速测试 docker run --rm ghcr.io/safedep/vet:latest version # 扫描本地目录 docker run --rm -v $(pwd):/workspace ghcr.io/safedep/vet:latest scan -D /workspace ``` ### 验证安装 ``` vet version # 应显示版本和构建信息 ``` ## 高级特性 **在我们全面的文档中了解更多:** - **[AI 使用情况发现](./docs/ai-discovery.md)** - 发现跨各种工具和配置的 AI 工具使用信号 - **[AI 代理模式](./docs/agent.md)** - 将 vet 作为 AI 代理运行 - **[MCP 服务器](./docs/mcp.md)** - 将 vet 作为 MCP 服务器运行,用于 AI 辅助代码分析 - **[报告](./docs/reporting.md)** - SARIF、JSON、CSV、HTML、Markdown 格式 - **[SBOM 支持](https://docs.safedep.io/vet/guides/cyclonedx-sbom)** - CycloneDX、SPDX 导入/导出 - **[查询模式](https://docs.safedep.io/cloud/quickstart#query-your-data)** - 扫描一次,多次分析 - **[GitHub 集成](https://docs.safedep.io/)** - 代码仓库和组织扫描 - **[GitHub Actions 固定](./docs/github-actions-pinning.md)** - 将 GitHub Actions 固定到提交 SHA 以防止供应链攻击 ## 隐私 `vet` 收集匿名使用遥测数据以改进产品。**您的代码和包信息永远不会被传输。** ``` # 禁用遥测(可选) export VET_DISABLE_TELEMETRY=true ``` ## 社区与支持
### 加入社区 [![Discord](https://img.shields.io/discord/1090352019379851304?color=7289da&label=Discord&logo=discord&logoColor=white)](https://rebrand.ly/safedep-community) [![GitHub Discussions](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/safedep/vet/discussions) [![Twitter Follow](https://img.shields.io/twitter/follow/safedepio?style=social)](https://twitter.com/safedepio)
### 获取帮助与分享想法 - **[交互式教程](https://killercoda.com/safedep/scenario/101-intro)** - 动手学习 vet - **[完整文档](https://docs.safedep.io/)** - 综合指南 - **[Discord 社区](https://rebrand.ly/safedep-community)** - 实时支持 - **[问题跟踪器](https://github.com/safedep/vet/issues)** - 错误报告与功能请求 - **[贡献指南](CONTRIBUTING.md)** - 加入开发
### 星标历史 [![Star History Chart](https://api.star-history.com/svg?repos=safedep/vet&type=Date)](https://star-history.com/#safedep/vet&Date) ### 基于开源构建 vet 站在巨人的肩膀上: [OSV](https://osv.dev) • [OpenSSF Scorecard](https://securityscorecards.dev/) • [SLSA](https://slsa.dev/) • [OSV-SCALIBR](https://github.com/google/osv-scalibr) • [Syft](https://github.com/anchore/syft)

今天就保护您的供应链。给仓库点个星开始吧!

由 [SafeDep](https://safedep.io) 和开源社区倾情打造
标签:AI 工具发现, DevSecOps, EVTX分析, Google Gemini, Go 语言, GPT, TLS抓取, 上游代理, 云安全监控, 代码安全, 安全扫描, 开发者安全工具, 日志审计, 时序注入, 暗色界面, 漏洞枚举, 漏洞管理, 自定义DNS解析器, 请求拦截, 软件安全, 零日检测, 静态分析