/ 目錄 / 演練場 / Trail of Bits Skills
● 社群 trailofbits ⚡ 即開即用

Trail of Bits Skills

作者 trailofbits · trailofbits/skills

Trail of Bits 的 Claude Code skills,用於安全代碼審查、漏洞偵測和防禦性稽核工作流程。

資安公司 Trail of Bits 將其內部代碼審查手冊封裝為 Claude Code skills。涵蓋跨語言的常見弱點偵測、密碼學錯誤捕捉、輸入驗證審查和 IaC 設定錯誤檢查。CC-BY-SA-4.0——可免費使用和改作。

為什麼要用

核心特性

即時演示

實際使用效果

就緒

安裝

選擇你的客戶端

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

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

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

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

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

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

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

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

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

Continue 使用伺服器物件陣列,而非映射。

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

加入 context_servers。Zed 儲存後熱重載。

claude mcp add trailofbits-skill -- git clone https://github.com/trailofbits/skills ~/.claude/skills/skills

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: Trail of Bits Skills

為每個 PR 加入安全審查步驟

👤 沒有專職資安工程師的團隊 ⏱ ~30 min intermediate

何時使用: 你的 PR 目前是從代碼審查直接合併——沒有安全把關。

前置條件
  • 已安裝 skills — git clone https://github.com/trailofbits/skills ~/.claude/skills/trailofbits
步驟
  1. 確認 diff 範圍
    Use trailofbits/pr-review skill on the current PR. List files the skill thinks are security-relevant with reasons.✓ 已複製
    → 各檔案的具體相關原因
  2. 深度審查
    For each flagged file, run the appropriate domain skill (crypto, input-validation, auth). Report findings with severity.✓ 已複製
    → 依嚴重性排序的清單,附有代碼引用
  3. 給審查者的摘要
    Write a 5-bullet PR comment summarizing the findings, non-scary but precise.✓ 已複製
    → 適合審查者閱讀的摘要,附有確切的行號引用

結果: 每個 PR 都有一份安全審查意見,能捕捉真實問題而不讓你被誤報淹沒。

注意事項
  • Skill 將風格問題標記為安全問題 — 在 prompt 中校準:「focus on exploitable issues only」
搭配使用: github · filesystem

稽核服務中的密碼學代碼路徑

👤 維護驗證或加密代碼的開發者 ⏱ ~90 min advanced

何時使用: 你有一個 JWT/HMAC/加密層,想找人仔細確認一遍。

步驟
  1. 找出密碼學代碼
    Use trailofbits/crypto-review. Scan /src for files that touch crypto APIs. Report them.✓ 已複製
    → 密碼學呼叫點盤點清單
  2. 逐一稽核
    For each site: what algorithm? Key management? Nonce reuse risk? IV handling? Cite source.✓ 已複製
    → 各呼叫點的稽核結果,附有代碼引用
  3. 修復計畫
    For any medium+ finding, draft a remediation — concrete code change, not "consider using ...".✓ 已複製
    → 可直接套用的 diff,而非模糊建議

結果: 附有具體修復方案的密碼學稽核報告,以 ToB 在真實專案中見過的常見錯誤為基準。

注意事項
  • 這不能取代真正的安全稽核 — 用於自我審查;高價值服務上線前仍需聘請專業人士
搭配使用: github

組合

與其他 MCP 搭配,撬動十倍槓桿

trailofbits-skill + github

將發現以 PR 審查意見形式發布

Post the review as a PR comment — severities as labels.✓ 已複製
trailofbits-skill + filesystem

離線掃描整個儲存庫

Run the full security sweep across /src and write report to /audit/report.md.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
scope_review diff|path 深入審查前 0
crypto_review path 針對密碼學代碼 0
input_validation_review path API 邊界代碼 0
iac_review path Terraform / CloudFormation / K8s 資訊清單 0

成本與限制

運行它的成本

API 配額
N/A
每次呼叫 Token 數
審查屬於閱讀密集型;token 預算與 diff 大小成正比
費用
免費(CC-BY-SA)
提示
先確認範圍——不要對不相關的檔案執行深度 skill

安全

權限、密鑰、影響範圍

最小權限: filesystem-read
憑證儲存:
資料出站: skill 本身不外送資料;審查的代碼存在於你的 LLM context 中
切勿授予: write access unless auto-remediating

故障排查

常見錯誤與修復

Skill flags safe code as vulnerable

要求說明理由;若理由薄弱,附帶原因地駁回。校準會隨 session 改善。

Misses obvious bugs

Skill 是 Trail of Bits 模式的編碼——若你的技術堆疊不常見(例如冷門的 Rust crate),可能會遺漏。請加入自訂模式。

Outputs too long to review

加上限制:「top 5 highest-severity findings only」

替代方案

Trail of Bits Skills 對比其他方案

替代方案何時用它替代權衡
Semgrep rules你想要 CI 中的靜態分析,而非互動式審查模式集較窄;沒有 LLM 推理能力
CodeQL你需要深度資料流分析設定複雜得多;不是 skill

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills