security-detections-mcp 1.1.0 → 1.3.0
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.
- package/README.md +184 -20
- package/dist/db.d.ts +61 -1
- package/dist/db.js +354 -12
- package/dist/index.js +318 -9
- package/dist/indexer.d.ts +3 -1
- package/dist/indexer.js +74 -2
- package/dist/parsers/elastic.js +4 -0
- package/dist/parsers/kql.d.ts +3 -0
- package/dist/parsers/kql.js +424 -0
- package/dist/parsers/sigma.js +4 -0
- package/dist/parsers/splunk.js +4 -0
- package/dist/types.d.ts +6 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
# Security Detections MCP
|
|
2
2
|
|
|
3
|
-
An MCP (Model Context Protocol) server that lets LLMs query a unified database of **Sigma**, **Splunk ESCU**, and **
|
|
3
|
+
An MCP (Model Context Protocol) server that lets LLMs query a unified database of **Sigma**, **Splunk ESCU**, **Elastic**, and **KQL** security detection rules.
|
|
4
4
|
|
|
5
|
-
[](https://cursor.com/en/install-mcp?name=security-detections&config=
|
|
5
|
+
[](https://cursor.com/en/install-mcp?name=security-detections&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInNlY3VyaXR5LWRldGVjdGlvbnMtbWNwIl0sImVudiI6eyJTSUdNQV9QQVRIUyI6Ii9wYXRoL3RvL3NpZ21hL3J1bGVzLC9wYXRoL3RvL3NpZ21hL3J1bGVzLXRocmVhdC1odW50aW5nIiwiU1BMVU5LX1BBVEhTIjoiL3BhdGgvdG8vc2VjdXJpdHlfY29udGVudC9kZXRlY3Rpb25zIiwiU1RPUllfUEFUSFMiOiIvcGF0aC90by9zZWN1cml0eV9jb250ZW50L3N0b3JpZXMiLCJFTEFTVElDX1BBVEhTIjoiL3BhdGgvdG8vZGV0ZWN0aW9uLXJ1bGVzL3J1bGVzIiwiS1FMX1BBVEhTIjoiL3BhdGgvdG8va3FsLXJ1bGVzIn19)
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
- **Unified Search** - Query Sigma, Splunk ESCU, and
|
|
9
|
+
- **Unified Search** - Query Sigma, Splunk ESCU, Elastic, and KQL detections from a single interface
|
|
10
10
|
- **Full-Text Search** - SQLite FTS5 powered search across names, descriptions, queries, MITRE tactics, CVEs, process names, and more
|
|
11
11
|
- **MITRE ATT&CK Mapping** - Filter detections by technique ID or tactic
|
|
12
12
|
- **CVE Coverage** - Find detections for specific CVE vulnerabilities
|
|
13
13
|
- **Process Name Search** - Find detections that reference specific processes (e.g., powershell.exe, w3wp.exe)
|
|
14
14
|
- **Analytic Stories** - Query by Splunk analytic story (optional - enhances context)
|
|
15
|
+
- **KQL Categories** - Filter KQL queries by category (Defender For Endpoint, Azure AD, Threat Hunting, etc.)
|
|
15
16
|
- **Auto-Indexing** - Automatically indexes detections on startup from configured paths
|
|
16
|
-
- **Multi-Format Support** - YAML (Sigma, Splunk), TOML (Elastic)
|
|
17
|
+
- **Multi-Format Support** - YAML (Sigma, Splunk), TOML (Elastic), Markdown (KQL)
|
|
17
18
|
- **Logsource Filtering** - Filter Sigma rules by category, product, or service
|
|
18
19
|
- **Severity Filtering** - Filter by criticality level
|
|
19
20
|
|
|
@@ -52,7 +53,8 @@ Add to your MCP config (`~/.cursor/mcp.json` or `.cursor/mcp.json` in your proje
|
|
|
52
53
|
"SIGMA_PATHS": "/path/to/sigma/rules,/path/to/sigma/rules-threat-hunting",
|
|
53
54
|
"SPLUNK_PATHS": "/path/to/security_content/detections",
|
|
54
55
|
"ELASTIC_PATHS": "/path/to/detection-rules/rules",
|
|
55
|
-
"STORY_PATHS": "/path/to/security_content/stories"
|
|
56
|
+
"STORY_PATHS": "/path/to/security_content/stories",
|
|
57
|
+
"KQL_PATHS": "/path/to/Hunting-Queries-Detection-Rules"
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
}
|
|
@@ -73,7 +75,8 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
|
73
75
|
"SIGMA_PATHS": "/Users/you/sigma/rules,/Users/you/sigma/rules-threat-hunting",
|
|
74
76
|
"SPLUNK_PATHS": "/Users/you/security_content/detections",
|
|
75
77
|
"ELASTIC_PATHS": "/Users/you/detection-rules/rules",
|
|
76
|
-
"STORY_PATHS": "/Users/you/security_content/stories"
|
|
78
|
+
"STORY_PATHS": "/Users/you/security_content/stories",
|
|
79
|
+
"KQL_PATHS": "/Users/you/Hunting-Queries-Detection-Rules"
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
82
|
}
|
|
@@ -84,16 +87,17 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
|
84
87
|
|
|
85
88
|
| Variable | Description | Required |
|
|
86
89
|
|----------|-------------|----------|
|
|
87
|
-
| `SIGMA_PATHS` | Comma-separated paths to Sigma rule directories |
|
|
88
|
-
| `SPLUNK_PATHS` | Comma-separated paths to Splunk ESCU detection directories |
|
|
89
|
-
| `ELASTIC_PATHS` | Comma-separated paths to Elastic detection rule directories |
|
|
90
|
+
| `SIGMA_PATHS` | Comma-separated paths to Sigma rule directories | At least one source required |
|
|
91
|
+
| `SPLUNK_PATHS` | Comma-separated paths to Splunk ESCU detection directories | At least one source required |
|
|
92
|
+
| `ELASTIC_PATHS` | Comma-separated paths to Elastic detection rule directories | At least one source required |
|
|
93
|
+
| `KQL_PATHS` | Comma-separated paths to KQL hunting query directories | At least one source required |
|
|
90
94
|
| `STORY_PATHS` | Comma-separated paths to Splunk analytic story directories | No (enhances context) |
|
|
91
95
|
|
|
92
96
|
## Getting Detection Content
|
|
93
97
|
|
|
94
98
|
### Quick Start: Download All Rules (Copy & Paste)
|
|
95
99
|
|
|
96
|
-
Create a `detections` folder and download all
|
|
100
|
+
Create a `detections` folder and download all sources with sparse checkout (only downloads the rules, not full repos):
|
|
97
101
|
|
|
98
102
|
```bash
|
|
99
103
|
# Create detections directory
|
|
@@ -111,10 +115,15 @@ cd security_content && git sparse-checkout set detections stories && cd ..
|
|
|
111
115
|
git clone --depth 1 --filter=blob:none --sparse https://github.com/elastic/detection-rules.git
|
|
112
116
|
cd detection-rules && git sparse-checkout set rules && cd ..
|
|
113
117
|
|
|
118
|
+
# Download KQL hunting queries (~400+ queries from 2 repos)
|
|
119
|
+
git clone --depth 1 https://github.com/Bert-JanP/Hunting-Queries-Detection-Rules.git kql-bertjanp
|
|
120
|
+
git clone --depth 1 https://github.com/jkerai1/KQL-Queries.git kql-jkerai1
|
|
121
|
+
|
|
114
122
|
echo "Done! Configure your MCP with these paths:"
|
|
115
123
|
echo " SIGMA_PATHS: $(pwd)/sigma/rules,$(pwd)/sigma/rules-threat-hunting"
|
|
116
124
|
echo " SPLUNK_PATHS: $(pwd)/security_content/detections"
|
|
117
125
|
echo " ELASTIC_PATHS: $(pwd)/detection-rules/rules"
|
|
126
|
+
echo " KQL_PATHS: $(pwd)/kql-bertjanp,$(pwd)/kql-jkerai1"
|
|
118
127
|
echo " STORY_PATHS: $(pwd)/security_content/stories"
|
|
119
128
|
```
|
|
120
129
|
|
|
@@ -134,6 +143,11 @@ git clone https://github.com/splunk/security_content.git
|
|
|
134
143
|
# Elastic Detection Rules
|
|
135
144
|
git clone https://github.com/elastic/detection-rules.git
|
|
136
145
|
# Use rules/ directory
|
|
146
|
+
|
|
147
|
+
# KQL Hunting Queries (multiple sources supported)
|
|
148
|
+
git clone https://github.com/Bert-JanP/Hunting-Queries-Detection-Rules.git
|
|
149
|
+
git clone https://github.com/jkerai1/KQL-Queries.git
|
|
150
|
+
# Use entire repos, combine paths with comma
|
|
137
151
|
```
|
|
138
152
|
|
|
139
153
|
## MCP Tools
|
|
@@ -145,8 +159,8 @@ git clone https://github.com/elastic/detection-rules.git
|
|
|
145
159
|
| `search(query, limit)` | Full-text search across all detection fields (names, descriptions, queries, CVEs, process names, etc.) |
|
|
146
160
|
| `get_by_id(id)` | Get a single detection by its ID |
|
|
147
161
|
| `list_all(limit, offset)` | Paginated list of all detections |
|
|
148
|
-
| `list_by_source(source_type)` | Filter by `sigma`, `splunk_escu`, or `
|
|
149
|
-
| `get_raw_yaml(id)` | Get the original YAML/TOML content |
|
|
162
|
+
| `list_by_source(source_type)` | Filter by `sigma`, `splunk_escu`, `elastic`, or `kql` |
|
|
163
|
+
| `get_raw_yaml(id)` | Get the original YAML/TOML/Markdown content |
|
|
150
164
|
| `get_stats()` | Get index statistics |
|
|
151
165
|
| `rebuild_index()` | Force re-index from configured paths |
|
|
152
166
|
|
|
@@ -174,6 +188,14 @@ git clone https://github.com/elastic/detection-rules.git
|
|
|
174
188
|
| `list_by_detection_type(type)` | Filter by type (TTP, Anomaly, Hunting, Correlation) |
|
|
175
189
|
| `list_by_analytic_story(story)` | Filter by Splunk analytic story |
|
|
176
190
|
|
|
191
|
+
### KQL-Specific Filters
|
|
192
|
+
|
|
193
|
+
| Tool | Description |
|
|
194
|
+
|------|-------------|
|
|
195
|
+
| `list_by_kql_category(category)` | Filter KQL by category (e.g., "Defender For Endpoint", "Azure Active Directory", "Threat Hunting") |
|
|
196
|
+
| `list_by_kql_tag(tag)` | Filter KQL by tag (e.g., "ransomware", "hunting", "ti-feed", "dfir") |
|
|
197
|
+
| `list_by_kql_datasource(data_source)` | Filter KQL by Microsoft data source (e.g., "DeviceProcessEvents", "SigninLogs") |
|
|
198
|
+
|
|
177
199
|
### Story Tools (Optional)
|
|
178
200
|
|
|
179
201
|
| Tool | Description |
|
|
@@ -183,6 +205,45 @@ git clone https://github.com/elastic/detection-rules.git
|
|
|
183
205
|
| `list_stories(limit, offset)` | List all analytic stories |
|
|
184
206
|
| `list_stories_by_category(category)` | Filter stories by category (Malware, Adversary Tactics, etc.) |
|
|
185
207
|
|
|
208
|
+
### Efficient Analysis Tools (Token-Optimized)
|
|
209
|
+
|
|
210
|
+
These tools do heavy processing server-side and return minimal, actionable data:
|
|
211
|
+
|
|
212
|
+
| Tool | Description | Output Size |
|
|
213
|
+
|------|-------------|-------------|
|
|
214
|
+
| `analyze_coverage(source_type?)` | Get coverage stats by tactic, top techniques, weak spots | ~2KB |
|
|
215
|
+
| `identify_gaps(threat_profile, source_type?)` | Find gaps for ransomware, apt, persistence, etc. | ~500B |
|
|
216
|
+
| `suggest_detections(technique_id, source_type?)` | Get detection ideas for a technique | ~2KB |
|
|
217
|
+
| `get_technique_ids(source_type?, tactic?, severity?)` | Get only technique IDs (no full objects) | ~200B |
|
|
218
|
+
| `generate_navigator_layer(name, source_type?, tactic?)` | Generate ATT&CK Navigator layer JSON | ~3KB |
|
|
219
|
+
|
|
220
|
+
**Why use these?** Traditional tools return full detection objects (~50KB+ per query). These return only what you need, saving 25x+ tokens.
|
|
221
|
+
|
|
222
|
+
## Claude Code Skills
|
|
223
|
+
|
|
224
|
+
This repo includes [Claude Code Skills](https://code.claude.com/docs/en/skills) in `.claude/skills/` that teach Claude efficient workflows:
|
|
225
|
+
|
|
226
|
+
| Skill | Purpose |
|
|
227
|
+
|-------|---------|
|
|
228
|
+
| `coverage-analysis` | Efficient coverage analysis using the token-optimized tools |
|
|
229
|
+
|
|
230
|
+
**Why skills?** Instead of figuring out methodology each time (wasting tokens), skills teach Claude once.
|
|
231
|
+
|
|
232
|
+
You can also install personal skills to `~/.claude/skills/` for cross-project use.
|
|
233
|
+
|
|
234
|
+
### Example: Efficient Coverage Analysis
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
You: "What's my Elastic coverage against ransomware?"
|
|
238
|
+
|
|
239
|
+
AI uses skills + efficient tools:
|
|
240
|
+
1. analyze_coverage(source_type="elastic") → Stats by tactic
|
|
241
|
+
2. identify_gaps(threat_profile="ransomware") → Prioritized gaps
|
|
242
|
+
3. suggest_detections(technique_id="T1486") → Fix top gap
|
|
243
|
+
|
|
244
|
+
Total: ~5KB of data vs ~500KB with traditional tools
|
|
245
|
+
```
|
|
246
|
+
|
|
186
247
|
## Example Workflows
|
|
187
248
|
|
|
188
249
|
### Find PowerShell Detections
|
|
@@ -204,7 +265,7 @@ Tool: list_by_cve(cve_id="CVE-2024-27198")
|
|
|
204
265
|
```
|
|
205
266
|
LLM: "What detections do we have for credential dumping?"
|
|
206
267
|
Tool: search(query="credential dumping", limit=10)
|
|
207
|
-
→ Returns results from Sigma, Splunk, AND
|
|
268
|
+
→ Returns results from Sigma, Splunk, Elastic, AND KQL
|
|
208
269
|
```
|
|
209
270
|
|
|
210
271
|
### Find Web Server Attack Detections
|
|
@@ -222,24 +283,39 @@ Tool: search_stories(query="ransomware")
|
|
|
222
283
|
Tool: list_by_analytic_story(story="Ransomware")
|
|
223
284
|
```
|
|
224
285
|
|
|
286
|
+
### Find KQL Hunting Queries for Defender
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
LLM: "What KQL queries do we have for Defender For Endpoint?"
|
|
290
|
+
Tool: list_by_kql_category(category="Defender For Endpoint")
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Search for BloodHound Detections
|
|
294
|
+
|
|
295
|
+
```
|
|
296
|
+
LLM: "Find detections for BloodHound usage"
|
|
297
|
+
Tool: search(query="bloodhound", limit=10)
|
|
298
|
+
→ Returns KQL hunting queries and other source detections
|
|
299
|
+
```
|
|
300
|
+
|
|
225
301
|
## Unified Schema
|
|
226
302
|
|
|
227
|
-
All detection sources (Sigma, Splunk, Elastic) are normalized to a common schema:
|
|
303
|
+
All detection sources (Sigma, Splunk, Elastic, KQL) are normalized to a common schema:
|
|
228
304
|
|
|
229
305
|
### Core Fields
|
|
230
306
|
|
|
231
307
|
| Field | Description |
|
|
232
308
|
|-------|-------------|
|
|
233
|
-
| `id` | Unique identifier
|
|
309
|
+
| `id` | Unique identifier |
|
|
234
310
|
| `name` | Detection name/title |
|
|
235
311
|
| `description` | What the detection looks for |
|
|
236
|
-
| `query` | Detection logic (Sigma YAML, Splunk SPL,
|
|
237
|
-
| `source_type` | `sigma`, `splunk_escu`, or `
|
|
312
|
+
| `query` | Detection logic (Sigma YAML, Splunk SPL, Elastic EQL, or KQL) |
|
|
313
|
+
| `source_type` | `sigma`, `splunk_escu`, `elastic`, or `kql` |
|
|
238
314
|
| `severity` | Detection severity level |
|
|
239
315
|
| `status` | Rule status (stable, test, experimental, production, etc.) |
|
|
240
316
|
| `author` | Rule author |
|
|
241
317
|
| `file_path` | Original file path |
|
|
242
|
-
| `raw_yaml` | Original YAML/TOML content |
|
|
318
|
+
| `raw_yaml` | Original YAML/TOML/Markdown content |
|
|
243
319
|
|
|
244
320
|
### Enhanced Fields (for Semantic Search)
|
|
245
321
|
|
|
@@ -252,11 +328,20 @@ All detection sources (Sigma, Splunk, Elastic) are normalized to a common schema
|
|
|
252
328
|
| `process_names` | Process names referenced in detection |
|
|
253
329
|
| `file_paths` | Interesting file paths referenced |
|
|
254
330
|
| `registry_paths` | Registry paths referenced |
|
|
255
|
-
| `data_sources` | Required data sources |
|
|
331
|
+
| `data_sources` | Required data sources (Sysmon, DeviceProcessEvents, etc.) |
|
|
256
332
|
| `detection_type` | TTP, Anomaly, Hunting, or Correlation |
|
|
257
333
|
| `asset_type` | Endpoint, Web Server, Cloud, Network |
|
|
258
334
|
| `security_domain` | endpoint, network, cloud, access |
|
|
259
335
|
|
|
336
|
+
### KQL-Specific Fields
|
|
337
|
+
|
|
338
|
+
| Field | Description |
|
|
339
|
+
|-------|-------------|
|
|
340
|
+
| `kql_category` | Category derived from folder path (e.g., "Defender For Endpoint") |
|
|
341
|
+
| `kql_tags` | Extracted tags (e.g., "ransomware", "hunting", "ti-feed") |
|
|
342
|
+
| `kql_keywords` | Security keywords extracted for search |
|
|
343
|
+
| `platforms` | Platforms (windows, azure-ad, office-365, etc.) |
|
|
344
|
+
|
|
260
345
|
## Database
|
|
261
346
|
|
|
262
347
|
The index is stored at `~/.cache/security-detections-mcp/detections.sqlite`.
|
|
@@ -294,6 +379,21 @@ From [Elastic Detection Rules](https://github.com/elastic/detection-rules):
|
|
|
294
379
|
- Optional: `rule.description`, `rule.query`, `rule.severity`, `rule.tags`, `rule.threat` (MITRE mappings)
|
|
295
380
|
- Supports EQL, KQL, Lucene, and ESQL query languages
|
|
296
381
|
|
|
382
|
+
### KQL Hunting Queries (Markdown & Raw .kql)
|
|
383
|
+
|
|
384
|
+
Supports multiple KQL repositories:
|
|
385
|
+
|
|
386
|
+
**[Bert-JanP/Hunting-Queries-Detection-Rules](https://github.com/Bert-JanP/Hunting-Queries-Detection-Rules)** (~290 queries)
|
|
387
|
+
- Microsoft Defender XDR and Azure Sentinel hunting queries in Markdown format
|
|
388
|
+
- Extracts title from markdown heading, KQL from fenced code blocks
|
|
389
|
+
- Extracts MITRE technique IDs from tables
|
|
390
|
+
- Categories: Defender For Endpoint, Azure AD, Threat Hunting, DFIR, etc.
|
|
391
|
+
|
|
392
|
+
**[jkerai1/KQL-Queries](https://github.com/jkerai1/KQL-Queries)** (~130 queries)
|
|
393
|
+
- Raw `.kql` files for Defender, Entra, Azure, Office 365
|
|
394
|
+
- Title derived from filename
|
|
395
|
+
- Lightweight queries for kqlsearch.com
|
|
396
|
+
|
|
297
397
|
## Development
|
|
298
398
|
|
|
299
399
|
```bash
|
|
@@ -307,6 +407,7 @@ npm run build
|
|
|
307
407
|
SIGMA_PATHS="./detections/sigma/rules" \
|
|
308
408
|
SPLUNK_PATHS="./detections/splunk/detections" \
|
|
309
409
|
ELASTIC_PATHS="./detections/elastic/rules" \
|
|
410
|
+
KQL_PATHS="./detections/kql" \
|
|
310
411
|
STORY_PATHS="./detections/splunk/stories" \
|
|
311
412
|
npm start
|
|
312
413
|
```
|
|
@@ -320,8 +421,71 @@ When fully indexed with all sources:
|
|
|
320
421
|
| Sigma Rules | ~3,000+ |
|
|
321
422
|
| Splunk ESCU | ~2,000+ |
|
|
322
423
|
| Elastic Rules | ~1,500+ |
|
|
424
|
+
| KQL Queries | ~420+ |
|
|
323
425
|
| Analytic Stories | ~330 |
|
|
324
|
-
| **Total** | **~
|
|
426
|
+
| **Total** | **~7,200+** |
|
|
427
|
+
|
|
428
|
+
## 🔗 Using with MITRE ATT&CK MCP
|
|
429
|
+
|
|
430
|
+
**This MCP pairs perfectly with [mitre-attack-mcp](https://github.com/MHaggis/mitre-attack-mcp)** for complete threat coverage analysis:
|
|
431
|
+
|
|
432
|
+
| MCP | Purpose |
|
|
433
|
+
|-----|---------|
|
|
434
|
+
| **security-detections-mcp** | Query 7,200+ detection rules (Sigma, Splunk ESCU, Elastic, KQL) |
|
|
435
|
+
| **mitre-attack-mcp** | Analyze coverage against ATT&CK framework, generate Navigator layers |
|
|
436
|
+
|
|
437
|
+
### Combined Workflow (Efficient)
|
|
438
|
+
|
|
439
|
+
```
|
|
440
|
+
You: "What's my coverage against APT29?"
|
|
441
|
+
|
|
442
|
+
LLM workflow (3 calls, ~10KB total):
|
|
443
|
+
1. mitre-attack-mcp → get_group_techniques("G0016") # APT29's TTPs
|
|
444
|
+
2. detections-mcp → analyze_coverage(source_type="elastic") # Your coverage
|
|
445
|
+
3. mitre-attack-mcp → find_group_gaps("G0016", your_coverage) # The gaps
|
|
446
|
+
|
|
447
|
+
Result: Prioritized gap list, not 500KB of raw data
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### Generate Navigator Layer (1 call)
|
|
451
|
+
|
|
452
|
+
```
|
|
453
|
+
You: "Generate a Navigator layer for my initial access coverage"
|
|
454
|
+
|
|
455
|
+
LLM: generate_navigator_layer(
|
|
456
|
+
name="Initial Access Coverage",
|
|
457
|
+
source_type="elastic",
|
|
458
|
+
tactic="initial-access"
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
→ Returns ready-to-import Navigator JSON
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### Install Both Together
|
|
465
|
+
|
|
466
|
+
```json
|
|
467
|
+
{
|
|
468
|
+
"mcpServers": {
|
|
469
|
+
"security-detections": {
|
|
470
|
+
"command": "npx",
|
|
471
|
+
"args": ["-y", "security-detections-mcp"],
|
|
472
|
+
"env": {
|
|
473
|
+
"SIGMA_PATHS": "/path/to/sigma/rules",
|
|
474
|
+
"SPLUNK_PATHS": "/path/to/security_content/detections",
|
|
475
|
+
"ELASTIC_PATHS": "/path/to/detection-rules/rules",
|
|
476
|
+
"KQL_PATHS": "/path/to/kql-hunting-queries"
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
"mitre-attack": {
|
|
480
|
+
"command": "npx",
|
|
481
|
+
"args": ["-y", "mitre-attack-mcp"],
|
|
482
|
+
"env": {
|
|
483
|
+
"ATTACK_DOMAIN": "enterprise-attack"
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
```
|
|
325
489
|
|
|
326
490
|
## License
|
|
327
491
|
|
package/dist/db.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function insertDetection(detection: Detection): void;
|
|
|
8
8
|
export declare function searchDetections(query: string, limit?: number): Detection[];
|
|
9
9
|
export declare function getDetectionById(id: string): Detection | null;
|
|
10
10
|
export declare function listDetections(limit?: number, offset?: number): Detection[];
|
|
11
|
-
export declare function listBySource(sourceType: 'sigma' | 'splunk_escu' | 'elastic', limit?: number, offset?: number): Detection[];
|
|
11
|
+
export declare function listBySource(sourceType: 'sigma' | 'splunk_escu' | 'elastic' | 'kql', limit?: number, offset?: number): Detection[];
|
|
12
12
|
export declare function listByMitre(techniqueId: string, limit?: number, offset?: number): Detection[];
|
|
13
13
|
export declare function listByLogsource(category?: string, product?: string, service?: string, limit?: number, offset?: number): Detection[];
|
|
14
14
|
export declare function listBySeverity(level: string, limit?: number, offset?: number): Detection[];
|
|
@@ -17,6 +17,9 @@ export declare function listByAnalyticStory(story: string, limit?: number, offse
|
|
|
17
17
|
export declare function listByProcessName(processName: string, limit?: number, offset?: number): Detection[];
|
|
18
18
|
export declare function listByDetectionType(detectionType: string, limit?: number, offset?: number): Detection[];
|
|
19
19
|
export declare function listByDataSource(dataSource: string, limit?: number, offset?: number): Detection[];
|
|
20
|
+
export declare function listByKqlCategory(category: string, limit?: number, offset?: number): Detection[];
|
|
21
|
+
export declare function listByKqlTag(tag: string, limit?: number, offset?: number): Detection[];
|
|
22
|
+
export declare function listByKqlDatasource(dataSource: string, limit?: number, offset?: number): Detection[];
|
|
20
23
|
export declare function listByMitreTactic(tactic: string, limit?: number, offset?: number): Detection[];
|
|
21
24
|
export declare function getStats(): IndexStats;
|
|
22
25
|
export declare function getRawYaml(id: string): string | null;
|
|
@@ -29,3 +32,60 @@ export declare function searchStories(query: string, limit?: number): AnalyticSt
|
|
|
29
32
|
export declare function listStories(limit?: number, offset?: number): AnalyticStory[];
|
|
30
33
|
export declare function listStoriesByCategory(category: string, limit?: number, offset?: number): AnalyticStory[];
|
|
31
34
|
export declare function getStoryCount(): number;
|
|
35
|
+
export interface TechniqueIdFilters {
|
|
36
|
+
source_type?: 'sigma' | 'splunk_escu' | 'elastic';
|
|
37
|
+
tactic?: string;
|
|
38
|
+
severity?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function getTechniqueIds(filters?: TechniqueIdFilters): string[];
|
|
41
|
+
export interface CoverageReport {
|
|
42
|
+
summary: {
|
|
43
|
+
total_techniques: number;
|
|
44
|
+
total_detections: number;
|
|
45
|
+
coverage_by_tactic: Record<string, {
|
|
46
|
+
covered: number;
|
|
47
|
+
total: number;
|
|
48
|
+
percent: number;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
top_covered: Array<{
|
|
52
|
+
technique: string;
|
|
53
|
+
detection_count: number;
|
|
54
|
+
}>;
|
|
55
|
+
weak_coverage: Array<{
|
|
56
|
+
technique: string;
|
|
57
|
+
detection_count: number;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
export declare function analyzeCoverage(sourceType?: 'sigma' | 'splunk_escu' | 'elastic'): CoverageReport;
|
|
61
|
+
export interface GapAnalysis {
|
|
62
|
+
threat_profile: string;
|
|
63
|
+
total_gaps: number;
|
|
64
|
+
critical_gaps: Array<{
|
|
65
|
+
technique: string;
|
|
66
|
+
priority: string;
|
|
67
|
+
reason: string;
|
|
68
|
+
}>;
|
|
69
|
+
covered: string[];
|
|
70
|
+
recommendations: string[];
|
|
71
|
+
}
|
|
72
|
+
export declare function identifyGaps(threatProfile: string, sourceType?: 'sigma' | 'splunk_escu' | 'elastic'): GapAnalysis;
|
|
73
|
+
export interface DetectionSuggestion {
|
|
74
|
+
technique_id: string;
|
|
75
|
+
existing_detections: Array<{
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
source: string;
|
|
79
|
+
}>;
|
|
80
|
+
data_sources_needed: string[];
|
|
81
|
+
detection_ideas: string[];
|
|
82
|
+
}
|
|
83
|
+
export declare function suggestDetections(techniqueId: string, sourceType?: 'sigma' | 'splunk_escu' | 'elastic'): DetectionSuggestion;
|
|
84
|
+
export interface NavigatorLayerOptions {
|
|
85
|
+
name: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
source_type?: 'sigma' | 'splunk_escu' | 'elastic';
|
|
88
|
+
tactic?: string;
|
|
89
|
+
severity?: string;
|
|
90
|
+
}
|
|
91
|
+
export declare function generateNavigatorLayer(options: NavigatorLayerOptions): object;
|