
🐺 Vulfy – Fast Rust based package version scanner
Vulfy 是一个闪电般快速的漏洞扫描器,可检查您项目依赖项中 9 种编程语言 的已知安全问题。它基于 Rust 构建,追求极致性能,并集成 OSV.dev 数据库,提供准确、最新的漏洞信息。
📖 完整文档 - 综合指南、教程与 API 参考
# Linux/WSL
curl -LO https://github.com/mindPatch/vulfy/releases/latest/download/vulfy-linux-x86_64.tar.gz
tar -xzf vulfy-linux-x86_64.tar.gz
sudo mv vulfy /usr/local/bin/
# macOS (Intel)
curl -LO https://github.com/mindPatch/vulfy/releases/latest/download/vulfy-macos-x86_64.tar.gz
tar -xzf vulfy-macos-x86_64.tar.gz
sudo mv vulfy /usr/local/bin/
# macOS (Apple Silicon)
curl -LO https://github.com/mindPatch/vulfy/releases/latest/download/vulfy-macos-aarch64.tar.gz
tar -xzf vulfy-macos-aarch64.tar.gz
sudo mv vulfy /usr/local/bin/
cargo install vulfy
git clone https://github.com/mindPatch/vulfy.git
cd vulfy
cargo build --release
sudo cp target/release/vulfy /usr/local/bin/
验证安装:
vulfy --version
# 应输出:vulfy 0.1.0
# 扫描当前目录
vulfy scan packages
# 扫描指定目录
vulfy scan packages --path /path/to/project
# 仅显示高严重性漏洞
vulfy scan packages --high-only
# JSON 格式用于自动化/CI
vulfy scan packages --format json --output security-report.json
# CSV 格式用于电子表格分析
vulfy scan packages --format csv --output vulnerabilities.csv
# SARIF 格式用于 GitHub 安全选项卡
vulfy scan packages --format sarif --output vulfy.sarif
# 如果发现高严重性漏洞则构建失败
vulfy scan packages --high-only --quiet || exit 1
# 仅扫描特定生态系统
vulfy scan packages --ecosystems npm,pypi --no-dev-deps
🔍 正在扫描包文件...
📦 在 4 个生态系统中找到 6 个包文件
🛡️ 漏洞报告
┌─────────────────────────────────────────┬──────────────┬──────────┬─────────────────┬──────┐
│ 标题 │ CVE ID │ 严重性 │ 包 │ 年份 │
├─────────────────────────────────────────┼──────────────┼──────────┼─────────────────┼──────┤
│ lodash 中的远程代码执行 │ CVE-2021-123 │ 🔥 高 │ [email protected] │ 2021 │
│ express 中的路径遍历 │ CVE-2022-456 │ 🟡 中 │ [email protected] │ 2022 │
│ sequelize 中的 SQL 注入 │ CVE-2020-789 │ 🔥 高 │ [email protected] │ 2020 │
└─────────────────────────────────────────┴──────────────┴──────────┴─────────────────┴──────┘
📊 扫描摘要
• 扫描的包总数:42
• 存在漏洞的包:8
• 漏洞总数:12
• 🔥 高严重性:4
• 🟡 中严重性:6
• 🟢 低严重性:2
📖 查看所有输出格式 - JSON、CSV、SARIF 示例
Vulfy 包含强大的自动化系统,用于对 Git 仓库进行持续安全监控。
# 使用示例配置初始化自动化
vulfy automation init --with-examples
# 验证配置
vulfy automation validate
# 使用自动化配置运行手动扫描
vulfy automation run
# 开始持续监控
vulfy automation start --foreground
# 监控多个仓库
[[repositories]]
name = "my-web-app"
url = "https://github.com/user/my-web-app.git"
branches = ["main", "develop"]
ecosystems = ["npm", "pypi"]
[repositories.credentials]
username = "git"
token = "your_github_token_here"
# 每天 UTC 时间 2:00 调度扫描
[schedule]
frequency = "daily"
time = "02:00"
timezone = "UTC"
# Discord Webhook 通知
[[notifications.webhooks]]
name = "安全告警"
url = "https://discord.com/api/webhooks/..."
webhook_type = "discord"
enabled = true
# 高级安全策略
[[policies]]
name = "关键认证问题"
enabled = true
[policies.conditions]
title_contains = ["authentication", "auth", "bypass"]
severity = ["high", "critical"]
[policies.actions]
notify = true
priority = "critical"
custom_message = "🚨 检测到关键认证漏洞!"
📖 完整自动化指南 - 详细设置与配置
vulfy scan packages [选项]
选项:
-p, --path <路径> 要扫描的目录 [默认:当前目录]
-f, --format <格式> 输出格式:table、json、csv、summary、sarif
-o, --output <文件> 将结果保存到文件
-e, --ecosystems <列表> 仅扫描特定生态系统(逗号分隔)
-q, --quiet 抑制进度输出
--high-only 仅显示高/关键严重性漏洞
--no-recursive 不扫描子目录
--no-dev-deps 跳过开发依赖项
在项目根目录创建 .vulfy.toml:
[scan]
ecosystems = ["npm", "pypi", "crates.io"]
min_severity = "medium"
skip_dev_deps = true
ignore_paths = ["node_modules", "vendor", ".git"]
[output]
format = "table"
color = "auto"
[api]
timeout = 30
max_concurrent = 10
retry_attempts = 3
📖 完整配置参考 - 完整模式文档
有功能请求? 提交 Issue 一起讨论!
Vulfy 以性能和可靠性为核心原则构建:
📖 架构深度解析 - 技术实现细节
我们欢迎各种贡献!无论是错误修复、新功能还是生态系统支持。
git clone https://github.com/mindPatch/vulfy.git
cd vulfy
cargo build
cargo test
cargo clippy📖 贡献指南 - 详细贡献说明
vulfy 二进制文件可执行:chmod +x vulfy本项目基于 MIT 许可证 - 详情请参见 LICENSE 文件。
| 生态系统 | 包文件 | 状态 |
|---|
| 📦 npm | package-lock.json, yarn.lock, pnpm-lock.yaml, package.json | ✅ |
| 🐍 Python | requirements.txt, Pipfile.lock, poetry.lock, pyproject.toml | ✅ |
| 🦀 Rust | Cargo.lock, Cargo.toml | ✅ |
| ☕ Java | pom.xml, build.gradle, build.gradle.kts | ✅ |
| 🐹 Go | go.mod, go.sum, go.work | ✅ |
| 💎 Ruby | Gemfile.lock, Gemfile, *.gemspec | ✅ |
| ⚙️ C/C++ | vcpkg.json, CMakeLists.txt, conanfile.txt | 🆕 新! |
| 🐘 PHP | composer.json, composer.lock | 🆕 新! |
| 🔷 .NET | *.csproj, packages.config, *.nuspec | 🆕 新! |