SuperAPI AI 工具集

security-detections-mcp

安全与审计

查看项目

更新于 10-16 02:00

技能介绍

security-detections-mcp 是一个 MCP 服务器,为 AI 智能体提供对 8200 多条安全检测规则的统一访问能力。这些规则分布在 Sigma、Splunk ESCU、Elastic、KQL、Sublime 和 CrowdStrike CQL 六种格式中,并通过 MITRE ATT&CK 映射进行关联。

主要能力

统一检测检索:通过单一 API 查询所有检测格式。

MITRE ATT&CK 集成:包含 172 个威胁行为体、784 个软件、4362 条来自 STIX 的关系。

覆盖度分析:按战术、技术、威胁行为体或过程识别缺口。

Navigator 层导出:导出 ATT&CK Navigator JSON 用于覆盖度可视化。

自主管道:CTI 摄入 → 缺口分析 → 检测生成 → Atomic 测试。

81 个 MCP 工具:搜索、过滤、分析、生成和比较检测规则。

11 个专家提示词:勒索软件评估、APT 模拟、紫队工作流。

安装方式

本地安装(完整功能)

快速开始(npx):npx -y security-detections-mcp

Claude Desktop 配置(macOS 路径 ~/Library/Application Support/Claude/claude_desktop_config.json):在 mcpServers 中添加 security-detections,command 为 npx,args 为 ["-y", "security-detections-mcp"],并通过 env 设置 SIGMA_PATHS、SPLUNK_PATHS、ELASTIC_PATHS、KQL_PATHS、SUBLIME_PATHS、CQL_HUB_PATHS、STORY_PATHS、ATTACK_STIX_PATH 等变量。

Cursor 配置(.cursor/config/mcp.json):同样在 mcpServers 中配置 command 为 npx,args 为 ["-y", "security-detections-mcp"],env 中指定检测规则路径。

Claude Code CLI:claude mcp add security-detections -- npx -y security-detections-mcp

托管方式(零配置)

在 https://detect.michaelhaag.org/account/tokens 获取 token(免费 200 次调用/天)。

Claude Code:claude mcp add --transport http security-detections https://detect.michaelhaag.org/api/mcp/mcp --header "Authorization: Bearer $SDMCP_TOKEN"

Claude Desktop(通过 mcp-remote):command 为 npx,args 为 ["-y", "mcp-remote", "https://detect.michaelhaag.org/api/mcp/mcp", "--header", "Authorization: Bearer $SDMCP_TOKEN"]。

获取检测内容

下载所有检测源(仅规则的稀疏检出):

Sigma(8K+ 规则):git clone --depth 1 --filter=blob:none --sparse https://github.com/SigmaHQ/sigma.git,然后 git sparse-checkout set rules rules-threat-hunting

Splunk ESCU:git clone --depth 1 --filter=blob:none --sparse https://github.com/splunk/security_content.git,然后 git sparse-checkout set detections stories

Elastic:git clone --depth 1 --filter=blob:none --sparse https://github.com/elastic/detection-rules.git,然后 git sparse-checkout set rules

KQL:git clone --depth 1 https://github.com/Bert-JanP/Hunting-Queries-Detection-Rules.git kql-bertjanp;git clone --depth 1 https://github.com/jkerai1/KQL-Queries.git kql-jkerai1

Sublime:git clone --depth 1 --filter=blob:none --sparse https://github.com/sublime-security/sublime-rules.git,然后 git sparse-checkout set detection-rules

CrowdStrike CQL:git clone --depth 1 https://github.com/ByteRay-Labs/Query-Hub.git cql-hub

之后设置路径环境变量,如 export SIGMA_PATHS="$PWD/sigma/rules,$PWD/sigma/rules-threat-hunting" 等。

核心 MCP 工具

搜索与检索:search(全文搜索,参数 query、limit)、get_by_id(按 ID 获取单条检测)、list_all(分页列出所有检测)、list_by_source(按来源类型过滤,可选 sigma、splunk_escu、elastic、kql、sublime、crowdstrike_cql)。

MITRE ATT&CK 过滤:list_by_mitre(按技术 ID,如 T1059.001)、list_by_mitre_tactic(按战术,如 execution)、list_by_cve(按 CVE ID)、list_by_process_name(按进程名)、list_by_severity(按严重级别,如 critical)。

覆盖度分析:analyze_coverage(整体覆盖统计,返回战术覆盖百分比、前 20 技术、薄弱点)、get_coverage_summary(快速战术摘要)、identify_gaps(按威胁画像识别缺口,如 ransomware、apt)、suggest_detections(针对技术建议检测)。

威胁行为体分析:analyze_actor_coverage(分析特定行为体覆盖,如 APT29)、compare_actor_coverage(比较多个行为体覆盖)、analyze_procedure_coverage(过程级覆盖)。

ATT&CK Navigator 层:generate_navigator_layer(生成覆盖/缺口/来源/严重级别/行为体层)。可将 JSON 导入 https://mitre-attack.github.io/attack-navigator/。

专家提示词

在对话中按名称调用:ransomware-readiness-assessment(勒索软件就绪评估)、apt-emulation-plan(如 for APT29)、purple-team-exercise(如 for credential dumping)、executive-detection-briefing。其他提示词包括 detection-gap-analysis、threat-actor-profile、detection-engineering-plan、coverage-improvement-roadmap、data-source-analysis、technique-deep-dive、detection-quality-audit。

高级用法

知识图谱查询:get_related_detections、learn_detection_patterns。

检测生成:generate_detection(从描述生成检测草稿,可指定 target_format 和 data_sources)、create_detection_from_template。

动态表格与迭代规划:create_dynamic_table、generate_sprint_plan。

配置

环境变量包括 SIGMA_PATHS、SPLUNK_PATHS、ELASTIC_PATHS、KQL_PATHS、SUBLIME_PATHS、CQL_HUB_PATHS、JAMF_PROTECT_PATHS、STORY_PATHS、ATTACK_STIX_PATH。下载 MITRE ATT&CK STIX:curl -o enterprise-attack.json https://raw.githubusercontent.com/mitre-attack/attack-stix-data/master/enterprise-attack/enterprise-attack.json。更新检测仓库后可通过 rebuild_index 重建索引。

常见使用模式

勒索软件覆盖检查:分析整体覆盖 → 识别勒索软件特定缺口 → 生成 Navigator 层可视化 → 获取可操作建议。

APT 威胁狩猎:分析行为体画像 → 查找现有检测 → 导出行为体层用于模拟规划。

检测开发工作流:从现有规则学习模式 → 生成检测草稿 → 用相似检测验证。

故障排查

如遇“未找到检测”,检查环境变量路径、确认目录含 YAML/TOML/JSON 文件,并在更新路径后运行 rebuild_index。如遇“MITRE 数据未加载”,设置 ATTACK_STIX_PATH 并下载 STIX 数据。搜索慢时,首次运行需构建索引(8K+ 规则约 30 秒),后续搜索使用内存缓存,建议使用过滤器而非宽泛搜索。Claude Desktop 不显示工具时,重启客户端并检查日志。托管 MCP 有速率限制:免费 200 次/天,Pro 2000 次/天。

资源链接

Web UI:https://detect.michaelhaag.org

API 文档:https://detect.michaelhaag.org/api/docs

安装指南:https://github.com/MHaggis/Security-Detections-MCP/blob/main/SETUP.md

托管 MCP 文档:https://github.com/MHaggis/Security-Detections-MCP/blob/main/docs/HOSTED_MCP.md

自主工作流:https://github.com/MHaggis/Security-Detections-MCP/blob/main/docs/AUTONOMOUS.md

工具参考:https://github.com/MHaggis/Security-Detections-MCP/blob/main/docs/wiki/Tools-Reference.md