/ 目录 / 演练场 / repo-forensics
● 社区 alexgreensh ⚡ 即开即用

repo-forensics

作者 alexgreensh · alexgreensh/repo-forensics

18 defensive scanners that vet a repo, skill, MCP server, or plugin for prompt injection, secrets, lifecycle hooks, typosquats, and tamper traces before you install.

Repo-forensics is a defensive audit tool aimed at the 'nobody does it' problem: vetting third-party code before installing it with full system access. 18 parallel scanners cover runtime dynamism, manifest drift, prompt-injection in SKILL.md, MCP tool poisoning, DAST of hook scripts, secrets, SAST, AST analysis, dependency typosquats, lifecycle hooks, entropy payloads, IaC misconfigs, binary disguises, post-incident traces, and git-commit spoofing. Zero deps.

为什么要用

核心特性

实时演示

实际使用效果

repo-forensics-skill.replay ▶ 就绪
0/0

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "repo-forensics-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/alexgreensh/repo-forensics",
        "~/.claude/skills/repo-forensics"
      ],
      "_inferred": true
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "repo-forensics-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/alexgreensh/repo-forensics",
        "~/.claude/skills/repo-forensics"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "repo-forensics-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/alexgreensh/repo-forensics",
        "~/.claude/skills/repo-forensics"
      ],
      "_inferred": true
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "repo-forensics-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/alexgreensh/repo-forensics",
        "~/.claude/skills/repo-forensics"
      ],
      "_inferred": true
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "repo-forensics-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/alexgreensh/repo-forensics",
        "~/.claude/skills/repo-forensics"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "repo-forensics-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/alexgreensh/repo-forensics",
          "~/.claude/skills/repo-forensics"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add repo-forensics-skill -- git clone https://github.com/alexgreensh/repo-forensics ~/.claude/skills/repo-forensics

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: repo-forensics

Audit a third-party skill before you clone it into ~/.claude/skills

👤 Anyone installing skills from strangers on GitHub ⏱ ~15 min beginner

何时使用: Someone sent you a cool-looking skill link. Before clone, you want to know if it's safe.

前置条件
  • repo-forensics installed — git clone https://github.com/alexgreensh/repo-forensics ~/.claude/skills/repo-forensics
步骤
  1. Point at the target repo URL
    Use repo-forensics. Scan https://github.com/<author>/<skill> with the skill_threats, secrets, dataflow, and lifecycle scanners. Report findings.✓ 已复制
    → Per-scanner report with severity flags
  2. Read correlated findings
    Any correlations across scanners — e.g. a secret-leak path plus a lifecycle hook?✓ 已复制
    → Correlation summary

结果: A go / no-go decision grounded in scanner output, not vibes.

注意事项
  • Trusting a green scan as full proof of safety — Scanners are strong floor, not a ceiling — still read SKILL.md
搭配使用: github · filesystem

Audit an MCP server for tool poisoning and rug-pull patterns

👤 Teams onboarding a new MCP into a production agent stack ⏱ ~20 min intermediate

何时使用: Before adding a new MCP server to an agent with real permissions.

步骤
  1. Run MCP-focused scanners
    Scan this MCP server repo with mcp_security, skill_threats, integrity, and dast.✓ 已复制
    → Findings focused on tool descriptions and install scripts
  2. Check git history for identity spoofing
    Run git_forensics on the same repo — any spoofed commits?✓ 已复制
    → Author / signing analysis

结果: An MCP security dossier before you wire it into your agent.

Run post-incident scanners after a suspicious install

👤 Anyone who just ran npm/pip install and feels uneasy ⏱ ~15 min intermediate

何时使用: Install finished with unexpected behavior; you want to know if something landed.

步骤
  1. Run post_incident + entropy scans
    Run post_incident scanner on ~/.npm and the current project. Also entropy scan the installed packages.✓ 已复制
    → Flags for suspicious cached artifacts or encoded payloads

结果: Evidence of whether to rotate secrets and rebuild.

注意事项
  • Running scans from the potentially-compromised shell — Run from a fresh shell or another machine when in doubt

组合

与其他 MCP 搭配,撬动十倍杠杆

repo-forensics-skill + github

Pull a PR's diff and scan only the added files

Fetch PR #123 and run repo-forensics just on the files it adds.✓ 已复制
repo-forensics-skill + filesystem

Scan a locally cloned repo and save a JSON report

Scan ./suspicious-repo and write findings.json next to it.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
skill_threats repo path Any skill audit 0
mcp_security repo path MCP audits 0
secrets repo path Always 0
dataflow repo path Suspicious egress concerns 0
lifecycle repo path Pre-install 0
git_forensics repo path Checking maintainer identity 0
entropy repo path Obfuscation suspected 0
sast repo path General code risk 0

成本与限制

运行它的成本

API 配额
None
每次调用 Token 数
Moderate — scanner output summarization can grow
费用
Free
提示
Run only the scanners relevant to the threat model (skills → skill_threats; MCP → mcp_security)

安全

权限、密钥、影响范围

凭据存储: None — scanner is read-only
数据出站: Local-only by default
切勿授予: Write access to the repo under audit

故障排查

常见错误与修复

Scanner reports 0 findings on obviously sketchy repo

Ensure you ran against the full repo path, not a subset; check scanner selection

验证: repo-forensics list-scanners
False positives flood the report

Filter by severity; focus on high/critical; use correlation to prioritize

替代方案

repo-forensics 对比其他方案

替代方案何时用它替代权衡
claude-cybersecurityYour code needs OWASP-style app security review rather than supply-chain vettingDifferent focus — app logic vs install-time threats
gitleaks / trufflehogYou only need secret scanningSingle-scanner, not correlation

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills