Vigile-ai/vigile-scan

GitHub: Vigile-ai/vigile-scan

面向 AI 代理工具的安全扫描器,检测 MCP 服务器和 Agent Skills 中的工具投毒、数据渗出与供应链攻击。

Stars: 0 | Forks: 0

# vigile-scan [![npm version](https://img.shields.io/npm/v/vigile-scan.svg)](https://www.npmjs.com/package/vigile-scan) [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ## 快速开始 ``` npx vigile-scan ``` 就是这么简单。无需安装,无需配置。Vigile 会自动发现您的 MCP server 配置和 agent skill 文件,根据 54 条检测规则对其进行扫描,并为每一项给出信任评分。 ## 检测内容 ### MCP Server 威胁 (22 种模式 + 5 项内联检查) | ID | 类别 | 捕获内容 | |----|----------|-----------------| | TP-001–008 | Tool Poisoning | Prompt 覆盖、隐藏操纵、跨 tool 注入、空白隐藏、system prompt 引用、保密指令 | | EX-001–007 | Data Exfiltration | SSH key 访问、AWS 凭证、.env 文件、凭证文件、可疑 URL、加密钱包访问、浏览器数据 | | PM-001–004 | Permission Abuse | 代码执行 (eval/spawn)、无限制文件系统、网络请求、敏感路径访问 | | OB-001–004 | Obfuscation | Base64 内容、零宽 Unicode、十六进制编码字符串、Unicode 转义 | | EV/AR/CM | Inline Checks | 敏感环境变量、安全绕过标志、敏感目录参数、自动安装 (npx -y)、typosquatting (拼写抢注) | ### Agent Skill 威胁 (27 种模式) | ID | 类别 | 捕获内容 | |----|----------|-----------------| | SK-001–006 | Instruction Injection | 角色劫持、指令覆盖、隐藏 markdown 指令、条件触发器、跨 skill 污染、不可见 Unicode | | SK-010–014 | Malware Delivery | 远程脚本管道、反向 shell、可疑安装前提条件、编码 payload、typosquatted 包 | | SK-020–023 | Stealth Operations | 静默动作指令、输出抑制、历史/日志规避、欺骗性用户响应 | | SK-030–033 | Safety Bypass | 确认绕过、安全功能禁用、强制标志、root/sudo 提权 | | SK-040–043 | Persistence Abuse | 启动文件修改、内存文件篡改、cron 任务、git hook 注入 | | SK-050–053 | Data Exfiltration | 凭证收集、基于 URL 的渗透、文件系统枚举、环境变量转储 | ## 平台 Vigile 自动发现来自以下平台的配置: - **Claude Desktop** — `claude_desktop_config.json` - **Claude Code** — `CLAUDE.md`, `.claude/` skill 文件 - **Cursor** — `.cursor/rules/*.mdc`, `.cursorrules` - **GitHub Copilot** — `.github/copilot/**/*.md`, `copilot-instructions.md` - **Windsurf** — `windsurf.json`, `.windsurfrules` - **VS Code** — `.vscode/mcp.json` - **OpenClaw** — `~/.openclaw/openclaw.json`, `openclaw.config.json` ## 用法 ``` vigile-scan [options] ``` ### 扫描选项 | Flag | 描述 | |------|-------------| | (无 flags) | 扫描本机上的所有 MCP server | | `-s, --skills` | 仅扫描 agent skills (SKILL.md, .mdc rules, CLAUDE.md) | | `-a, --all` | 同时扫描 MCP server 和 agent skills | | `-j, --json` | 以 JSON 格式输出结果 (用于 CI/CD pipelines) | | `-v, --verbose` | 显示详细发现和评分明细 | | `-c, --config ` | 自定义 MCP 配置文件的路径 | | `-o, --output ` | 将结果写入文件 | | `--client ` | 仅扫描特定 client (claude-desktop, cursor, claude-code, windsurf, vscode, openclaw) | | `--no-upload` | 跳过将扫描结果上传到 Vigile API | ### Sentinel 运行时监控 (Pro) | Flag | 描述 | |------|-------------| | `--sentinel` | 启用运行时回连检测 | | `--sentinel-server ` | 按名称监控特定的 MCP server | | `--sentinel-duration ` | 监控持续时间(秒)(默认: 120) | ### 认证 ``` # 使用你的 API key 进行认证 (在 https://vigile.dev/account 获取) vigile-scan auth login # 检查认证状态 vigile-scan auth status # 登出 vigile-scan auth logout ``` 您也可以将 `VIGILE_TOKEN` 设置为 CI/CD 的环境变量。 ## 示例 ### 扫描所有内容 ``` npx vigile-scan --all ``` ### 用于 CI/CD 的 JSON 输出 ``` npx vigile-scan --json --all > vigile-report.json ``` ### 扫描特定 client ``` npx vigile-scan --client cursor ``` ### 带评分明细的详细输出 ``` npx vigile-scan --all --verbose ``` ### GitHub Actions ``` - name: Vigile Security Scan run: npx vigile-scan --all --json -o vigile-report.json env: VIGILE_TOKEN: ${{ secrets.VIGILE_TOKEN }} - name: Fail on critical findings run: | critical=$(jq '.bySeverity.critical' vigile-report.json) if [ "$critical" -gt 0 ]; then exit 1; fi ``` ## 信任评分 每个扫描项都会获得一个 0–100 的信任评分: | 分数 | 等级 | 含义 | |-------|-------|---------| | 80–100 | Trusted (可信) | 未发现显著问题 | | 60–79 | Caution (注意) | 轻微问题 — 建议审查 | | 40–59 | Risky (危险) | 显著问题 — 使用前请调查 | | 0–39 | Dangerous (高危) | 严重问题 — 切勿安装 | 该评分是五个因素的加权综合:代码分析、依赖健康度、权限安全性、行为稳定性和透明度。 ## 退出码 | 代码 | 含义 | |------|---------| | 0 | 扫描完成,无严重或高危发现 | | 1 | 检测到严重或高危发现 | 这使得 `vigile-scan` 可以在 CI/CD pipelines 中原生工作 —— 非零退出会导致构建失败。 ## Sentinel: 运行时监控 静态扫描捕获代码中的内容。Sentinel 捕获代码在线路上的实际行为。 当您运行 `--sentinel` 时,Vigile 会拦截来自您 MCP server 的出站网络流量,并标记: - **C2 beaconing** — 向未知服务器的定期回连 - **Credential theft** — 通过网络发送的 API key、token 或 secrets - **DNS tunneling** — 隐藏在 DNS 查询中的数据渗透 - **Unexpected destinations** — 连接到预期集合之外的 IP/域名 Sentinel 适用于 Pro ($29/月) 和 Pro+ ($99/月) 计划。免费用户可以无限制地运行静态扫描。 ## 定价 | 层级 | 价格 | 亮点 | |------|-------|------------| | Free | $0/永久 | 无限 CLI 扫描,50 次 API 扫描/月,Registry 浏览 | | Pro | $29/月 | Sentinel 监控 (5 分钟, 3 台 server),1,000 次 API 扫描 | | Pro+ | $99/月 | Sentinel (30 分钟, 10 台 server),DNS tunneling & C2 检测,警报 | ## 链接 - **Web Scanner & Registry** — [vigile.dev](https://vigile.dev) - **GitHub** — [github.com/Vigile-ai/vigile-scan](https://github.com/Vigile-ai/vigile-scan) - **报告问题** — [github.com/Vigile-ai/vigile-scan/issues](https://github.com/Vigile-ai/vigile-scan/issues) ## 许可证 Apache-2.0
标签:AI安全, Chat Copilot, Code Injection, DNS 反向解析, DNS 解析, GNU通用公共许可证, IP 地址批量处理, LLM, LNA, MCP Server, MITM代理, Node.js, Python, StruQ, Typosquatting, Unmanaged PE, 云安全监控, 大模型安全, 工具投毒, 文档安全, 文档结构分析, 无后门, 暗色界面, 权限滥用, 混淆检测, 私有化部署, 网络安全审计, 自动化攻击, 防御规避, 静态分析