security-detections-mcp 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +136 -1317
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -12,9 +12,38 @@ An MCP (Model Context Protocol) server that lets LLMs query a unified database o
12
12
 
13
13
  **Hosted (zero setup)** — a Streamable HTTP server at [`detect.michaelhaag.org/api/mcp/mcp`](https://detect.michaelhaag.org/mcp). Sign up, generate a token, paste one URL into your MCP client. ~25 read-only tools, always in sync with the latest content, 200 calls/day free. Read on for quick-install buttons.
14
14
 
15
- ### Install — Local (Cursor)
15
+ ### Install — Local
16
16
 
17
17
  [![Install Local MCP in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=security-detections&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInNlY3VyaXR5LWRldGVjdGlvbnMtbWNwIl0sImVudiI6eyJTSUdNQV9QQVRIUyI6Ii9wYXRoL3RvL3NpZ21hL3J1bGVzLC9wYXRoL3RvL3NpZ21hL3J1bGVzLXRocmVhdC1odW50aW5nIiwiU1BMVU5LX1BBVEhTIjoiL3BhdGgvdG8vc2VjdXJpdHlfY29udGVudC9kZXRlY3Rpb25zIiwiU1RPUllfUEFUSFMiOiIvcGF0aC90by9zZWN1cml0eV9jb250ZW50L3N0b3JpZXMiLCJFTEFTVElDX1BBVEhTIjoiL3BhdGgvdG8vZGV0ZWN0aW9uLXJ1bGVzL3J1bGVzIiwiS1FMX1BBVEhTIjoiL3BhdGgvdG8va3FsLXJ1bGVzIiwiU1VCTElNRV9QQVRIUyI6Ii9wYXRoL3RvL3N1YmxpbWUtcnVsZXMvZGV0ZWN0aW9uLXJ1bGVzIiwiQ1FMX0hVQl9QQVRIUyI6Ii9wYXRoL3RvL2NxbC1odWIvcXVlcmllcyJ9fQ==)
18
+ [![Install Local MCP in VS Code](https://img.shields.io/badge/VS_Code-Install_Local_MCP-0078d4?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?name=security-detections&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22security-detections-mcp%22%5D%7D)
19
+ [![Install Local MCP in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Local_MCP-24bfa5?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders:mcp/install?name=security-detections&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22security-detections-mcp%22%5D%7D)
20
+
21
+ **Claude Code** (CLI one-liner):
22
+
23
+ ```bash
24
+ claude mcp add security-detections -- npx -y security-detections-mcp
25
+ ```
26
+
27
+ **Claude Desktop** — add to `claude_desktop_config.json`:
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "security-detections": {
33
+ "command": "npx",
34
+ "args": ["-y", "security-detections-mcp"]
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ **OpenAI Codex** (CLI):
41
+
42
+ ```bash
43
+ codex mcp add security-detections -- npx -y security-detections-mcp
44
+ ```
45
+
46
+ > After install, configure env vars (`SIGMA_PATHS`, `SPLUNK_PATHS`, etc.) to point at your detection repos. See the [Setup Guide](./SETUP.md) for full details.
18
47
 
19
48
  ### Install — Hosted (no setup, token required)
20
49
 
@@ -22,8 +51,8 @@ An MCP (Model Context Protocol) server that lets LLMs query a unified database o
22
51
  2. **Click the button for your client** — replace `sdmcp_YOUR_TOKEN_HERE` in the resulting config with the token you just generated.
23
52
 
24
53
  [![Install Hosted MCP in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=security-detections-hosted&config=eyJ1cmwiOiJodHRwczovL2RldGVjdC5taWNoYWVsaGFhZy5vcmcvYXBpL21jcC9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiJCZWFyZXIgc2RtY3BfWU9VUl9UT0tFTl9IRVJFIn19)
25
- [![Install Hosted MCP in VS Code](https://img.shields.io/badge/VS_Code-Install_Hosted_MCP-0078d4?style=for-the-badge&logo=visualstudiocode&logoColor=white)](vscode:mcp/install?%7B%22name%22%3A%22security-detections%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A//detect.michaelhaag.org/api/mcp/mcp%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22Bearer%20sdmcp_YOUR_TOKEN_HERE%22%7D%7D)
26
- [![Install Hosted MCP in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Hosted_MCP-24bfa5?style=for-the-badge&logo=visualstudiocode&logoColor=white)](vscode-insiders:mcp/install?%7B%22name%22%3A%22security-detections%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A//detect.michaelhaag.org/api/mcp/mcp%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22Bearer%20sdmcp_YOUR_TOKEN_HERE%22%7D%7D)
54
+ [![Install Hosted MCP in VS Code](https://img.shields.io/badge/VS_Code-Install_Hosted_MCP-0078d4?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?name=security-detections&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fdetect.michaelhaag.org%2Fapi%2Fmcp%2Fmcp%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22Bearer%20sdmcp_YOUR_TOKEN_HERE%22%7D%7D)
55
+ [![Install Hosted MCP in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Hosted_MCP-24bfa5?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders:mcp/install?name=security-detections&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fdetect.michaelhaag.org%2Fapi%2Fmcp%2Fmcp%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22Bearer%20sdmcp_YOUR_TOKEN_HERE%22%7D%7D)
27
56
 
28
57
  **Claude Code** (CLI one-liner):
29
58
 
@@ -55,578 +84,61 @@ claude mcp add --transport http security-detections \
55
84
  **OpenAI Codex** (CLI):
56
85
 
57
86
  ```bash
87
+ # Set your token as an env var first: export SDMCP_TOKEN="sdmcp_YOUR_TOKEN_HERE"
58
88
  codex mcp add security-detections \
59
- --transport http https://detect.michaelhaag.org/api/mcp/mcp \
60
- --header "Authorization: Bearer sdmcp_YOUR_TOKEN_HERE"
89
+ --url https://detect.michaelhaag.org/api/mcp/mcp \
90
+ --bearer-token-env-var SDMCP_TOKEN
61
91
  ```
62
92
 
63
93
  See the [Hosted MCP Setup Guide](./docs/HOSTED_MCP.md) for the full table of clients, the complete tool inventory, and troubleshooting tips.
64
94
 
65
- ## What's New in 3.2
66
-
67
- ### MITRE ATT&CK STIX Integration & Threat Actor Coverage
68
-
69
- Ingest the official MITRE ATT&CK STIX bundle to auto-populate **172 threat actors**, **784 software/malware**, and **4,362 actor-technique relationships**. Answer "What's our coverage against APT29?" with a single tool call.
70
-
71
- - **`analyze_actor_coverage`** - Coverage analysis against a specific threat actor: which of their known techniques have detections, coverage %, and prioritized gaps
72
- - **`list_actors`** - Browse all 172 MITRE ATT&CK threat actors with technique counts
73
- - **`compare_actor_coverage`** - Compare coverage across multiple actors, find shared gaps
74
- - **`get_actor_profile`** - Full actor dossier: description, aliases, techniques, software, coverage status
75
-
76
- ```
77
- "What's our coverage against APT29?"
78
-
79
- APT29 (Cozy Bear, Midnight Blizzard, NOBELIUM)
80
- Techniques: 66 | Covered: 48 | Gaps: 18 | Coverage: 73%
81
-
82
- By Tactic:
83
- credential-access: 7/8 (88%) persistence: 12/15 (80%)
84
- defense-evasion: 10/15 (67%) initial-access: 5/9 (56%)
85
-
86
- Priority Gaps:
87
- T1021.007 Cloud Services (lateral-movement)
88
- T1556.006 Multi-Factor Authentication (credential-access, defense-evasion)
89
- T1550.004 Web Session Cookie (defense-evasion, lateral-movement)
90
- ```
91
-
92
- **Setup**: Download `enterprise-attack.json` and set `ATTACK_STIX_PATH`:
93
- ```bash
94
- git clone https://github.com/mitre-attack/attack-stix-data.git
95
- # Set ATTACK_STIX_PATH=/path/to/attack-stix-data/enterprise-attack/enterprise-attack.json
96
- ```
97
-
98
- ### Materialized Relationship Graph
99
-
100
- Junction tables (`detection_techniques`, `technique_tactics`) replace JSON LIKE scans with indexed JOINs. Queries like `list_by_mitre` are now backed by proper SQL joins instead of `WHERE mitre_ids LIKE '%T1059%'` patterns. Dynamic tactic totals from STIX replace hardcoded values in coverage analysis.
101
-
102
- ### Procedure-Level Coverage Analysis
103
-
104
- Go beyond "we cover T1059.001" to answer **which specific behaviors** your detections actually catch. Auto-extracted from 8,200+ detection rules at index time.
105
-
106
- - **`analyze_procedure_coverage`** - Break down a technique into behavioral procedures (encoded commands, download cradles, AMSI bypass, etc.) and show which ones your detections cover vs. miss
107
- - **`compare_procedure_coverage`** - Cross-source matrix showing which source catches which procedures — reveals single-source gaps and redundancy
108
- - **`generate_navigator_layer`** - Export ATT&CK Navigator JSON layers, filterable by source/tactic/severity/actor, ready to import at [mitre-attack.github.io/attack-navigator](https://mitre-attack.github.io/attack-navigator/)
109
-
110
- ```
111
- "Are we actually covered for credential dumping?"
112
-
113
- T1003.001 — LSASS Memory
114
- Detections: 109 | Depth: moderate | Procedures: 45/59 (76%)
115
-
116
- ✓ LSASS Memory Access 40 detections [sigma, splunk_escu, elastic]
117
- ✓ Mimikatz Usage 10 detections [sigma, elastic]
118
- ✓ Comsvcs.dll MiniDump 6 detections [sigma, elastic, splunk_escu]
119
- ✓ ProcDump LSASS Dump 8 detections [sigma, splunk_escu, elastic]
120
- ✗ NanoDump / Custom Dumpers — single-source gap (sigma only)
121
- ```
122
-
123
- Procedures are **auto-extracted at index time** — when new detection sources are added, procedure coverage regenerates automatically. 16 high-priority techniques have hand-curated procedure data; the rest are auto-clustered from detection queries, descriptions, and process names.
124
-
125
- ### New Detection Sources
126
-
127
- - **CrowdStrike CQL Hub** - Query and search CrowdStrike Query Language (CQL) detections from the CQL Hub community repository
128
- - **Sublime Rules** - Query and search Sublime Security detection rules for email-based threats (now mapped to MITRE ATT&CK techniques)
129
-
130
- ## What's New in 3.1 - CQL Hub & Sublime Sources
131
-
132
- - Added CrowdStrike CQL Hub and Sublime Security as detection sources
133
- - Sublime rules now mapped to MITRE ATT&CK technique IDs via `attack_types` and `tactics_and_techniques`
134
- - Updated ATT&CK Navigator layer generation to v18.1 / Navigator v5.3.1
135
-
136
- ## What's New in 3.0 - Autonomous Detection Platform
137
-
138
- Version 3.0 transforms this MCP into a **fully autonomous detection engineering platform**. Feed it threat intelligence, and it automatically:
139
-
140
- 1. **Extracts TTPs** from threat reports, CISA alerts, or manual input
141
- 2. **Analyzes coverage gaps** against your existing detections
142
- 3. **Generates detections** in your SIEM's native format (SPL, KQL, EQL, or Sigma)
143
- 4. **Runs Atomic Red Team tests** against your lab environment
144
- 5. **Validates detections fire** by querying your SIEM
145
- 6. **Exports attack data** for reproducibility
146
- 7. **Stages DRAFT PRs** to your detection repo (never auto-merges)
147
-
148
- > **Multi-SIEM**: Set `SIEM_PLATFORM` to `splunk`, `sentinel`, `elastic`, or `sigma` in your `.env`. The pipeline was built on Splunk + Attack Range but adapts to any SIEM. See the **[E2E Testing Guide](./docs/E2E-TESTING-GUIDE.md)** for complete setup instructions per platform.
149
-
150
- ### Architecture: LangGraph + Cursor Subagents
151
-
152
- The 3.0 architecture uses two complementary systems:
153
-
154
- | Component | Purpose | Location |
155
- |-----------|---------|----------|
156
- | **LangGraph Pipeline** | Core autonomous workflow - portable, testable, CI/CD ready | `agents/` |
157
- | **Cursor Subagents** | Interactive IDE agents for manual tasks | `.cursor/agents/` |
158
-
159
- ### Quick Start - Autonomous Mode
160
-
161
- **Prerequisites**: Node.js 20+, an Anthropic API key. Full details in the [Setup Guide](./SETUP.md).
162
-
163
- ```bash
164
- # Install the agents package
165
- cd agents && npm install --registry https://registry.npmjs.org/
166
-
167
- # Configure
168
- cp .env.example .env
169
- # Edit .env: set SIEM_PLATFORM, ANTHROPIC_API_KEY, SECURITY_CONTENT_PATH
170
-
171
- # Test with dry run first (uses mock data, no LLM calls)
172
- DRY_RUN=true npm run orchestrate -- --type technique --input "T1566.004 Spearphishing Voice"
173
-
174
- # Run with real LLM (creates actual detections)
175
- npm run orchestrate -- --type technique --input "T1566.004 Spearphishing Voice"
176
-
177
- # Or analyze a CISA alert
178
- npm run orchestrate -- --type cisa_alert --url https://www.cisa.gov/news-events/alerts/...
179
-
180
- # Or feed it a threat report
181
- npm run orchestrate -- --type threat_report --file ./report.md
182
-
183
- # Note: Use T1566.004 for testing - it has no existing coverage so will create a detection
184
- # T1003.001 has 100+ existing detections, so the pipeline will correctly skip it (no gap)
185
- ```
186
-
187
- ### Pipeline Stages
188
-
189
- ```
190
- ┌─────────────┐ ┌──────────────────┐ ┌────────────────────┐
191
- │ CTI Analyst │───>│ Coverage Analyzer│───>│ Detection Engineer │
192
- └─────────────┘ └──────────────────┘ └────────────────────┘
193
-
194
-
195
- ┌───────────┐ ┌──────────────────┐ ┌──────────────────────┐
196
- │ PR Stager │<───│ Data Dumper │<───│ Splunk Validator │
197
- └───────────┘ └──────────────────┘ └──────────────────────┘
198
-
199
-
200
- ┌──────────────────┐
201
- │ Atomic Executor │
202
- └──────────────────┘
203
- ```
204
-
205
- ### MCP Integration
206
-
207
- The autonomous pipeline integrates with existing MCPs:
208
- - **security-detections** - Coverage analysis and gap identification
209
- - **splunk-mcp** - Detection validation (`run_detection`, `export_dump`)
210
- - **mitre-attack** - Technique lookups
211
-
212
- ### Human-in-the-Loop
213
-
214
- **CRITICAL**: The system NEVER auto-commits or auto-merges. All PRs are created as **DRAFT** requiring human review:
215
-
216
- ```
217
- [PR Stager] ✓ security_content DRAFT PR created: https://github.com/splunk/security_content/pull/123
218
- [PR Stager] ✓ attack_data DRAFT PR created: https://github.com/splunk/attack_data/pull/456
219
- ```
220
-
221
- See the [Autonomous Platform Documentation](./docs/AUTONOMOUS.md) for full details, and the [E2E Testing Guide](./docs/E2E-TESTING-GUIDE.md) for per-SIEM setup (Splunk, Sentinel, Elastic, Sigma).
222
-
223
- ## 🐛 Version 2.1.1 (Bug Fix)
224
-
225
- - **Fixed Windows EBUSY crash** - SQLite database recreation now handles Windows file locking with retry logic. Previously, Windows users would get `EBUSY: resource busy or locked` on startup.
226
- - **SQLite journal cleanup** - WAL, SHM, and journal companion files are now cleaned up during database recreation.
227
- - **Windows CI** - Added Windows to the CI matrix. Build, tests, and full Sigma indexing pipeline now run on both Linux and Windows.
228
- - **Cross-platform test suite** - New `tests/cross-platform-test.js` validates database lifecycle on all platforms. New `tests/ci-integration-test.js` downloads and indexes 3,200+ Sigma rules to validate the full pipeline.
229
-
230
- ## 🚀 Version 2.1 Features
231
-
232
- **Security Detections MCP v2.1** introduces powerful new capabilities for detection engineering intelligence, analytical memory, autonomous analysis, and advanced MCP protocol features:
233
-
234
- ### What's New in v2.1
235
- - **Elicitation Support** - Server can request user confirmation for destructive operations (when client supports it)
236
- - **Sampling Integration** - LLM-enhanced analysis via MCP sampling (when client supports it)
237
- - **Resource Subscriptions** - Subscribe to resource changes for live updates
238
- - **Enhanced Error Handling** - Safe JSON parsing and comprehensive error wrapping
239
- - **Dynamic Pattern Extraction** - Improved field/function extraction without hardcoded limitations
240
- - **71+ Tools** - Extended tool suite with 2 new sampling-related tools
241
-
242
- ### Detection Engineering Intelligence (8 Tools)
243
- - **Pattern Learning** - Automatically extracts and learns patterns from 4 detection formats (SPL, Sigma, KQL, Elastic)
244
- - **Template Generation** - Creates reusable detection templates from learned patterns
245
- - **Field & Macro References** - Tracks commonly used fields, macros, and functions across detections
246
- - **Feedback Learning** - Learns from user corrections and improvements to enhance future suggestions
247
-
248
- ### Knowledge Graph / Tribal Knowledge (12 Tools)
249
- - **Analytical Memory** - Persistent knowledge graph that remembers WHY decisions were made, not just WHAT was detected
250
- - **Entity Management** - Create and relate entities (threats, techniques, detections, data sources)
251
- - **Decision Logging** - Record analytical reasoning and decision-making context for future reference
252
- - **Learning Capture** - Store insights, patterns, and lessons learned that help future agents understand context
253
-
254
- ### Dynamic Tables (6 Tools)
255
- - **Custom Analysis Storage** - Create tables on-the-fly for storing analysis results, gap assessments, or custom data
256
- - **Flexible Schema** - Define your own table structure for any analysis workflow
257
- - **Query Interface** - Query stored analysis data with SQL-like operations
258
- - **Persistent Storage** - Tables persist across sessions for long-term analysis tracking
259
-
260
- ### Comprehensive Pattern Extraction
261
- - **Multi-Format Support** - Extracts patterns from Sigma, Splunk SPL, KQL, and Elastic queries
262
- - **10,235+ Indexed Patterns** - Comprehensive pattern library covering 528+ MITRE techniques
263
- - **Cross-Format Insights** - Learn how different platforms detect the same techniques
264
-
265
- ### Expanded Tool Suite
266
- - **71+ Total Tools** (vs ~40 in v1.0)
267
- - **Engineering Tools** (8) - Pattern learning, template generation, field analysis
268
- - **Knowledge Tools** (12) - Knowledge graph, entity relations, decision logging
269
- - **Dynamic Tools** (6) - Custom table creation and querying
270
- - **Autonomous Tools** (5) - Self-directed analysis, LLM-enhanced analysis, sampling status
271
- - **Meta/Template Tools** (5) - Query templates and workflow shortcuts
272
- - **Cache Tools** (4) - Index management, saved queries
273
-
274
- ## 🆕 MCP Prompts - Expert Detection Workflows
275
-
276
- This server includes **11 pre-built MCP Prompts** that provide structured, expert-level workflows for common security detection tasks. Instead of figuring out which tools to use and in what order, just ask for a prompt by name and get a comprehensive, professional analysis.
277
-
278
- ### How to Use Prompts in Cursor
279
-
280
- Simply ask Claude to use a prompt by name:
281
-
282
- ```
283
- You: "Use the ransomware-readiness-assessment prompt"
284
- You: "Run apt-threat-emulation for APT29"
285
- You: "Execute the executive-security-briefing prompt for our CISO"
286
- You: "Use detection-engineering-sprint with capacity 5 and focus on ransomware"
287
- ```
288
-
289
- ### Available Prompts
290
-
291
- | Prompt | Description | Arguments |
292
- |--------|-------------|-----------|
293
- | `ransomware-readiness-assessment` | Comprehensive kill-chain analysis with risk scoring and remediation roadmap | `priority_focus`: prevention/detection/response/all |
294
- | `apt-threat-emulation` | Assess coverage against specific threat actors (APT29, Lazarus, Volt Typhoon, etc.) | `threat_actor` (required), `include_test_plan` |
295
- | `purple-team-exercise` | Generate complete test plans with procedures and expected detections | `scope` (tactic or technique), `environment` |
296
- | `soc-investigation-assist` | Investigation helper with triage guidance, hunting queries, and escalation criteria | `indicator` (required), `context` |
297
- | `detection-engineering-sprint` | Prioritized detection backlog with user stories and acceptance criteria | `sprint_capacity`, `threat_focus` |
298
- | `executive-security-briefing` | C-level report with business risk language and investment recommendations | `audience`: board/ciso/cto, `include_benchmarks` |
299
- | `cve-response-assessment` | Rapid assessment for emerging CVEs and threats | `cve_or_threat` (required) |
300
- | `data-source-gap-analysis` | Analyze telemetry requirements for improved detection coverage | `target_coverage` |
301
- | `detection-quality-review` | Deep-dive quality analysis of detections for a specific technique | `technique_id` (required) |
302
- | `threat-landscape-sync` | Align detection priorities with current threat landscape | `industry` |
303
- | `detection-coverage-diff` | Compare coverage against threat actors or baseline | `compare_against` (required) |
304
-
305
- ### Example: Ransomware Assessment
306
-
307
- ```
308
- You: "Use the ransomware-readiness-assessment prompt"
309
-
310
- Claude will automatically:
311
- 1. Get baseline stats with get_stats
312
- 2. Analyze ransomware-specific gaps with identify_gaps
313
- 3. Review coverage by tactic with analyze_coverage
314
- 4. Map gaps to the ransomware kill chain
315
- 5. Generate prioritized remediation roadmap
316
- 6. Output a professional report with risk scores
317
- ```
318
-
319
- ### Example: APT Threat Assessment
320
-
321
- ```
322
- You: "Run apt-threat-emulation for Volt Typhoon"
323
-
324
- Claude will:
325
- 1. Research Volt Typhoon using MITRE ATT&CK data
326
- 2. Get all 81 techniques attributed to the group
327
- 3. Check your detection coverage for each technique
328
- 4. Calculate coverage percentage and identify blind spots
329
- 5. Generate a purple team test plan (optional)
330
- 6. Provide prioritized detection recommendations
331
- ```
332
-
333
95
  ## Features
334
96
 
335
- - **🆕 MCP Prompts** - 11 pre-built expert workflows for ransomware assessment, APT emulation, purple team exercises, executive briefings, and more
336
- - **🆕 MCP Resources** - Readable context for LLMs (stats, coverage summary, gaps) without tool calls
337
- - **🆕 Argument Completions** - Autocomplete for technique IDs, CVEs, process names as you type
338
- - **🆕 Server Instructions** - Built-in usage guide with examples for better LLM understanding
339
- - **🆕 Structured Errors** - Helpful error messages with suggestions and similar items
340
- - **🆕 Interactive Tools** - Gap prioritization and sprint planning with form-based input (Cursor 0.42+)
341
- - **Unified Search** - Query Sigma, Splunk ESCU, Elastic, KQL, Sublime, and CrowdStrike CQL detections from a single interface
342
- - **Full-Text Search** - SQLite FTS5 powered search across names, descriptions, queries, MITRE tactics, CVEs, process names, and more
343
- - **MITRE ATT&CK Mapping** - Filter detections by technique ID or tactic
344
- - **CVE Coverage** - Find detections for specific CVE vulnerabilities
345
- - **Process Name Search** - Find detections that reference specific processes (e.g., powershell.exe, w3wp.exe)
346
- - **Analytic Stories** - Query by Splunk analytic story (optional - enhances context)
347
- - **KQL Categories** - Filter KQL queries by category (Defender For Endpoint, Azure AD, Threat Hunting, etc.)
348
- - **Auto-Indexing** - Automatically indexes detections on startup from configured paths
349
- - **Multi-Format Support** - YAML (Sigma, Splunk, Sublime, CrowdStrike CQL), TOML (Elastic), Markdown (KQL)
350
- - **Logsource Filtering** - Filter Sigma rules by category, product, or service
351
- - **Severity Filtering** - Filter by criticality level
97
+ - **8,200+ detections** across 6 formats Sigma, Splunk ESCU, Elastic, KQL, Sublime, CrowdStrike CQL
98
+ - **MITRE ATT&CK STIX** 172 threat actors, 784 software, 4,362 actor-technique relationships
99
+ - **Procedure-level coverage** auto-extracted behavioral clusters from every detection rule
100
+ - **ATT&CK Navigator layers** export coverage/gap JSON, filterable by source/tactic/severity/actor
101
+ - **Autonomous pipeline** CTI ingestion gap analysis detection generation → Atomic testing → DRAFT PR (see [Autonomous docs](./docs/AUTONOMOUS.md))
102
+ - **81 local tools / ~25 hosted tools** unified search, MITRE mapping, coverage analysis, knowledge graph, pattern learning, sprint planning
103
+ - **11 MCP Prompts** ransomware assessment, APT emulation, purple team, executive briefing, and more
104
+ - **MCP Resources & Completions** readable context, autocomplete for technique IDs, CVEs, process names
352
105
 
353
106
  ## Quick Start
354
107
 
355
- ### Option 1: npx (Recommended)
356
-
357
- No installation required - just configure and run:
358
-
359
108
  ```bash
360
109
  npx -y security-detections-mcp
361
110
  ```
362
111
 
363
- ### Option 2: Clone and Build
364
-
365
- ```bash
366
- git clone https://github.com/MHaggis/Security-Detections-MCP.git
367
- cd Security-Detections-MCP
368
- npm install
369
- npm run build
370
- ```
112
+ Or clone and build: `git clone https://github.com/MHaggis/Security-Detections-MCP.git && cd Security-Detections-MCP && npm install && npm run build`
371
113
 
372
- ## Configuration
114
+ Configure env vars to point at your detection repos:
373
115
 
374
- ### Cursor IDE
116
+ | Variable | Description |
117
+ |----------|-------------|
118
+ | `SIGMA_PATHS` | Sigma rule directories |
119
+ | `SPLUNK_PATHS` | Splunk ESCU detection directories |
120
+ | `ELASTIC_PATHS` | Elastic detection rule directories |
121
+ | `KQL_PATHS` | KQL hunting query directories |
122
+ | `SUBLIME_PATHS` | Sublime Security rule directories |
123
+ | `CQL_HUB_PATHS` | CQL Hub (CrowdStrike) query directories |
124
+ | `STORY_PATHS` | Splunk analytic story directories (optional) |
125
+ | `ATTACK_STIX_PATH` | Path to `enterprise-attack.json` for threat actor data (optional) |
375
126
 
376
- Add to your MCP config (`~/.cursor/mcp.json` or `.cursor/mcp.json` in your project):
377
-
378
- ```json
379
- {
380
- "mcpServers": {
381
- "security-detections": {
382
- "command": "npx",
383
- "args": ["-y", "security-detections-mcp"],
384
- "env": {
385
- "SIGMA_PATHS": "/path/to/sigma/rules,/path/to/sigma/rules-threat-hunting",
386
- "SPLUNK_PATHS": "/path/to/security_content/detections",
387
- "ELASTIC_PATHS": "/path/to/detection-rules/rules",
388
- "STORY_PATHS": "/path/to/security_content/stories",
389
- "KQL_PATHS": "/path/to/Hunting-Queries-Detection-Rules",
390
- "SUBLIME_PATHS": "/path/to/sublime-rules/detection-rules",
391
- "CQL_HUB_PATHS": "/path/to/cql-hub/queries"
392
- }
393
- }
394
- }
395
- }
396
- ```
397
-
398
- ### Claude Desktop
399
-
400
- Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
401
-
402
- ```json
403
- {
404
- "mcpServers": {
405
- "security-detections": {
406
- "command": "npx",
407
- "args": ["-y", "security-detections-mcp"],
408
- "env": {
409
- "SIGMA_PATHS": "/Users/you/sigma/rules,/Users/you/sigma/rules-threat-hunting",
410
- "SPLUNK_PATHS": "/Users/you/security_content/detections",
411
- "ELASTIC_PATHS": "/Users/you/detection-rules/rules",
412
- "STORY_PATHS": "/Users/you/security_content/stories",
413
- "KQL_PATHS": "/Users/you/Hunting-Queries-Detection-Rules",
414
- "SUBLIME_PATHS": "/Users/you/sublime-rules/detection-rules",
415
- "CQL_HUB_PATHS": "/Users/you/cql-hub/queries"
416
- }
417
- }
418
- }
419
- }
420
- ```
421
- ### Visual Studio Code
422
-
423
- Add to `~/.vscode/mcp.json`:
424
-
425
- ```json
426
- {
427
- "servers": {
428
- "security-detections": {
429
- "type": "stdio",
430
- "command": "npx",
431
- "args": ["-y", "security-detections-mcp"],
432
- "env": {
433
- "SIGMA_PATHS": "/Users/you/sigma/rules,/Users/you/sigma/rules-threat-hunting",
434
- "SPLUNK_PATHS": "/Users/you/security_content/detections",
435
- "ELASTIC_PATHS": "/Users/you/detection-rules/rules",
436
- "KQL_PATHS": "/Users/you/kql-bertjanp,/Users/you/kql-jkerai1",
437
- "STORY_PATHS": "/Users/you/security_content/stories",
438
- "SUBLIME_PATHS": "/Users/you/sublime-rules/detection-rules",
439
- "CQL_HUB_PATHS": "/Users/you/cql-hub/queries"
440
- }
441
- }
442
- }
443
- ```
444
-
445
- ### WSL & Visual Studio Code
446
-
447
- Add to `~/.vscode/mcp.json`:
448
-
449
- ```json
450
- {
451
- "servers": {
452
- "security-detections": {
453
- "type": "stdio",
454
- "command": "wsl",
455
- "args": ["npx", "-y", "security-detections-mcp"],
456
- "env": {
457
- "SIGMA_PATHS": "/Users/you/sigma/rules,/Users/you/sigma/rules-threat-hunting",
458
- "SPLUNK_PATHS": "/Users/you/security_content/detections",
459
- "ELASTIC_PATHS": "/Users/you/detection-rules/rules",
460
- "KQL_PATHS": "/Users/you/kql-bertjanp,/Users/you/kql-jkerai1",
461
- "STORY_PATHS": "/Users/you/security_content/stories",
462
- "SUBLIME_PATHS": "/Users/you/sublime-rules/detection-rules",
463
- "CQL_HUB_PATHS": "/Users/you/cql-hub/queries"
464
- }
465
- }
466
- }
467
- ```
468
-
469
- ### Environment Variables
470
-
471
- | Variable | Description | Required |
472
- |----------|-------------|----------|
473
- | `SIGMA_PATHS` | Comma-separated paths to Sigma rule directories | At least one source required |
474
- | `SPLUNK_PATHS` | Comma-separated paths to Splunk ESCU detection directories | At least one source required |
475
- | `ELASTIC_PATHS` | Comma-separated paths to Elastic detection rule directories | At least one source required |
476
- | `KQL_PATHS` | Comma-separated paths to KQL hunting query directories | At least one source required |
477
- | `SUBLIME_PATHS` | Comma-separated paths to Sublime Security rule directories | At least one source required |
478
- | `CQL_HUB_PATHS` | Comma-separated paths to CQL Hub (CrowdStrike) query directories | At least one source required |
479
- | `STORY_PATHS` | Comma-separated paths to Splunk analytic story directories | No (enhances context) |
127
+ See the [Setup Guide](./SETUP.md) for full per-client config examples (Cursor, VS Code, Claude Desktop, WSL).
480
128
 
481
129
  ## Getting Detection Content
482
130
 
483
- ### Quick Start: Download All Rules (Copy & Paste)
484
-
485
- Create a `detections` folder and download all sources with sparse checkout (only downloads the rules, not full repos):
131
+ Download all sources with sparse checkout (rules only, not full repos):
486
132
 
487
133
  ```bash
488
- # Create detections directory
489
134
  mkdir -p detections && cd detections
490
-
491
- # Download Sigma rules (~3,000+ rules)
492
- git clone --depth 1 --filter=blob:none --sparse https://github.com/SigmaHQ/sigma.git
493
- cd sigma && git sparse-checkout set rules rules-threat-hunting && cd ..
494
-
495
- # Download Splunk ESCU detections + stories (~2,000+ detections, ~330 stories)
496
- git clone --depth 1 --filter=blob:none --sparse https://github.com/splunk/security_content.git
497
- cd security_content && git sparse-checkout set detections stories && cd ..
498
-
499
- # Download Elastic detection rules (~1,500+ rules)
500
- git clone --depth 1 --filter=blob:none --sparse https://github.com/elastic/detection-rules.git
501
- cd detection-rules && git sparse-checkout set rules && cd ..
502
-
503
- # Download KQL hunting queries (~400+ queries from 2 repos)
135
+ 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 ..
136
+ 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 ..
137
+ git clone --depth 1 --filter=blob:none --sparse https://github.com/elastic/detection-rules.git && cd detection-rules && git sparse-checkout set rules && cd ..
504
138
  git clone --depth 1 https://github.com/Bert-JanP/Hunting-Queries-Detection-Rules.git kql-bertjanp
505
139
  git clone --depth 1 https://github.com/jkerai1/KQL-Queries.git kql-jkerai1
506
-
507
- # Download Sublime Security email detection rules (~900+ rules)
508
- git clone --depth 1 --filter=blob:none --sparse https://github.com/sublime-security/sublime-rules.git
509
- cd sublime-rules && git sparse-checkout set detection-rules && cd ..
510
-
511
- # Download CQL Hub CrowdStrike queries (~139+ queries)
140
+ git clone --depth 1 --filter=blob:none --sparse https://github.com/sublime-security/sublime-rules.git && cd sublime-rules && git sparse-checkout set detection-rules && cd ..
512
141
  git clone --depth 1 https://github.com/ByteRay-Labs/Query-Hub.git cql-hub
513
-
514
- echo "Done! Configure your MCP with these paths:"
515
- echo " SIGMA_PATHS: $(pwd)/sigma/rules,$(pwd)/sigma/rules-threat-hunting"
516
- echo " SPLUNK_PATHS: $(pwd)/security_content/detections"
517
- echo " ELASTIC_PATHS: $(pwd)/detection-rules/rules"
518
- echo " KQL_PATHS: $(pwd)/kql-bertjanp,$(pwd)/kql-jkerai1"
519
- echo " SUBLIME_PATHS: $(pwd)/sublime-rules/detection-rules"
520
- echo " CQL_HUB_PATHS: $(pwd)/cql-hub/queries"
521
- echo " STORY_PATHS: $(pwd)/security_content/stories"
522
- ```
523
-
524
- ### Alternative: Full Clone
525
-
526
- If you prefer full git history:
527
-
528
- ```bash
529
- # Sigma Rules
530
- git clone https://github.com/SigmaHQ/sigma.git
531
- # Use rules/ and rules-threat-hunting/ directories
532
-
533
- # Splunk ESCU
534
- git clone https://github.com/splunk/security_content.git
535
- # Use detections/ and stories/ directories
536
-
537
- # Elastic Detection Rules
538
- git clone https://github.com/elastic/detection-rules.git
539
- # Use rules/ directory
540
-
541
- # KQL Hunting Queries (multiple sources supported)
542
- git clone https://github.com/Bert-JanP/Hunting-Queries-Detection-Rules.git
543
- git clone https://github.com/jkerai1/KQL-Queries.git
544
- # Use entire repos, combine paths with comma
545
-
546
- # Sublime Security Rules
547
- git clone https://github.com/sublime-security/sublime-rules.git
548
- # Use detection-rules/ directory
549
-
550
- # CQL Hub (CrowdStrike Query Language)
551
- git clone https://github.com/ByteRay-Labs/Query-Hub.git
552
- # Use queries/ directory
553
- ```
554
-
555
- ## 🆕 MCP Resources - Readable Context
556
-
557
- MCP Resources let LLMs read context directly without tool calls. Perfect for understanding the current state before making decisions.
558
-
559
- ### Available Resources
560
-
561
- | Resource URI | Description |
562
- |-------------|-------------|
563
- | `detection://stats` | Current inventory statistics |
564
- | `detection://coverage-summary` | Tactic-by-tactic coverage percentages |
565
- | `detection://gaps/ransomware` | Current ransomware detection gaps |
566
- | `detection://gaps/apt` | Current APT detection gaps |
567
- | `detection://top-techniques` | Top 20 techniques with most coverage |
568
-
569
- Resources are automatically available in Cursor's context when needed.
570
-
571
- ## 🆕 Argument Completions
572
-
573
- The server provides **autocomplete suggestions** as you type argument values:
574
-
575
- | Argument | Completions From |
576
- |----------|-----------------|
577
- | `technique_id` | Your indexed MITRE technique IDs (T1059.001, etc.) |
578
- | `cve_id` | Your indexed CVE IDs (CVE-2024-27198, etc.) |
579
- | `process_name` | Process names in your detections (powershell.exe, etc.) |
580
- | `tactic` | All 14 MITRE tactics |
581
- | `severity` | informational, low, medium, high, critical |
582
- | `source_type` | sigma, splunk_escu, elastic, kql, sublime, crowdstrike_cql |
583
- | `threat_profile` | ransomware, apt, initial-access, persistence, etc. |
584
-
585
- This prevents typos and helps discover what values are available in your detection corpus.
586
-
587
- ## 🆕 Structured Errors & Suggestions
588
-
589
- When errors occur or no results are found, the server returns **helpful JSON responses** instead of plain strings:
590
-
591
- ```json
592
- // Missing required argument
593
- {
594
- "error": true,
595
- "code": "MISSING_REQUIRED_ARG",
596
- "message": "technique_id is required",
597
- "examples": ["T1059.001", "T1547.001", "T1003.001"],
598
- "hint": "Use format T####.### (e.g., T1059.001 for PowerShell)"
599
- }
600
-
601
- // No results found
602
- {
603
- "results": [],
604
- "technique_id": "T1234.999",
605
- "suggestions": {
606
- "message": "No detections found for this technique",
607
- "similar_techniques": ["T1234.001", "T1234.002"],
608
- "try_search": "search(\"T1234\") for broader results",
609
- "tip": "Parent techniques (T1234) may catch sub-techniques"
610
- }
611
- }
612
- ```
613
-
614
- This helps LLMs self-correct and suggest alternatives without getting stuck.
615
-
616
- ## 🆕 Interactive Tools (Cursor 0.42+)
617
-
618
- These tools use **MCP Elicitation** to present forms for interactive configuration:
619
-
620
- | Tool | Description |
621
- |------|-------------|
622
- | `prioritize_gaps` | Analyze gaps and get prioritized recommendations |
623
- | `plan_detection_sprint` | Interactive sprint configuration with capacity/focus/data source options |
624
-
625
- Example:
626
- ```
627
- You: "Help me prioritize which ransomware gaps to fix first"
628
- Tool: prioritize_gaps(threat_profile="ransomware")
629
- → Returns P0/P1/P2 prioritized gaps with selection guidance
630
142
  ```
631
143
 
632
144
  ## MCP Tools
@@ -635,607 +147,86 @@ Tool: prioritize_gaps(threat_profile="ransomware")
635
147
 
636
148
  | Tool | Description |
637
149
  |------|-------------|
638
- | `search(query, limit)` | Full-text search across all detection fields (names, descriptions, queries, CVEs, process names, etc.) |
639
- | `get_by_id(id)` | Get a single detection by its ID |
150
+ | `search(query, limit)` | Full-text search across all detection fields |
151
+ | `get_by_id(id)` | Get a single detection by ID |
640
152
  | `list_all(limit, offset)` | Paginated list of all detections |
641
- | `list_by_source(source_type)` | Filter by `sigma`, `splunk_escu`, `elastic`, `kql`, `sublime`, or `crowdstrike_cql` |
642
- | `get_raw_yaml(id)` | Get the original YAML/TOML/Markdown content |
643
- | `get_stats()` | Get index statistics |
153
+ | `list_by_source(source_type)` | Filter by source (`sigma`, `splunk_escu`, `elastic`, `kql`, `sublime`, `crowdstrike_cql`) |
154
+ | `get_stats()` | Index statistics |
644
155
  | `rebuild_index()` | Force re-index from configured paths |
645
156
 
646
- ### MITRE ATT&CK Filters
647
-
648
- | Tool | Description |
649
- |------|-------------|
650
- | `list_by_mitre(technique_id)` | Filter by MITRE ATT&CK technique ID (e.g., T1059.001) |
651
- | `list_by_mitre_tactic(tactic)` | Filter by tactic (execution, persistence, credential-access, etc.) |
652
-
653
- ### Vulnerability & Process Filters
654
-
655
- | Tool | Description |
656
- |------|-------------|
657
- | `list_by_cve(cve_id)` | Find detections for a specific CVE (e.g., CVE-2024-27198) |
658
- | `list_by_process_name(process_name)` | Find detections referencing a process (e.g., powershell.exe, w3wp.exe) |
659
- | `list_by_data_source(data_source)` | Filter by data source (e.g., Sysmon, Windows Security) |
660
-
661
- ### Classification Filters
662
-
663
- | Tool | Description |
664
- |------|-------------|
665
- | `list_by_logsource(category, product, service)` | Filter Sigma rules by logsource |
666
- | `list_by_severity(level)` | Filter by severity (informational/low/medium/high/critical) |
667
- | `list_by_detection_type(type)` | Filter by type (TTP, Anomaly, Hunting, Correlation) |
668
- | `list_by_analytic_story(story)` | Filter by Splunk analytic story |
669
-
670
- ### KQL-Specific Filters
671
-
672
- | Tool | Description |
673
- |------|-------------|
674
- | `list_by_kql_category(category)` | Filter KQL by category (e.g., "Defender For Endpoint", "Azure Active Directory", "Threat Hunting") |
675
- | `list_by_kql_tag(tag)` | Filter KQL by tag (e.g., "ransomware", "hunting", "ti-feed", "dfir") |
676
- | `list_by_kql_datasource(data_source)` | Filter KQL by Microsoft data source (e.g., "DeviceProcessEvents", "SigninLogs") |
677
-
678
- ### Story Tools (Optional)
679
-
680
- | Tool | Description |
681
- |------|-------------|
682
- | `search_stories(query, limit)` | Search analytic stories by narrative and description |
683
- | `get_story(name)` | Get detailed story information |
684
- | `list_stories(limit, offset)` | List all analytic stories |
685
- | `list_stories_by_category(category)` | Filter stories by category (Malware, Adversary Tactics, etc.) |
686
-
687
- ### Efficient Analysis Tools (Token-Optimized)
688
-
689
- These tools do heavy processing server-side and return minimal, actionable data:
690
-
691
- | Tool | Description | Output Size |
692
- |------|-------------|-------------|
693
- | `analyze_coverage(source_type?)` | Get coverage stats by tactic, top techniques, weak spots | ~2KB |
694
- | `identify_gaps(threat_profile, source_type?)` | Find gaps for ransomware, apt, persistence, etc. | ~500B |
695
- | `suggest_detections(technique_id, source_type?)` | Get detection ideas for a technique | ~2KB |
696
- | `get_technique_ids(source_type?, tactic?, severity?)` | Get only technique IDs (no full objects) | ~200B |
697
- | `get_coverage_summary(source_type?)` | Just tactic percentages (~200 bytes) | ~200B |
698
- | `get_top_gaps(threat_profile)` | Just top 5 gap technique IDs (~300 bytes) | ~300B |
699
- | `get_technique_count(technique_id)` | Just the count for one technique (~50 bytes) | ~50B |
700
-
701
- **Why use these?** Traditional tools return full detection objects (~50KB+ per query). These return only what you need, saving 25x+ tokens.
702
-
703
- ### Interactive Tools
704
-
705
- | Tool | Description |
706
- |------|-------------|
707
- | `prioritize_gaps(threat_profile, source_type?)` | Analyze gaps with P0/P1/P2 prioritization and selection guidance |
708
- | `plan_detection_sprint()` | Generate sprint configuration options with recommended backlog |
709
-
710
- ### Engineering Tools (8)
711
-
712
- Detection engineering intelligence tools for pattern learning and template generation:
713
-
714
- | Tool | Description |
715
- |------|-------------|
716
- | `extract_patterns(technique_id, source_type?)` | Extract detection patterns for a technique from all sources |
717
- | `learn_pattern(technique_id, pattern, format)` | Teach the system a new pattern for a technique |
718
- | `get_patterns(technique_id, format?)` | Retrieve learned patterns for a technique |
719
- | `generate_template(technique_id, format, data_source)` | Generate detection template from learned patterns |
720
- | `analyze_fields(technique_id)` | Analyze commonly used fields/macros for a technique |
721
- | `get_field_references(field_name)` | Find all detections using a specific field or macro |
722
- | `suggest_improvements(detection_id)` | Get AI suggestions for improving a detection based on patterns |
723
- | `compare_patterns(technique_id)` | Compare patterns across different detection formats |
724
-
725
- ### Knowledge Tools (12)
726
-
727
- Knowledge graph and tribal knowledge tools for analytical memory:
728
-
729
- | Tool | Description |
730
- |------|-------------|
731
- | `create_entity(name, type, properties)` | Create an entity in the knowledge graph (threat, technique, detection, etc.) |
732
- | `create_relation(source_entity, relation_type, target_entity, reasoning)` | Create a relationship between entities with reasoning |
733
- | `search_knowledge(query, entity_type?)` | Search the knowledge graph for entities and relations |
734
- | `get_entity(name)` | Get full details of an entity including all relations |
735
- | `log_decision(context, decision, reasoning, tags)` | Log an analytical decision with full context for future reference |
736
- | `get_relevant_decisions(context, tags?)` | Retrieve relevant past decisions for current context |
737
- | `add_learning(insight, category, tags)` | Store a learning or insight for future agents |
738
- | `get_learnings(category?, tags?)` | Retrieve stored learnings by category or tags |
739
- | `link_detection_to_entity(detection_id, entity_name, relation_type)` | Link a detection to a knowledge graph entity |
740
- | `get_entity_detections(entity_name)` | Get all detections related to an entity |
741
- | `update_entity(name, properties)` | Update entity properties in the knowledge graph |
742
- | `delete_entity(name)` | Remove an entity from the knowledge graph |
743
-
744
- ### Dynamic Tools (6)
745
-
746
- Custom table creation and querying for flexible analysis storage:
747
-
748
- | Tool | Description |
749
- |------|-------------|
750
- | `create_table(table_name, schema)` | Create a custom table with defined schema for analysis storage |
751
- | `insert_row(table_name, row_data)` | Insert a row of data into a custom table |
752
- | `query_table(table_name, query, limit?)` | Query a custom table with SQL-like syntax |
753
- | `list_tables()` | List all custom tables you've created |
754
- | `get_table_schema(table_name)` | Get the schema of a custom table |
755
- | `delete_table(table_name)` | Delete a custom table |
756
-
757
- ### Autonomous Tools (5)
758
-
759
- Self-directed analysis tools that work independently:
157
+ ### MITRE ATT&CK & Filtering
760
158
 
761
159
  | Tool | Description |
762
160
  |------|-------------|
763
- | `auto_analyze_coverage(threat_profiles?, store_results?)` | Comprehensive coverage analysis across threat profiles |
764
- | `auto_gap_report(report_name?, compare_sources?)` | Generate executive-level gap reports with prioritized recommendations |
765
- | `auto_compare_sources(techniques?, focus_tactic?)` | Compare detection coverage across all sources with reasoning |
766
- | `llm_enhanced_analysis(analysis_type, threat_profile?)` | LLM-enhanced analysis via MCP sampling (when supported) |
767
- | `check_sampling_status()` | Check if MCP sampling is available for LLM-enhanced analysis |
161
+ | `list_by_mitre(technique_id)` | Filter by technique ID (e.g., T1059.001) |
162
+ | `list_by_mitre_tactic(tactic)` | Filter by tactic (execution, persistence, etc.) |
163
+ | `list_by_cve(cve_id)` | Find detections for a CVE |
164
+ | `list_by_process_name(process_name)` | Find detections referencing a process |
165
+ | `list_by_severity(level)` | Filter by severity level |
166
+ | `list_by_data_source(data_source)` | Filter by data source |
768
167
 
769
- ### Meta/Template Tools (5)
770
-
771
- Query templates and workflow shortcuts:
168
+ ### Coverage & Analysis (Token-Optimized)
772
169
 
773
170
  | Tool | Description |
774
171
  |------|-------------|
775
- | `save_template(name, tool_calls, description)` | Save a sequence of tool calls as a reusable template |
776
- | `run_template(template_name, variables?)` | Execute a saved template with optional variable substitution |
777
- | `list_templates()` | List all saved templates |
778
- | `get_template(template_name)` | Get details of a saved template |
779
- | `delete_template(template_name)` | Delete a saved template |
780
-
781
- ## MCP Prompts - Detailed Reference
782
-
783
- MCP Prompts are pre-built, expert-level workflows that guide Claude through complex analysis tasks. They ensure consistent, comprehensive results by defining exactly which tools to use and in what order.
784
-
785
- ### Why Use Prompts Instead of Ad-Hoc Questions?
786
-
787
- | Ad-Hoc Question | With MCP Prompt |
788
- |-----------------|-----------------|
789
- | "Check my ransomware coverage" | "Use ransomware-readiness-assessment" |
790
- | Claude might check 2-3 things | Claude executes 15+ step workflow |
791
- | Inconsistent output format | Professional report with risk scores |
792
- | May miss important aspects | Comprehensive kill-chain analysis |
793
- | Varies each time | Repeatable, auditable results |
794
-
795
- ### Prompt Categories
796
-
797
- #### 🎯 Threat Assessment Prompts
798
-
799
- **`ransomware-readiness-assessment`**
800
- - Full ransomware kill-chain analysis
801
- - Risk scoring per attack phase
802
- - Prioritized remediation roadmap
803
- - Executive-ready reporting
804
-
805
- ```
806
- Use ransomware-readiness-assessment with priority_focus "detection"
807
- ```
808
-
809
- **`apt-threat-emulation`**
810
- - Coverage analysis against specific threat actors
811
- - Technique-by-technique gap identification
812
- - Optional purple team test plan generation
813
- - Supports all MITRE ATT&CK groups (APT29, Lazarus, Volt Typhoon, Scattered Spider, etc.)
814
-
815
- ```
816
- Run apt-threat-emulation for "Scattered Spider" with include_test_plan true
817
- ```
818
-
819
- **`threat-landscape-sync`**
820
- - Align detections with current threats
821
- - Industry-specific threat prioritization
822
- - Top actor coverage analysis
823
- - Strategic roadmap generation
824
-
825
- ```
826
- Use threat-landscape-sync for the finance industry
827
- ```
828
-
829
- #### 🔬 Purple Team & Validation Prompts
830
-
831
- **`purple-team-exercise`**
832
- - Complete exercise planning for a tactic or technique
833
- - Test case development with procedures
834
- - Expected detection mapping
835
- - Safety controls and rollback plans
836
-
837
- ```
838
- Run purple-team-exercise for "persistence" in a "windows" environment
839
- ```
840
-
841
- **`detection-quality-review`**
842
- - Deep-dive analysis of detection effectiveness
843
- - Bypass and evasion analysis
844
- - Quality scoring and improvement recommendations
845
- - Enhanced detection logic suggestions
846
-
847
- ```
848
- Use detection-quality-review for T1059.001
849
- ```
850
-
851
- #### 📊 Planning & Reporting Prompts
852
-
853
- **`detection-engineering-sprint`**
854
- - Threat-informed backlog prioritization
855
- - User stories with acceptance criteria
856
- - Effort estimation and capacity planning
857
- - Focus areas: ransomware, apt, insider, cloud, balanced
172
+ | `analyze_coverage(source_type?)` | Coverage stats by tactic, top techniques, weak spots (~2KB) |
173
+ | `identify_gaps(threat_profile)` | Find gaps for ransomware, apt, persistence, etc. (~500B) |
174
+ | `suggest_detections(technique_id)` | Detection ideas for a technique (~2KB) |
175
+ | `get_coverage_summary(source_type?)` | Tactic percentages (~200B) |
176
+ | `analyze_actor_coverage(actor)` | Coverage against a specific threat actor |
177
+ | `compare_actor_coverage(actors)` | Compare coverage across multiple actors |
178
+ | `analyze_procedure_coverage(technique_id)` | Behavioral procedure breakdown |
179
+ | `generate_navigator_layer(...)` | Export ATT&CK Navigator JSON layers |
180
+
181
+ ### Engineering, Knowledge Graph & More
182
+
183
+ 81 tools total including pattern learning, template generation, knowledge graph, dynamic tables, and autonomous analysis. See the [Tools Reference](docs/wiki/Tools-Reference.md) for the complete list.
184
+
185
+ ## MCP Prompts
186
+
187
+ 11 pre-built expert workflows. Just ask by name:
188
+
189
+ | Prompt | Description |
190
+ |--------|-------------|
191
+ | `ransomware-readiness-assessment` | Full kill-chain analysis with risk scoring |
192
+ | `apt-threat-emulation` | Coverage against specific threat actors (APT29, Lazarus, etc.) |
193
+ | `purple-team-exercise` | Complete test plans with procedures and expected detections |
194
+ | `soc-investigation-assist` | Triage guidance, hunting queries, escalation criteria |
195
+ | `detection-engineering-sprint` | Prioritized backlog with user stories |
196
+ | `executive-security-briefing` | C-level report with business risk language |
197
+ | `cve-response-assessment` | Rapid assessment for emerging CVEs |
198
+ | `data-source-gap-analysis` | Telemetry requirements analysis |
199
+ | `detection-quality-review` | Deep-dive quality analysis for a technique |
200
+ | `threat-landscape-sync` | Align priorities with current threats |
201
+ | `detection-coverage-diff` | Compare coverage against actors or baseline |
858
202
 
859
203
  ```
860
- Run detection-engineering-sprint with sprint_capacity 5 and threat_focus "apt"
861
- ```
862
-
863
- **`executive-security-briefing`**
864
- - Business-risk translation
865
- - Coverage metrics and trends
866
- - Investment recommendations with ROI
867
- - Audience-specific formatting (board, CISO, CTO)
868
-
869
- ```
870
- Use executive-security-briefing for audience "board" with include_benchmarks true
871
- ```
872
-
873
- #### 🚨 Incident Response Prompts
874
-
875
- **`soc-investigation-assist`**
876
- - Alert triage guidance
877
- - MITRE ATT&CK context
878
- - Related detections and hunting queries
879
- - Escalation decision trees
880
-
881
- ```
882
- Use soc-investigation-assist for "suspicious PowerShell execution" with context "domain controller, after hours"
883
- ```
884
-
885
- **`cve-response-assessment`**
886
- - Rapid threat assessment
887
- - Existing coverage check
888
- - Immediate action recommendations
889
- - Hunting query generation
890
-
891
- ```
892
- Run cve-response-assessment for CVE-2024-27198
893
- ```
894
-
895
- #### 🔧 Gap Analysis Prompts
896
-
897
- **`data-source-gap-analysis`**
898
- - Telemetry requirements analysis
899
- - Data source prioritization by ROI
900
- - Implementation roadmap
901
- - Cost-benefit analysis
902
-
903
- ```
904
- Use data-source-gap-analysis for target_coverage "credential-access"
905
- ```
906
-
907
- **`detection-coverage-diff`**
908
- - Compare against threat actors or baselines
909
- - Progress tracking
910
- - Path-to-parity planning
911
- - Effort estimation
912
-
913
- ```
914
- Run detection-coverage-diff comparing against "APT29"
915
- ```
916
-
917
- ### Best With: MITRE ATT&CK MCP
918
-
919
- These prompts work even better when paired with [mitre-attack-mcp](https://github.com/MHaggis/mitre-attack-mcp). The prompts will automatically leverage MITRE ATT&CK tools for:
920
- - Threat actor technique lookups
921
- - Technique details and detection guidance
922
- - Mitigation recommendations
923
-
924
- ## Claude Code Skills
925
-
926
- This repo includes [Claude Code Skills](https://code.claude.com/docs/en/skills) in `.claude/skills/` that teach Claude efficient workflows:
927
-
928
- | Skill | Purpose |
929
- |-------|---------|
930
- | `coverage-analysis` | Efficient coverage analysis using the token-optimized tools |
931
-
932
- **Why skills?** Instead of figuring out methodology each time (wasting tokens), skills teach Claude once.
933
-
934
- You can also install personal skills to `~/.claude/skills/` for cross-project use.
935
-
936
- ### Example: Efficient Coverage Analysis
937
-
938
- ```
939
- You: "What's my Elastic coverage against ransomware?"
940
-
941
- AI uses skills + efficient tools:
942
- 1. analyze_coverage(source_type="elastic") → Stats by tactic
943
- 2. identify_gaps(threat_profile="ransomware") → Prioritized gaps
944
- 3. suggest_detections(technique_id="T1486") → Fix top gap
945
-
946
- Total: ~5KB of data vs ~500KB with traditional tools
947
- ```
948
-
949
- ## Example Workflows
950
-
951
- ### Using MCP Prompts (Recommended for Complex Tasks)
952
-
953
- ```
954
- # Comprehensive ransomware assessment
955
- You: "Use the ransomware-readiness-assessment prompt"
956
- → Full kill-chain analysis with risk scoring and remediation roadmap
957
-
958
- # Assess coverage against a specific APT
959
- You: "Run apt-threat-emulation for Volt Typhoon"
960
- → Technique-by-technique coverage analysis with test plan
961
-
962
- # Generate a sprint backlog
963
- You: "Use detection-engineering-sprint with capacity 5 focusing on apt threats"
964
- → Prioritized user stories with acceptance criteria
965
-
966
- # Executive reporting
967
- You: "Run executive-security-briefing for the board"
968
- → Business-risk language with investment recommendations
969
- ```
970
-
971
- ### Using Tools Directly (Quick Queries)
972
-
973
- #### Find PowerShell Detections
974
-
975
- ```
976
- LLM: "Find me PowerShell detections related to base64 encoding"
977
- Tool: search(query="powershell base64", limit=5)
978
- ```
979
-
980
- #### Check CVE Coverage
981
-
982
- ```
983
- LLM: "Do we have detections for CVE-2024-27198?"
984
- Tool: list_by_cve(cve_id="CVE-2024-27198")
985
- ```
986
-
987
- #### Compare Coverage Across Sources
988
-
989
- ```
990
- LLM: "What detections do we have for credential dumping?"
991
- Tool: search(query="credential dumping", limit=10)
992
- → Returns results from Sigma, Splunk, Elastic, KQL, Sublime, AND CrowdStrike CQL
993
- ```
994
-
995
- #### Find Web Server Attack Detections
996
-
997
- ```
998
- LLM: "What detections cover IIS web server attacks?"
999
- Tool: list_by_process_name(process_name="w3wp.exe")
1000
- ```
1001
-
1002
- #### Explore a Threat Campaign
1003
-
1004
- ```
1005
- LLM: "Tell me about ransomware detections"
1006
- Tool: search_stories(query="ransomware")
1007
- Tool: list_by_analytic_story(story="Ransomware")
1008
- ```
1009
-
1010
- #### Find KQL Hunting Queries for Defender
1011
-
1012
- ```
1013
- LLM: "What KQL queries do we have for Defender For Endpoint?"
1014
- Tool: list_by_kql_category(category="Defender For Endpoint")
1015
- ```
1016
-
1017
- #### Find BEC/Phishing Email Detections
1018
-
1019
- ```
1020
- LLM: "What email detections do we have for BEC fraud?"
1021
- Tool: list_by_source(source_type="sublime")
1022
- → Returns Sublime Security email detection rules for BEC, phishing, malware, etc.
1023
- ```
1024
-
1025
- #### Find CrowdStrike CQL Hunting Queries
1026
-
1027
- ```
1028
- LLM: "What CrowdStrike queries do we have for lateral movement?"
1029
- Tool: list_by_source(source_type="crowdstrike_cql")
1030
- → Returns CQL Hub queries for CrowdStrike NextGen SIEM and Falcon LogScale
1031
- ```
1032
-
1033
- #### Search for BloodHound Detections
1034
-
1035
- ```
1036
- LLM: "Find detections for BloodHound usage"
1037
- Tool: search(query="bloodhound", limit=10)
1038
- → Returns KQL hunting queries and other source detections
204
+ You: "Run apt-threat-emulation for APT29"
205
+ → Technique-by-technique coverage, gaps, and purple team test plan
1039
206
  ```
1040
207
 
1041
- ## Unified Schema
1042
-
1043
- All detection sources (Sigma, Splunk, Elastic, KQL, Sublime, CrowdStrike CQL) are normalized to a common schema:
1044
-
1045
- ### Core Fields
1046
-
1047
- | Field | Description |
1048
- |-------|-------------|
1049
- | `id` | Unique identifier |
1050
- | `name` | Detection name/title |
1051
- | `description` | What the detection looks for |
1052
- | `query` | Detection logic (Sigma YAML, Splunk SPL, Elastic EQL, KQL, Sublime MQL, or CrowdStrike CQL) |
1053
- | `source_type` | `sigma`, `splunk_escu`, `elastic`, `kql`, `sublime`, or `crowdstrike_cql` |
1054
- | `severity` | Detection severity level |
1055
- | `status` | Rule status (stable, test, experimental, production, etc.) |
1056
- | `author` | Rule author |
1057
- | `file_path` | Original file path |
1058
- | `raw_yaml` | Original YAML/TOML/Markdown content |
1059
-
1060
- ### Enhanced Fields (for Semantic Search)
1061
-
1062
- | Field | Description |
1063
- |-------|-------------|
1064
- | `mitre_ids` | Mapped MITRE ATT&CK technique IDs |
1065
- | `mitre_tactics` | Extracted MITRE tactics (execution, persistence, etc.) |
1066
- | `cves` | CVE identifiers (e.g., CVE-2024-27198) |
1067
- | `analytic_stories` | Splunk analytic story names |
1068
- | `process_names` | Process names referenced in detection |
1069
- | `file_paths` | Interesting file paths referenced |
1070
- | `registry_paths` | Registry paths referenced |
1071
- | `data_sources` | Required data sources (Sysmon, DeviceProcessEvents, etc.) |
1072
- | `detection_type` | TTP, Anomaly, Hunting, or Correlation |
1073
- | `asset_type` | Endpoint, Web Server, Cloud, Network |
1074
- | `security_domain` | endpoint, network, cloud, access |
1075
-
1076
- ### KQL-Specific Fields
1077
-
1078
- | Field | Description |
1079
- |-------|-------------|
1080
- | `kql_category` | Category derived from folder path (e.g., "Defender For Endpoint") |
1081
- | `kql_tags` | Extracted tags (e.g., "ransomware", "hunting", "ti-feed") |
1082
- | `kql_keywords` | Security keywords extracted for search |
1083
- | `platforms` | Platforms (windows, azure-ad, office-365, etc.) |
1084
-
1085
- ### Sublime-Specific Fields
1086
-
1087
- | Field | Description |
1088
- |-------|-------------|
1089
- | `sublime_attack_types` | Attack types (BEC/Fraud, Credential Phishing, Malware/Ransomware, etc.) |
1090
- | `sublime_detection_methods` | Detection methods (Content analysis, URL analysis, Computer Vision, etc.) |
1091
- | `sublime_tactics` | Tactics and techniques (Evasion, Impersonation: Brand, Social engineering, etc.) |
1092
-
1093
- ## Database
1094
-
1095
- The index is stored at `~/.cache/security-detections-mcp/detections.sqlite`.
1096
-
1097
- - Auto-created on first run
1098
- - Auto-indexed when paths are configured
1099
- - Use `rebuild_index()` to refresh after updating detection repos
208
+ ## Using with MITRE ATT&CK MCP
1100
209
 
1101
- ## Supported Detection Formats
210
+ Pairs with [mitre-attack-mcp](https://github.com/MHaggis/mitre-attack-mcp) for complete threat coverage analysis. Install both:
1102
211
 
1103
- ### Sigma Rules (YAML)
1104
-
1105
- Based on the [official Sigma specification](https://github.com/SigmaHQ/sigma-specification):
1106
- - All required fields: `title`, `logsource`, `detection`
1107
- - All optional fields: `id`, `status`, `description`, `author`, `date`, `modified`, `references`, `tags`, `level`, `falsepositives`, etc.
1108
- - CVE tags extracted from `tags` field (e.g., `cve.2021-1675`)
1109
-
1110
- ### Splunk ESCU (YAML)
1111
-
1112
- From [Splunk Security Content](https://github.com/splunk/security_content):
1113
- - Required: `name`, `id`, `search`
1114
- - Optional: `description`, `author`, `date`, `status`, `references`, `tags` (including `mitre_attack_id`, `analytic_story`, `cve`)
1115
-
1116
- ### Splunk Analytic Stories (YAML - Optional)
1117
-
1118
- From [Splunk Security Content stories](https://github.com/splunk/security_content/tree/develop/stories):
1119
- - Provides rich narrative context for threat campaigns
1120
- - Enhances semantic search with detailed descriptions
1121
- - Links detections to broader threat context
1122
-
1123
- ### Elastic Detection Rules (TOML)
1124
-
1125
- From [Elastic Detection Rules](https://github.com/elastic/detection-rules):
1126
- - Required: `rule.name`, `rule.rule_id`
1127
- - Optional: `rule.description`, `rule.query`, `rule.severity`, `rule.tags`, `rule.threat` (MITRE mappings)
1128
- - Supports EQL, KQL, Lucene, and ESQL query languages
1129
-
1130
- ### Sublime Security Rules (YAML)
1131
-
1132
- From [Sublime Security](https://github.com/sublime-security/sublime-rules):
1133
- - Required: `name`, `type` (rule/exclusion), `source` (MQL query)
1134
- - Optional: `description`, `severity`, `id`, `references`, `tags`, `authors`, `attack_types`, `tactics_and_techniques`, `detection_methods`, `false_positives`
1135
- - Uses MQL (Message Query Language) for email-specific detection logic
1136
- - Covers BEC/fraud, credential phishing, malware delivery, spam, and more
1137
-
1138
- ### CrowdStrike CQL Queries (YAML)
1139
-
1140
- From [CQL Hub](https://github.com/ByteRay-Labs/Query-Hub):
1141
- - Required: `name`, `cql` (CrowdStrike Query Language query)
1142
- - Optional: `description`, `mitre_ids`, `author`, `log_sources`, `tags`, `cs_required_modules`, `explanation`
1143
- - Community-driven detection and hunting queries for CrowdStrike NextGen SIEM and Falcon LogScale
1144
- - Covers endpoint, network, cloud, and identity detection use cases
1145
-
1146
- ### KQL Hunting Queries (Markdown & Raw .kql)
1147
-
1148
- Supports multiple KQL repositories:
1149
-
1150
- **[Bert-JanP/Hunting-Queries-Detection-Rules](https://github.com/Bert-JanP/Hunting-Queries-Detection-Rules)** (~290 queries)
1151
- - Microsoft Defender XDR and Azure Sentinel hunting queries in Markdown format
1152
- - Extracts title from markdown heading, KQL from fenced code blocks
1153
- - Extracts MITRE technique IDs from tables
1154
- - Categories: Defender For Endpoint, Azure AD, Threat Hunting, DFIR, etc.
1155
-
1156
- **[jkerai1/KQL-Queries](https://github.com/jkerai1/KQL-Queries)** (~130 queries)
1157
- - Raw `.kql` files for Defender, Entra, Azure, Office 365
1158
- - Title derived from filename
1159
- - Lightweight queries for kqlsearch.com
1160
-
1161
- ## ⚠️ Limitations & Transparency
1162
-
1163
- We believe in being honest about what this tool can and cannot do. Here are the current limitations:
1164
-
1165
- ### Pattern Extraction Limitations
1166
-
1167
- The Detection Engineering Intelligence features extract patterns **dynamically** from your detection corpus, but have some inherent limitations:
1168
-
1169
- | Format | Field Extraction | Notes |
1170
- |--------|-----------------|-------|
1171
- | **Splunk SPL** | ✅ Excellent | Extracts from data models, `by` clauses, `stats` commands, `where` filters |
1172
- | **Sigma** | ✅ Excellent | Full YAML parsing of detection logic |
1173
- | **KQL** | ⚠️ Good | Dynamic extraction from `project`, `extend`, `where`, `summarize by`, `join on` |
1174
- | **Elastic** | ⚠️ Good | Dynamic extraction from `field:value` patterns, EQL `where` clauses |
1175
-
1176
- **What this means:**
1177
- - **SPL and Sigma**: Highly accurate pattern extraction from full detection corpus
1178
- - **KQL and Elastic**: Uses regex-based dynamic extraction that catches most patterns, but may miss:
1179
- - Unusual field naming conventions
1180
- - Complex nested expressions
1181
- - Custom functions or operators
1182
-
1183
- ### Coverage Analysis Limitations
1184
-
1185
- - **MITRE mappings depend on source data** - If a detection doesn't have MITRE tags, we can't map it
1186
- - **Gap analysis is relative** - "Gaps" are based on threat profiles, not absolute coverage requirements
1187
- - **Cross-platform comparisons** - Different platforms have different capabilities; raw counts don't tell the whole story
1188
-
1189
- ### Client Feature Availability
1190
-
1191
- Some v2.1 features depend on **client support**:
1192
-
1193
- | Feature | Requires | Fallback |
1194
- |---------|----------|----------|
1195
- | **Elicitation** | Client MCP elicitation support | Parameter-based confirmation (`confirm: true`) |
1196
- | **Sampling** | Client MCP sampling support | Direct analysis without LLM enhancement |
1197
- | **Resource Subscriptions** | Client subscription support | Poll resources manually |
1198
-
1199
- **Note**: As of January 2025, Cursor may not fully support elicitation and sampling. The MCP gracefully falls back to alternative methods when these features aren't available.
1200
-
1201
- ### Reporting Issues
1202
-
1203
- Found a limitation or inaccuracy? Please [open an issue](https://github.com/MHaggis/Security-Detections-MCP/issues) with:
1204
- 1. The detection format (Sigma, Splunk, Elastic, KQL)
1205
- 2. An example query that wasn't extracted correctly
1206
- 3. Expected vs actual behavior
1207
-
1208
- We continuously improve the pattern extraction based on community feedback.
1209
-
1210
- ## Development
1211
-
1212
- ```bash
1213
- # Install dependencies
1214
- npm install
1215
-
1216
- # Build
1217
- npm run build
1218
-
1219
- # Run tests
1220
- npm test
1221
-
1222
- # Lint (TypeScript strict mode)
1223
- npm run lint
1224
-
1225
- # Run with paths
1226
- SIGMA_PATHS="./detections/sigma/rules" \
1227
- SPLUNK_PATHS="./detections/splunk/detections" \
1228
- ELASTIC_PATHS="./detections/elastic/rules" \
1229
- KQL_PATHS="./detections/kql" \
1230
- SUBLIME_PATHS="./detections/sublime-rules/detection-rules" \
1231
- CQL_HUB_PATHS="./detections/cql-hub/queries" \
1232
- STORY_PATHS="./detections/splunk/stories" \
1233
- npm start
212
+ ```json
213
+ {
214
+ "mcpServers": {
215
+ "security-detections": {
216
+ "command": "npx",
217
+ "args": ["-y", "security-detections-mcp"],
218
+ "env": { "SIGMA_PATHS": "/path/to/sigma/rules" }
219
+ },
220
+ "mitre-attack": {
221
+ "command": "npx",
222
+ "args": ["-y", "mitre-attack-mcp"],
223
+ "env": { "ATTACK_DOMAIN": "enterprise-attack" }
224
+ }
225
+ }
226
+ }
1234
227
  ```
1235
228
 
1236
- ## Stats (with full content)
1237
-
1238
- When fully indexed with all sources:
229
+ ## Stats
1239
230
 
1240
231
  | Source | Count |
1241
232
  |--------|-------|
@@ -1245,196 +236,24 @@ When fully indexed with all sources:
1245
236
  | KQL Queries | ~420+ |
1246
237
  | Sublime Rules | ~900+ |
1247
238
  | CrowdStrike CQL | ~139+ |
1248
- | Analytic Stories | ~330 |
1249
- | **Total Detections** | **~8,200+** |
1250
- | **Indexed Patterns** | **10,235+** |
1251
- | **Techniques with Patterns** | **528+** |
1252
- | **Detection Formats** | **6** (Sigma, Splunk, Elastic, KQL, Sublime, CrowdStrike CQL) |
1253
- | **Total Tools** | **71+** |
1254
- | **MCP Prompts** | **11** |
1255
- | **MCP Resources** | **9 static + 5 templates** |
1256
-
1257
- ## 🧠 Tribal Knowledge
1258
-
1259
- **Tribal Knowledge** is the analytical memory system that helps future agents understand WHY decisions were made, not just WHAT was detected. It's like having a senior analyst's notebook that persists across sessions.
1260
-
1261
- ### What is Tribal Knowledge?
1262
-
1263
- Traditional detection systems store facts: "We have 5 detections for T1059.001." Tribal Knowledge stores reasoning: "We prioritized T1059.001 because it's used in 80% of ransomware attacks, and our current detections miss base64-encoded PowerShell, which is why we added detection X."
1264
-
1265
- ### Knowledge Graph Tables
1266
-
1267
- The knowledge graph consists of four interconnected tables:
1268
-
1269
- 1. **Entities** - Things you care about (threats, techniques, detections, data sources, campaigns)
1270
- 2. **Relations** - How entities connect ("APT29 uses T1059.001", "Detection X covers T1059.001")
1271
- 3. **Decisions** - Analytical reasoning and decision-making context
1272
- 4. **Learnings** - Insights, patterns, and lessons learned
1273
-
1274
- ### How It Helps Future Agents
1275
-
1276
- When you log a decision like:
1277
- ```json
1278
- log_decision(
1279
- context: "Ransomware gap analysis",
1280
- decision: "Prioritize T1486 (Data Encrypted for Impact)",
1281
- reasoning: "This is the final stage of ransomware attacks. Without detection here, we can't prevent data loss.",
1282
- tags: ["ransomware", "priority", "data-protection"]
1283
- )
1284
- ```
1285
-
1286
- Future agents can retrieve this context when analyzing ransomware coverage, understanding not just that T1486 is important, but WHY it was prioritized.
1287
-
1288
- ### Example Workflow
1289
-
1290
- ```
1291
- 1. Analyze ransomware gaps → identify_gaps("ransomware")
1292
- 2. Log decision → log_decision("Prioritized T1486 because...")
1293
- 3. Create entity → create_entity("Ransomware Campaign 2024", "threat")
1294
- 4. Link detection → link_detection_to_entity("det_123", "Ransomware Campaign 2024", "detects")
1295
- 5. Future agent → get_relevant_decisions("ransomware") → understands context
1296
- ```
1297
-
1298
- ## 🔬 Detection Engineering Intelligence
1299
-
1300
- **Detection Engineering Intelligence** learns patterns from your detection corpus and helps you create better detections faster.
1301
-
1302
- ### Pattern Learning from 4 Sources
1303
-
1304
- The system automatically extracts patterns from:
1305
- - **Sigma rules** - YAML-based detection logic
1306
- - **Splunk SPL** - Search Processing Language queries
1307
- - **KQL queries** - Microsoft Kusto Query Language
1308
- - **Elastic queries** - Elastic Detection Rules (EQL, KQL, Lucene)
1309
-
1310
- ### Automatic Template Generation
1311
-
1312
- When you need a detection for T1059.001 (PowerShell), the system:
1313
- 1. Analyzes all existing T1059.001 detections across formats
1314
- 2. Extracts common patterns (process names, command-line arguments, base64 encoding)
1315
- 3. Generates a template with placeholders for your specific environment
1316
- 4. Suggests improvements based on learned patterns
1317
-
1318
- ### Field and Macro References
1319
-
1320
- The system tracks:
1321
- - Which fields/macros are commonly used for each technique
1322
- - Cross-platform field mappings (e.g., `process_name` in Splunk vs `ProcessName` in KQL)
1323
- - Best practices for field usage in different contexts
1324
-
1325
- ### Learning from User Feedback
1326
-
1327
- When you improve a detection or correct a pattern:
1328
- - The system learns from your changes
1329
- - Future template generation incorporates your improvements
1330
- - Field suggestions become more accurate over time
1331
-
1332
- ### Example Workflow
1333
-
1334
- ```
1335
- 1. Extract patterns → extract_patterns("T1059.001")
1336
- 2. Review patterns → get_patterns("T1059.001", "splunk")
1337
- 3. Generate template → generate_template("T1059.001", "splunk", "Sysmon")
1338
- 4. Customize template → (edit generated detection)
1339
- 5. System learns → (automatically improves future templates)
1340
- ```
1341
-
1342
- ## 📚 Documentation
1343
-
1344
- For detailed information on v2.1 features:
1345
-
1346
- - **[Architecture](docs/wiki/Architecture.md)** - System architecture and design decisions
1347
- - **[Knowledge Graph](docs/wiki/Knowledge-Graph.md)** - Deep dive into tribal knowledge and knowledge graph usage
1348
- - **[Engineering Intelligence](docs/wiki/Engineering-Intelligence.md)** - Pattern learning and template generation guide
1349
- - **[Tools Reference](docs/wiki/Tools-Reference.md)** - Complete reference for all 71+ tools
1350
-
1351
- ## 🔗 Using with MITRE ATT&CK MCP
1352
-
1353
- **This MCP pairs perfectly with [mitre-attack-mcp](https://github.com/MHaggis/mitre-attack-mcp)** for complete threat coverage analysis:
1354
-
1355
- | MCP | Purpose |
1356
- |-----|---------|
1357
- | **security-detections-mcp** | Query 8,100+ detection rules + 11 expert workflow prompts |
1358
- | **mitre-attack-mcp** | ATT&CK framework data, threat groups, Navigator layers |
1359
-
1360
- ### With MCP Prompts (Easiest)
1361
-
1362
- The prompts automatically leverage both MCPs for comprehensive analysis:
1363
-
1364
- ```
1365
- You: "Run apt-threat-emulation for APT29"
239
+ | **Total** | **~8,200+** |
1366
240
 
1367
- The prompt automatically:
1368
- 1. Uses mitre-attack-mcp to get APT29's profile and techniques
1369
- 2. Uses security-detections-mcp to check coverage for each technique
1370
- 3. Calculates coverage percentage and identifies gaps
1371
- 4. Generates purple team test plan
1372
- 5. Outputs professional report with recommendations
1373
- ```
1374
-
1375
- ```
1376
- You: "Use threat-landscape-sync for the finance industry"
1377
-
1378
- The prompt automatically:
1379
- 1. Gets top threat actors from mitre-attack-mcp
1380
- 2. Filters by industry relevance
1381
- 3. Analyzes your coverage against each actor
1382
- 4. Prioritizes detection investments
1383
- 5. Creates strategic roadmap
1384
- ```
1385
-
1386
- ### With Tools Directly (More Control)
1387
-
1388
- ```
1389
- You: "What's my coverage against APT29?"
1390
-
1391
- LLM workflow (3 calls, ~10KB total):
1392
- 1. mitre-attack-mcp → get_group_techniques("G0016") # APT29's TTPs
1393
- 2. detections-mcp → analyze_coverage(source_type="elastic") # Your coverage
1394
- 3. mitre-attack-mcp → find_group_gaps("G0016", your_coverage) # The gaps
1395
-
1396
- Result: Prioritized gap list, not 500KB of raw data
1397
- ```
1398
-
1399
- ### Generate Navigator Layer
1400
-
1401
- ```
1402
- You: "Generate a Navigator layer for my initial access coverage"
1403
-
1404
- LLM workflow:
1405
- 1. detections-mcp → get_technique_ids(tactic="initial-access") # Get covered technique IDs
1406
- 2. mitre-attack-mcp → generate_coverage_layer(covered_ids, "Initial Access Coverage")
241
+ ## Development
1407
242
 
1408
- → Returns ready-to-import Navigator JSON
243
+ ```bash
244
+ npm install && npm run build && npm test
1409
245
  ```
1410
246
 
1411
- ### Install Both Together (Recommended)
247
+ ## Documentation
1412
248
 
1413
- ```json
1414
- {
1415
- "mcpServers": {
1416
- "security-detections": {
1417
- "command": "npx",
1418
- "args": ["-y", "security-detections-mcp"],
1419
- "env": {
1420
- "SIGMA_PATHS": "/path/to/sigma/rules",
1421
- "SPLUNK_PATHS": "/path/to/security_content/detections",
1422
- "ELASTIC_PATHS": "/path/to/detection-rules/rules",
1423
- "KQL_PATHS": "/path/to/kql-hunting-queries",
1424
- "SUBLIME_PATHS": "/path/to/sublime-rules/detection-rules",
1425
- "CQL_HUB_PATHS": "/path/to/cql-hub/queries"
1426
- }
1427
- },
1428
- "mitre-attack": {
1429
- "command": "npx",
1430
- "args": ["-y", "mitre-attack-mcp"],
1431
- "env": {
1432
- "ATTACK_DOMAIN": "enterprise-attack"
1433
- }
1434
- }
1435
- }
1436
- }
1437
- ```
249
+ - **[Setup Guide](./SETUP.md)** — Full install walkthrough for all platforms
250
+ - **[Hosted MCP Guide](./docs/HOSTED_MCP.md)** — Hosted setup, token management, tool inventory
251
+ - **[Autonomous Platform](./docs/AUTONOMOUS.md)** — CTI-to-detection pipeline
252
+ - **[E2E Testing Guide](./docs/E2E-TESTING-GUIDE.md)** — Per-SIEM setup (Splunk, Sentinel, Elastic, Sigma)
253
+ - **[Architecture](docs/wiki/Architecture.md)** — System design decisions
254
+ - **[Knowledge Graph](docs/wiki/Knowledge-Graph.md)** — Tribal knowledge and analytical memory
255
+ - **[Engineering Intelligence](docs/wiki/Engineering-Intelligence.md)** — Pattern learning and templates
256
+ - **[Tools Reference](docs/wiki/Tools-Reference.md)** — Complete reference for all 81 tools
1438
257
 
1439
258
  ## License
1440
259