安全检测 MCP
一个 MCP(模型上下文协议)服务器,允许 LLM 查询Sigma 、Splunk ESCU 、Elastic 和KQL安全检测规则的统一数据库。
🆕 MCP 提示 - 专家检测工作流程
此服务器包含**11 个预置的 MCP 提示,**可为常见的安全检测任务提供结构化的专家级工作流程。您无需费心研究使用哪些工具以及使用顺序,只需按名称请求提示,即可获得全面专业的分析。
如何在光标中使用提示
只需告诉克劳德使用某个提示词即可:
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>You: "Use the ransomware-readiness-assessment prompt"
You: "Run apt-threat-emulation for APT29"
You: "Execute the executive-security-briefing prompt for our CISO"
You: "Use detection-engineering-sprint with capacity 5 and focus on ransomware"
</code></span></span></span></span>
可用提示
| 迅速的 | 描述 | 论点 |
|---|---|---|
ransomware-readiness-assessment |
包含风险评分和补救路线图的全面杀伤链分析 | priority_focus预防/检测/应对/全部 |
apt-threat-emulation |
评估针对特定威胁行为者(APT29、Lazarus、Volt Typhoon 等)的防护覆盖范围 | threat_actor(必需的),include_test_plan |
purple-team-exercise |
生成包含流程和预期检测结果的完整测试计划 | scope(战术或技术)environment |
soc-investigation-assist |
调查辅助人员,提供分诊指导、问题排查和升级标准。 | indicator(必需的),context |
detection-engineering-sprint |
优先级排序的检测待办事项,包含用户故事和验收标准 | sprint_capacity,threat_focus |
executive-security-briefing |
包含业务风险术语和投资建议的高管报告 | audience董事会/首席信息安全官/首席技术官include_benchmarks |
cve-response-assessment |
快速评估新出现的网络安全威胁和威胁 | cve_or_threat(必需的) |
data-source-gap-analysis |
分析遥测需求以提高检测覆盖率 | target_coverage |
detection-quality-review |
对特定技术的检测结果进行深入的质量分析 | technique_id(必需的) |
threat-landscape-sync |
将检测优先级与当前威胁形势保持一致 | industry |
detection-coverage-diff |
将覆盖范围与威胁行为者或基线进行比较。 | compare_against(必需的) |
示例:勒索软件评估
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>You: "Use the ransomware-readiness-assessment prompt"
Claude will automatically:
1. Get baseline stats with get_stats
2. Analyze ransomware-specific gaps with identify_gaps
3. Review coverage by tactic with analyze_coverage
4. Map gaps to the ransomware kill chain
5. Generate prioritized remediation roadmap
6. Output a professional report with risk scores
</code></span></span></span></span>
示例:APT威胁评估
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>You: "Run apt-threat-emulation for Volt Typhoon"
Claude will:
1. Research Volt Typhoon using MITRE ATT&CK data
2. Get all 81 techniques attributed to the group
3. Check your detection coverage for each technique
4. Calculate coverage percentage and identify blind spots
5. Generate a purple team test plan (optional)
6. Provide prioritized detection recommendations
</code></span></span></span></span>
特征
- 🆕 MCP 提示- 11 个预置的专家工作流程,适用于勒索软件评估、APT 模拟、紫队演练、高管简报等。
- 🆕 MCP 资源- 无需工具调用即可阅读 LLM 的相关背景信息(统计数据、覆盖率摘要、差距)。
- 🆕 参数补全- 输入时自动补全技术 ID、CVE 和进程名称
- 🆕 服务器使用说明- 内置使用指南,包含示例,帮助您更好地理解 LLM
- 🆕 结构化错误- 提供建议和类似项目的实用错误信息
- 🆕 交互式工具- 基于表单输入的差距优先级排序和迭代计划(Cursor 0.42+)
- 统一搜索- 通过单一界面查询 Sigma、Splunk ESCU、Elastic 和 KQL 检测结果
- 全文搜索- 基于 SQLite FTS5 的搜索功能,支持搜索名称、描述、查询、MITRE 策略、CVE、进程名称等。
- MITRE ATT&CK 映射- 按技术 ID 或战术过滤检测结果
- CVE 覆盖范围- 查找针对特定 CVE 漏洞的检测结果
- 进程名称搜索- 查找引用特定进程的检测结果(例如,powershell.exe、w3wp.exe)
- 分析故事- 按 Splunk 分析故事查询(可选 - 增强上下文)
- KQL 分类- 按类别筛选 KQL 查询(Defender For Endpoint、Azure AD、威胁狩猎等)
- 自动索引- 启动时自动从配置的路径索引检测结果
- 支持多种格式- YAML(Sigma、Splunk)、TOML(Elastic)、Markdown(KQL)
- Logsource 过滤- 按类别、产品或服务过滤 Sigma 规则
- 严重性筛选- 按严重级别筛选
快速入门
选项 1:npx(推荐)
无需安装 - 只需配置并运行:
npx -y security-detections-mcp
方案二:克隆并构建
git clone https://github.com/MHaggis/Security-Detections-MCP.git
cd Security-Detections-MCP
npm install
npm run build
配置
光标 IDE
添加到您的 MCP 配置(~/.cursor/mcp.json或.cursor/mcp.json您的项目中):
{
"mcpServers": {
"security-detections": {
"command": "npx",
"args": ["-y", "security-detections-mcp"],
"env": {
"SIGMA_PATHS": "/path/to/sigma/rules,/path/to/sigma/rules-threat-hunting",
"SPLUNK_PATHS": "/path/to/security_content/detections",
"ELASTIC_PATHS": "/path/to/detection-rules/rules",
"STORY_PATHS": "/path/to/security_content/stories",
"KQL_PATHS": "/path/to/Hunting-Queries-Detection-Rules"
}
}
}
}
克劳德桌面
添加~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"security-detections": {
"command": "npx",
"args": ["-y", "security-detections-mcp"],
"env": {
"SIGMA_PATHS": "/Users/you/sigma/rules,/Users/you/sigma/rules-threat-hunting",
"SPLUNK_PATHS": "/Users/you/security_content/detections",
"ELASTIC_PATHS": "/Users/you/detection-rules/rules",
"STORY_PATHS": "/Users/you/security_content/stories",
"KQL_PATHS": "/Users/you/Hunting-Queries-Detection-Rules"
}
}
}
}
Visual Studio Code
添加~/.vscode/mcp.json:
{
"servers": {
"security-detections": {
"type": "stdio",
"command": "npx",
"args": ["-y", "security-detections-mcp"],
"env": {
"SIGMA_PATHS": "/Users/you/sigma/rules,/Users/you/sigma/rules-threat-hunting",
"SPLUNK_PATHS": "/Users/you/security_content/detections",
"ELASTIC_PATHS": "/Users/you/detection-rules/rules",
"KQL_PATHS": "/Users/you/kql-bertjanp,/Users/you/kql-jkerai1",
"STORY_PATHS": "/Users/you/security_content/stories"
}
}
}
WSL 和 Visual Studio Code
添加~/.vscode/mcp.json:
{
"servers": {
"security-detections": {
"type": "stdio",
"command": "wsl",
"args": ["npx", "-y", "security-detections-mcp"],
"env": {
"SIGMA_PATHS": "/Users/you/sigma/rules,/Users/you/sigma/rules-threat-hunting",
"SPLUNK_PATHS": "/Users/you/security_content/detections",
"ELASTIC_PATHS": "/Users/you/detection-rules/rules",
"KQL_PATHS": "/Users/you/kql-bertjanp,/Users/you/kql-jkerai1",
"STORY_PATHS": "/Users/you/security_content/stories"
}
}
}
环境变量
| 多变的 | 描述 | 必需的 |
|---|---|---|
SIGMA_PATHS |
以逗号分隔的 Sigma 规则目录路径 | 至少需要一个信息来源 |
SPLUNK_PATHS |
以逗号分隔的 Splunk ESCU 检测目录路径 | 至少需要一个信息来源 |
ELASTIC_PATHS |
以逗号分隔的 Elastic 检测规则目录路径 | 至少需要一个信息来源 |
KQL_PATHS |
以逗号分隔的 KQL 查询目录路径 | 至少需要一个信息来源 |
STORY_PATHS |
以逗号分隔的 Splunk 分析故事目录路径 | 否(增强上下文) |
获取检测内容
快速入门:下载所有规则(复制粘贴)
创建一个detections文件夹,并使用稀疏检出方式下载所有源代码(仅下载规则,不下载完整存储库):
# Create detections directory
mkdir -p detections && cd detections
# Download Sigma rules (~3,000+ rules)
git clone --depth 1 --filter=blob:none --sparse https://github.com/SigmaHQ/sigma.git
cd sigma && git sparse-checkout set rules rules-threat-hunting && cd ..
# Download Splunk ESCU detections + stories (~2,000+ detections, ~330 stories)
git clone --depth 1 --filter=blob:none --sparse https://github.com/splunk/security_content.git
cd security_content && git sparse-checkout set detections stories && cd ..
# Download Elastic detection rules (~1,500+ rules)
git clone --depth 1 --filter=blob:none --sparse https://github.com/elastic/detection-rules.git
cd detection-rules && git sparse-checkout set rules && cd ..
# Download KQL hunting queries (~400+ queries from 2 repos)
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
echo "Done! Configure your MCP with these paths:"
echo " SIGMA_PATHS: $(pwd)/sigma/rules,$(pwd)/sigma/rules-threat-hunting"
echo " SPLUNK_PATHS: $(pwd)/security_content/detections"
echo " ELASTIC_PATHS: $(pwd)/detection-rules/rules"
echo " KQL_PATHS: $(pwd)/kql-bertjanp,$(pwd)/kql-jkerai1"
echo " STORY_PATHS: $(pwd)/security_content/stories"
替代方案:完全克隆
如果您需要完整的 Git 历史记录:
# Sigma Rules
git clone https://github.com/SigmaHQ/sigma.git
# Use rules/ and rules-threat-hunting/ directories
# Splunk ESCU
git clone https://github.com/splunk/security_content.git
# Use detections/ and stories/ directories
# Elastic Detection Rules
git clone https://github.com/elastic/detection-rules.git
# Use rules/ directory
# KQL Hunting Queries (multiple sources supported)
git clone https://github.com/Bert-JanP/Hunting-Queries-Detection-Rules.git
git clone https://github.com/jkerai1/KQL-Queries.git
# Use entire repos, combine paths with comma
🆕 MCP 资源 - 易读背景
MCP Resources 允许 LLM 直接读取上下文,无需调用工具。非常适合在做出决策前了解当前状态。
可用资源
| 资源URI | 描述 |
|---|---|
detection://stats |
当前库存统计数据 |
detection://coverage-summary |
逐个战术覆盖率 |
detection://gaps/ransomware |
当前勒索软件检测漏洞 |
detection://gaps/apt |
当前APT检测的不足之处 |
detection://top-techniques |
覆盖面最广的前 20 项技术 |
当需要时,资源会自动在 Cursor 的上下文中可用。
🆕 论证完成
服务器会在您输入参数值时提供自动补全建议:
| 争论 | 完成情况 |
|---|---|
technique_id |
您已索引的 MITRE 技术 ID(例如 T1059.001) |
cve_id |
您已索引的 CVE ID(CVE-2024-27198 等) |
process_name |
检测结果中的进程名称(powershell.exe 等) |
tactic |
MITRE全部14种策略 |
severity |
信息量、低、中、高、关键 |
source_type |
Sigma、Splunk_escu、Elastic、KQL |
threat_profile |
勒索软件、apt、初始访问、持久化等。 |
这可以防止拼写错误,并有助于发现检测语料库中可用的值。
🆕 结构化错误和建议
当发生错误或未找到结果时,服务器会返回**有用的 JSON 响应,**而不是纯字符串:
// Missing required argument
{
"error": true,
"code": "MISSING_REQUIRED_ARG",
"message": "technique_id is required",
"examples": ["T1059.001", "T1547.001", "T1003.001"],
"hint": "Use format T####.### (e.g., T1059.001 for PowerShell)"
}
// No results found
{
"results": [],
"technique_id": "T1234.999",
"suggestions": {
"message": "No detections found for this technique",
"similar_techniques": ["T1234.001", "T1234.002"],
"try_search": "search(\"T1234\") for broader results",
"tip": "Parent techniques (T1234) may catch sub-techniques"
}
}
这有助于法学硕士进行自我纠正,并提出替代方案,而不会陷入困境。
🆕 交互式工具(光标 0.42+)
这些工具使用MCP 请求来呈现交互式配置表单:
| 工具 | 描述 |
|---|---|
prioritize_gaps |
分析差距并获取优先建议 |
plan_detection_sprint |
交互式冲刺配置,包含容量/重点/数据源选项 |
例子:
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>You: "Help me prioritize which ransomware gaps to fix first"
Tool: prioritize_gaps(threat_profile="ransomware")
→ Returns P0/P1/P2 prioritized gaps with selection guidance
</code></span></span></span></span>
MCP 工具
核心检测工具
| 工具 | 描述 |
|---|---|
search(query, limit) |
对所有检测字段(名称、描述、查询、CVE、进程名称等)进行全文搜索 |
get_by_id(id) |
通过其 ID 获取单个检测结果。 |
list_all(limit, offset) |
所有检测结果的分页列表 |
list_by_source(source_type) |
按以下方式筛选:sigma,,,或splunk_escu``elastic``kql |
get_raw_yaml(id) |
获取原始 YAML/TOML/Markdown 内容 |
get_stats() |
获取索引统计信息 |
rebuild_index() |
强制从已配置路径重新索引 |
MITRE ATT&CK 过滤器
| 工具 | 描述 |
|---|---|
list_by_mitre(technique_id) |
按 MITRE ATT&CK 技术 ID 过滤(例如,T1059.001) |
list_by_mitre_tactic(tactic) |
按策略筛选(执行、持久化、凭证访问等) |
漏洞与流程过滤器
| 工具 | 描述 |
|---|---|
list_by_cve(cve_id) |
查找针对特定 CVE(例如 CVE-2024-27198)的检测结果 |
list_by_process_name(process_name) |
查找引用进程(例如 powershell.exe、w3wp.exe)的检测结果 |
list_by_data_source(data_source) |
按数据源筛选(例如,Sysmon、Windows 安全中心) |
分类过滤器
| 工具 | 描述 |
|---|---|
list_by_logsource(category, product, service) |
按对数源筛选 Sigma 规则 |
list_by_severity(level) |
按严重程度筛选(信息/低/中/高/危急) |
list_by_detection_type(type) |
按类型筛选(TTP、异常、搜寻、相关性) |
list_by_analytic_story(story) |
按 Splunk 分析故事筛选 |
KQL特定过滤器
| 工具 | 描述 |
|---|---|
list_by_kql_category(category) |
按类别筛选 KQL(例如,"Defender For Endpoint"、"Azure Active Directory"、"威胁狩猎") |
list_by_kql_tag(tag) |
按标签筛选 KQL(例如,"勒索软件"、"狩猎"、"ti-feed"、"dfir") |
list_by_kql_datasource(data_source) |
按 Microsoft 数据源筛选 KQL(例如,"DeviceProcessEvents"、"SigninLogs") |
故事工具(可选)
| 工具 | 描述 |
|---|---|
search_stories(query, limit) |
按叙述和描述搜索分析故事 |
get_story(name) |
获取详细的故事信息 |
list_stories(limit, offset) |
列出所有分析报道 |
list_stories_by_category(category) |
按类别筛选新闻(恶意软件、攻击者策略等) |
高效分析工具(令牌优化)
这些工具在服务器端进行大量处理,但只返回最少量的、可操作的数据:
| 工具 | 描述 | 输出大小 |
|---|---|---|
analyze_coverage(source_type?) |
按战术、常用技巧和弱点获取覆盖率统计数据 | 约2KB |
identify_gaps(threat_profile, source_type?) |
找出勒索软件、apt、持久化等方面的漏洞。 | 约500亿 |
suggest_detections(technique_id, source_type?) |
寻找检测技术的思路 | 约2KB |
get_technique_ids(source_type?, tactic?, severity?) |
仅获取技术 ID(不获取完整对象) | 约200亿 |
get_coverage_summary(source_type?) |
仅战术百分比(约200字节) | 约200亿 |
get_top_gaps(threat_profile) |
仅列出前 5 个间隙技术 ID(约 300 字节) | 约300亿 |
get_technique_count(technique_id) |
仅一种技术的计数(约 50 字节) | 约500亿 |
**为什么要使用这些工具?**传统工具会返回完整的检测对象(每次查询约 50KB 以上)。而这些工具只返回您需要的信息,可以节省 25 倍以上的令牌。
交互式工具
| 工具 | 描述 |
|---|---|
prioritize_gaps(threat_profile, source_type?) |
分析差距,并确定 P0/P1/P2 优先级和选择指南 |
plan_detection_sprint() |
使用推荐的待办事项列表生成冲刺配置选项 |
MCP 提示 - 详细参考
MCP 提示是预先构建的专家级工作流程,可指导 Claude 完成复杂的分析任务。它们通过精确定义要使用的工具及其使用顺序,确保获得一致且全面的结果。
为什么使用提示而不是临时提问?
| 临时问题 | 带 MCP 提示 |
|---|---|
| "查看我的勒索软件防护覆盖范围" | "使用勒索软件防范评估" |
| 克劳德可能会检查两三件事。 | 克劳德执行了超过 15 个步骤的工作流程 |
| 输出格式不一致 | 包含风险评分的专业报告 |
| 可能会忽略重要方面 | 综合杀伤链分析 |
| 每次情况都不一样 | 可重复、可审计的结果 |
提示类别
🎯 威胁评估提示
ransomware-readiness-assessment
- 完整的勒索软件攻击链分析
- 每个攻击阶段的风险评分
- 优先补救路线图
- 可供高管使用的报告
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Use ransomware-readiness-assessment with priority_focus "detection"
</code></span></span></span></span>
apt-threat-emulation
- 针对特定威胁行为者的覆盖范围分析
- 逐项技术差距识别
- 可选的紫队测试计划生成
- 支持所有 MITRE ATT&CK 组织(APT29、Lazarus、Volt Typhoon、Scattered Spider 等)。
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Run apt-threat-emulation for "Scattered Spider" with include_test_plan true
</code></span></span></span></span>
threat-landscape-sync
- 将检测结果与当前威胁保持一致
- 行业特定威胁优先级排序
- 顶级演员覆盖分析
- 战略路线图制定
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Use threat-landscape-sync for the finance industry
</code></span></span></span></span>
🔬 紫色团队和验证提示
purple-team-exercise
- 针对某项战术或技术制定完整的演练计划
- 测试用例开发及相关流程
- 预期检测映射
- 安全控制和回滚计划
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Run purple-team-exercise for "persistence" in a "windows" environment
</code></span></span></span></span>
detection-quality-review
- 对检测效果的深入分析
- 绕过和规避分析
- 质量评分和改进建议
- 增强型检测逻辑建议
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Use detection-quality-review for T1059.001
</code></span></span></span></span>
📊 规划与报告提示
detection-engineering-sprint
- 基于威胁信息的待办事项优先级排序
- 用户故事及其验收标准
- 工作量估算和能力规划
- 重点领域:勒索软件、应用威胁、内部人员、云、平衡
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Run detection-engineering-sprint with sprint_capacity 5 and threat_focus "apt"
</code></span></span></span></span>
executive-security-briefing
- 商业风险转换
- 覆盖率指标和趋势
- 投资建议及投资回报率
- 针对特定受众的格式(董事会、首席信息安全官、首席技术官)
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Use executive-security-briefing for audience "board" with include_benchmarks true
</code></span></span></span></span>
🚨 事件响应提示
soc-investigation-assist
- 警报分诊指南
- MITRE ATT&CK 上下文
- 相关检测和搜索查询
- 升级决策树
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Use soc-investigation-assist for "suspicious PowerShell execution" with context "domain controller, after hours"
</code></span></span></span></span>
cve-response-assessment
- 快速威胁评估
- 现有覆盖范围检查
- 立即采取行动的建议
- 狩猎查询生成
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Run cve-response-assessment for CVE-2024-27198
</code></span></span></span></span>
🔧 差距分析提示
data-source-gap-analysis
- 遥测需求分析
- 按投资回报率确定数据源优先级
- 实施路线图
- 成本效益分析
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Use data-source-gap-analysis for target_coverage "credential-access"
</code></span></span></span></span>
detection-coverage-diff
- 与威胁行为者或基线进行比较
- 进度跟踪
- 实现平价路径规划
- 工作量估算
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>Run detection-coverage-diff comparing against "APT29"
</code></span></span></span></span>
最佳搭配:MITRE ATT&CK MCP
这些提示与mitre-attack-mcp配合使用效果更佳。提示会自动利用 MITRE ATT&CK 工具执行以下操作:
- 威胁行为者技术查找
- 技术细节和检测指南
- 缓解措施建议
克劳德代码技能
该仓库包含Claude 的代码技能,旨在.claude/skills/教会 Claude 高效的工作流程:
| 技能 | 目的 |
|---|---|
coverage-analysis |
使用标记优化工具进行高效的覆盖率分析 |
**为什么要使用技能?**技能可以让克劳德一次性学会一种方法,而无需每次都去摸索方法(浪费代币)。
您还可以安装个人技能以~/.claude/skills/供跨项目使用。
示例:高效覆盖率分析
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>You: "What's my Elastic coverage against ransomware?"
AI uses skills + efficient tools:
1. analyze_coverage(source_type="elastic") → Stats by tactic
2. identify_gaps(threat_profile="ransomware") → Prioritized gaps
3. suggest_detections(technique_id="T1486") → Fix top gap
Total: ~5KB of data vs ~500KB with traditional tools
</code></span></span></span></span>
示例工作流程
使用 MCP 提示(推荐用于复杂任务)
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code># Comprehensive ransomware assessment
You: "Use the ransomware-readiness-assessment prompt"
→ Full kill-chain analysis with risk scoring and remediation roadmap
# Assess coverage against a specific APT
You: "Run apt-threat-emulation for Volt Typhoon"
→ Technique-by-technique coverage analysis with test plan
# Generate a sprint backlog
You: "Use detection-engineering-sprint with capacity 5 focusing on apt threats"
→ Prioritized user stories with acceptance criteria
# Executive reporting
You: "Run executive-security-briefing for the board"
→ Business-risk language with investment recommendations
</code></span></span></span></span>
直接使用工具(快速查询)
查找 PowerShell 检测
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>LLM: "Find me PowerShell detections related to base64 encoding"
Tool: search(query="powershell base64", limit=5)
</code></span></span></span></span>
查看 CVE 覆盖范围
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>LLM: "Do we have detections for CVE-2024-27198?"
Tool: list_by_cve(cve_id="CVE-2024-27198")
</code></span></span></span></span>
比较不同来源的报道
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>LLM: "What detections do we have for credential dumping?"
Tool: search(query="credential dumping", limit=10)
→ Returns results from Sigma, Splunk, Elastic, AND KQL
</code></span></span></span></span>
查找 Web 服务器攻击检测
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>LLM: "What detections cover IIS web server attacks?"
Tool: list_by_process_name(process_name="w3wp.exe")
</code></span></span></span></span>
探索威胁活动
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>LLM: "Tell me about ransomware detections"
Tool: search_stories(query="ransomware")
Tool: list_by_analytic_story(story="Ransomware")
</code></span></span></span></span>
查找 Defender 的 KQL 狩猎查询
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>LLM: "What KQL queries do we have for Defender For Endpoint?"
Tool: list_by_kql_category(category="Defender For Endpoint")
</code></span></span></span></span>
搜索寻血猎犬侦测结果
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>LLM: "Find detections for BloodHound usage"
Tool: search(query="bloodhound", limit=10)
→ Returns KQL hunting queries and other source detections
</code></span></span></span></span>
统一模式
所有检测源(Sigma、Splunk、Elastic、KQL)均已规范化为通用模式:
核心领域
| 场地 | 描述 |
|---|---|
id |
唯一标识符 |
name |
检测名称/标题 |
description |
检测的目的是什么? |
query |
检测逻辑(Sigma YAML、Splunk SPL、Elastic EQL 或 KQL) |
source_type |
sigma,splunk_escu,elastic, 或者kql |
severity |
检测严重程度 |
status |
规则状态(稳定版、测试版、实验版、正式版等) |
author |
规则制定者 |
file_path |
原始文件路径 |
raw_yaml |
原始 YAML/TOML/Markdown 内容 |
增强字段(用于语义搜索)
| 场地 | 描述 |
|---|---|
mitre_ids |
映射的 MITRE ATT&CK 技术 ID |
mitre_tactics |
提取的MITRE策略(执行、持久化等) |
cves |
CVE标识符(例如,CVE-2024-27198) |
analytic_stories |
Splunk 分析故事名称 |
process_names |
检测中引用的进程名称 |
file_paths |
引用的有趣文件路径 |
registry_paths |
引用的注册表路径 |
data_sources |
所需数据源(Sysmon、DeviceProcessEvents 等) |
detection_type |
TTP、异常、狩猎或相关性 |
asset_type |
终端、Web 服务器、云、网络 |
security_domain |
端点、网络、云、访问 |
KQL特定字段
| 场地 | 描述 |
|---|---|
kql_category |
从文件夹路径派生的类别(例如,"Defender For Endpoint") |
kql_tags |
提取的标签(例如,"勒索软件"、"狩猎"、"ti-feed") |
kql_keywords |
提取的安全关键词用于搜索 |
platforms |
平台(Windows、Azure AD、Office 365 等) |
数据库
索引存储在~/.cache/security-detections-mcp/detections.sqlite。
- 首次运行时自动创建
- 配置路径时自动建立索引
- 用于
rebuild_index()在更新检测库后刷新
支持的检测格式
Sigma 规则(YAML)
根据Sigma官方规格:
- 所有必填字段:
title,,logsource``detection - 所有可选字段:
id,,,,,,,,,,,等等。status``description``author``date``modified``references``tags``level``falsepositives - 从字段中提取的 CVE 标签
tags(例如,cve.2021-1675)
Splunk ESCU(YAML)
来自Splunk 安全内容:
- 必需的:
name,id,search - 可选:
description,,,,,(包括,,)author``date``status``references``tags``mitre_attack_id``analytic_story``cve
Splunk 分析故事(YAML - 可选)
- 为威胁活动提供丰富的叙事背景
- 通过详细描述增强语义搜索
- 将检测结果与更广泛的威胁背景联系起来
弹性检测规则(TOML)
来自Elastic 检测规则:
- 必需的:
rule.name,rule.rule_id - 可选:
rule.description,,,,(MITRE 映射rule.query)rule.severity``rule.tags``rule.threat - 支持 EQL、KQL、Lucene 和 ESQL 查询语言
KQL 查询(Markdown 和原始 .kql 文件)
支持多个 KQL 存储库:
Bert-JanP/Hunting-Queries-Detection-Rules(约 290 个查询)
- Markdown 格式的 Microsoft Defender XDR 和 Azure Sentinel 狩猎查询
- 从 Markdown 标题中提取标题,从代码块中提取 KQL 查询语句
- 从表中提取 MITRE 技术 ID
- 类别:Defender For Endpoint、Azure AD、威胁狩猎、数字取证与事件响应 (DFIR) 等。
jkerai1/KQL 查询(约 130 个查询)
.kqlDefender、Entra、Azure、Office 365 的原始文件- 标题源自文件名
- kqlsearch.com 的轻量级查询
发展
# Install dependencies
npm install
# Build
npm run build
# Run with paths
SIGMA_PATHS="./detections/sigma/rules" \
SPLUNK_PATHS="./detections/splunk/detections" \
ELASTIC_PATHS="./detections/elastic/rules" \
KQL_PATHS="./detections/kql" \
STORY_PATHS="./detections/splunk/stories" \
npm start
统计数据(包含完整内容)
当包含所有来源的完整索引时:
| 来源 | 数数 |
|---|---|
| 西格玛规则 | 约3000+ |
| Splunk ESCU | 约2000+ |
| 弹性规则 | 约1500+ |
| KQL 查询 | 约420+ |
| 分析故事 | 约330 |
| 全部的 | 约7200+ |
🔗 与 MITRE ATT&CK MCP 一起使用
该 MCP 与mitre-attack-mcp **完美配合,**可实现全面的威胁覆盖分析:
| MCP | 目的 |
|---|---|
| 安全检测-mcp | 查询 7200 多条检测规则 + 11 个专家工作流程提示 |
| mitre-attack-mcp | ATT&CK框架数据、威胁组、导航层 |
使用 MCP 提示(最简单)
提示信息会自动利用这两个 MCP 进行全面分析:
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>You: "Run apt-threat-emulation for APT29"
The prompt automatically:
1. Uses mitre-attack-mcp to get APT29's profile and techniques
2. Uses security-detections-mcp to check coverage for each technique
3. Calculates coverage percentage and identifies gaps
4. Generates purple team test plan
5. Outputs professional report with recommendations
</code></span></span></span></span>
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>You: "Use threat-landscape-sync for the finance industry"
The prompt automatically:
1. Gets top threat actors from mitre-attack-mcp
2. Filters by industry relevance
3. Analyzes your coverage against each actor
4. Prioritizes detection investments
5. Creates strategic roadmap
</code></span></span></span></span>
直接使用工具(更多控制)
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>You: "What's my coverage against APT29?"
LLM workflow (3 calls, ~10KB total):
1. mitre-attack-mcp → get_group_techniques("G0016") # APT29's TTPs
2. detections-mcp → analyze_coverage(source_type="elastic") # Your coverage
3. mitre-attack-mcp → find_group_gaps("G0016", your_coverage) # The gaps
Result: Prioritized gap list, not 500KB of raw data
</code></span></span></span></span>
生成导航层
notranslate
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>You: "Generate a Navigator layer for my initial access coverage"
LLM workflow:
1. detections-mcp → get_technique_ids(tactic="initial-access") # Get covered technique IDs
2. mitre-attack-mcp → generate_coverage_layer(covered_ids, "Initial Access Coverage")
→ Returns ready-to-import Navigator JSON
</code></span></span></span></span>
同时安装两者(推荐)
{
"mcpServers": {
"security-detections": {
"command": "npx",
"args": ["-y", "security-detections-mcp"],
"env": {
"SIGMA_PATHS": "/path/to/sigma/rules",
"SPLUNK_PATHS": "/path/to/security_content/detections",
"ELASTIC_PATHS": "/path/to/detection-rules/rules",
"KQL_PATHS": "/path/to/kql-hunting-queries"
}
},
"mitre-attack": {
"command": "npx",
"args": ["-y", "mitre-attack-mcp"],
"env": {
"ATTACK_DOMAIN": "enterprise-attack"
}
}
}
}
执照
Apache 2.0