agentic-threat-hunting-framework 0.2.3__py3-none-any.whl → 0.2.4__py3-none-any.whl
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.
- {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/METADATA +1 -1
- agentic_threat_hunting_framework-0.2.4.dist-info/RECORD +47 -0
- athf/__version__.py +1 -1
- athf/cli.py +1 -1
- athf/commands/hunt.py +1 -3
- athf/commands/init.py +45 -0
- athf/commands/similar.py +2 -2
- athf/data/__init__.py +14 -0
- athf/data/docs/CHANGELOG.md +147 -0
- athf/data/docs/CLI_REFERENCE.md +1797 -0
- athf/data/docs/INSTALL.md +594 -0
- athf/data/docs/README.md +31 -0
- athf/data/docs/environment.md +256 -0
- athf/data/docs/getting-started.md +419 -0
- athf/data/docs/level4-agentic-workflows.md +480 -0
- athf/data/docs/lock-pattern.md +149 -0
- athf/data/docs/maturity-model.md +400 -0
- athf/data/docs/why-athf.md +44 -0
- athf/data/hunts/FORMAT_GUIDELINES.md +507 -0
- athf/data/hunts/H-0001.md +453 -0
- athf/data/hunts/H-0002.md +436 -0
- athf/data/hunts/H-0003.md +546 -0
- athf/data/hunts/README.md +231 -0
- athf/data/integrations/MCP_CATALOG.md +45 -0
- athf/data/integrations/README.md +129 -0
- athf/data/integrations/quickstart/splunk.md +162 -0
- athf/data/knowledge/hunting-knowledge.md +2375 -0
- athf/data/prompts/README.md +172 -0
- athf/data/prompts/ai-workflow.md +581 -0
- athf/data/prompts/basic-prompts.md +316 -0
- athf/data/templates/HUNT_LOCK.md +228 -0
- agentic_threat_hunting_framework-0.2.3.dist-info/RECORD +0 -23
- {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/WHEEL +0 -0
- {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/entry_points.txt +0 -0
- {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/licenses/LICENSE +0 -0
- {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# Hunt Directory
|
|
2
|
+
|
|
3
|
+
This folder contains your threat hunting investigations using the **LOCK methodology** (Learn-Observe-Check-Keep) with **ABLE scoping** (Actor-Behavior-Location-Evidence).
|
|
4
|
+
|
|
5
|
+
For template structure details, see [FORMAT_GUIDELINES.md](FORMAT_GUIDELINES.md).
|
|
6
|
+
|
|
7
|
+
## File Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
hunts/
|
|
11
|
+
├── H-0001.md ← macOS Data Collection via AppleScript Detection (T1005)
|
|
12
|
+
├── H-0002.md ← Linux Crontab Persistence Detection (T1053.003)
|
|
13
|
+
├── H-0003.md ← AWS Lambda Persistence Detection (T1546.004)
|
|
14
|
+
└── H-####.md ← Your next hunt
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Each file is a complete hunt from planning through execution results.
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
### 1. Create a New Hunt
|
|
22
|
+
|
|
23
|
+
**Using CLI (Recommended):**
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Interactive mode - prompts you for details
|
|
27
|
+
athf hunt new
|
|
28
|
+
|
|
29
|
+
# Or specify details directly
|
|
30
|
+
athf hunt new --technique T1110.001 --title "SSH Brute Force Detection" --platform linux
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Manual Method (Alternative):**
|
|
34
|
+
|
|
35
|
+
Copy the template and fill it out:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
cp ../templates/HUNT_LOCK.md hunts/H-0004.md
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Either way, start with the LEARN section:**
|
|
42
|
+
|
|
43
|
+
- Write your hypothesis
|
|
44
|
+
- Fill out ABLE scoping table (Actor, Behavior, Location, Evidence)
|
|
45
|
+
- Add threat intel and MITRE ATT&CK context
|
|
46
|
+
|
|
47
|
+
Set status to **Planning** while developing queries.
|
|
48
|
+
|
|
49
|
+
### 2. Execute the Hunt
|
|
50
|
+
|
|
51
|
+
Update the same file as you run your hunt:
|
|
52
|
+
|
|
53
|
+
- Change status from **Planning** → **In Progress**
|
|
54
|
+
- Fill out **CHECK** section with data source details
|
|
55
|
+
- Add your queries and results
|
|
56
|
+
- Document what worked and what didn't
|
|
57
|
+
|
|
58
|
+
### 3. Capture Results
|
|
59
|
+
|
|
60
|
+
Complete the **KEEP** section:
|
|
61
|
+
|
|
62
|
+
- Executive summary of findings
|
|
63
|
+
- True positives / false positives / suspicious events
|
|
64
|
+
- Lessons learned
|
|
65
|
+
- Follow-up actions and new hunt ideas
|
|
66
|
+
|
|
67
|
+
Change status to **Completed** when done.
|
|
68
|
+
|
|
69
|
+
### 4. Iterate
|
|
70
|
+
|
|
71
|
+
Next time you hunt the same behavior:
|
|
72
|
+
|
|
73
|
+
- Open the same H-####.md file
|
|
74
|
+
- Update queries based on lessons learned
|
|
75
|
+
- Re-run and update findings
|
|
76
|
+
- Keep refining
|
|
77
|
+
|
|
78
|
+
The file becomes your evolving playbook for that technique.
|
|
79
|
+
|
|
80
|
+
## Searching Past Hunts
|
|
81
|
+
|
|
82
|
+
### Using AI Assistants (Level 2+)
|
|
83
|
+
|
|
84
|
+
If you're using Claude Code or similar AI tools, just ask:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
"Have we hunted macOS data collection before?"
|
|
88
|
+
"What lessons did we learn from persistence hunts?"
|
|
89
|
+
"Find hunts that detected true positives"
|
|
90
|
+
"Show me all Linux persistence hunts"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The AI will search the hunts/ folder and summarize findings.
|
|
94
|
+
|
|
95
|
+
### CLI Search (Recommended)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Find hunts by MITRE technique
|
|
99
|
+
athf hunt list --technique T1110.001
|
|
100
|
+
|
|
101
|
+
# Find by behavior (full-text search)
|
|
102
|
+
athf hunt search "brute force"
|
|
103
|
+
|
|
104
|
+
# Find by technology
|
|
105
|
+
athf hunt search "powershell"
|
|
106
|
+
|
|
107
|
+
# See completed hunts
|
|
108
|
+
athf hunt list --status completed
|
|
109
|
+
|
|
110
|
+
# Get hunt statistics
|
|
111
|
+
athf hunt stats
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Manual Grep (Fallback)
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Find hunts by MITRE technique
|
|
118
|
+
grep -l "T1110.001" hunts/H-*.md
|
|
119
|
+
|
|
120
|
+
# Find by behavior
|
|
121
|
+
grep -i "brute force" hunts/H-*.md
|
|
122
|
+
|
|
123
|
+
# Find by technology
|
|
124
|
+
grep -i "powershell" hunts/H-*.md
|
|
125
|
+
|
|
126
|
+
# See completed hunts
|
|
127
|
+
grep "Status.*Completed" hunts/H-*.md
|
|
128
|
+
|
|
129
|
+
# Learn from past lessons
|
|
130
|
+
grep "Lessons Learned" -A 5 hunts/H-*.md
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Hunt Status Tracking
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# List all hunts
|
|
137
|
+
ls hunts/H-*.md
|
|
138
|
+
|
|
139
|
+
# Count total hunts
|
|
140
|
+
ls hunts/H-*.md | wc -l
|
|
141
|
+
|
|
142
|
+
# Find in-progress hunts
|
|
143
|
+
grep "Status.*In Progress" hunts/H-*.md
|
|
144
|
+
|
|
145
|
+
# Find hunts that need follow-up
|
|
146
|
+
grep "Follow-up Actions" -A 10 hunts/H-*.md | grep "\[ \]"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Level 3: MCP Integration
|
|
150
|
+
|
|
151
|
+
At Level 3, you can connect MCPs to execute hunts directly through Claude.
|
|
152
|
+
|
|
153
|
+
### What are MCPs?
|
|
154
|
+
|
|
155
|
+
MCP (Model Context Protocol) servers let Claude interact with your security tools:
|
|
156
|
+
|
|
157
|
+
- Execute Splunk queries
|
|
158
|
+
- Analyze results automatically
|
|
159
|
+
- Create tickets with findings
|
|
160
|
+
- Enrich data with threat intel
|
|
161
|
+
|
|
162
|
+
### Example Workflow
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
User: "Run hunt H-0001"
|
|
166
|
+
|
|
167
|
+
Claude:
|
|
168
|
+
1. Reads H-0001.md hypothesis and queries
|
|
169
|
+
2. Executes Splunk query via MCP
|
|
170
|
+
3. Analyzes results and identifies TPs/FPs
|
|
171
|
+
4. Updates hunt file with findings
|
|
172
|
+
5. Creates tickets for true positives
|
|
173
|
+
|
|
174
|
+
"Hunt completed. Found 3 brute force attempts. Created INC-2847."
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Getting Started with MCPs
|
|
178
|
+
|
|
179
|
+
1. **Setup guide:** [../integrations/README.md](../integrations/README.md)
|
|
180
|
+
2. **Splunk walkthrough:** [../integrations/MCP_CATALOG.md](../integrations/MCP_CATALOG.md)
|
|
181
|
+
3. **Splunk quickstart:** [../integrations/quickstart/splunk.md](../integrations/quickstart/splunk.md)
|
|
182
|
+
|
|
183
|
+
### Time Savings
|
|
184
|
+
|
|
185
|
+
**Without MCPs (Level 2):**
|
|
186
|
+
|
|
187
|
+
- Manual query execution: ~10 minutes
|
|
188
|
+
- Copy/paste results: ~5 minutes
|
|
189
|
+
- Analysis and documentation: ~25 minutes
|
|
190
|
+
- Ticket creation: ~5 minutes
|
|
191
|
+
- **Total:** ~45 minutes per hunt
|
|
192
|
+
|
|
193
|
+
**With MCPs (Level 3):**
|
|
194
|
+
|
|
195
|
+
- Claude executes and analyzes automatically
|
|
196
|
+
- Results documented in hunt file
|
|
197
|
+
- Tickets created with full context
|
|
198
|
+
- **Total:** ~5 minutes per hunt
|
|
199
|
+
|
|
200
|
+
## Tips
|
|
201
|
+
|
|
202
|
+
**Creating Hunts:**
|
|
203
|
+
|
|
204
|
+
- Start with ABLE scoping - be specific about Evidence (log sources, key fields, examples)
|
|
205
|
+
- Actor is optional - focus on Behavior first
|
|
206
|
+
- Use clear MITRE ATT&CK technique IDs in titles
|
|
207
|
+
|
|
208
|
+
**Executing Hunts:**
|
|
209
|
+
|
|
210
|
+
- Document query iterations - show what didn't work and why
|
|
211
|
+
- Be honest about false positives - they're learning opportunities
|
|
212
|
+
- Capture telemetry gaps for engineering follow-up
|
|
213
|
+
|
|
214
|
+
**Refining Hunts:**
|
|
215
|
+
|
|
216
|
+
- Update the same file as you iterate
|
|
217
|
+
- Keep old queries (comment them out) to show evolution
|
|
218
|
+
- Link related hunts in Follow-up Hunts section
|
|
219
|
+
|
|
220
|
+
**Status Management:**
|
|
221
|
+
|
|
222
|
+
- **Planning** = Developing hypothesis and queries
|
|
223
|
+
- **In Progress** = Actively executing and collecting data
|
|
224
|
+
- **Completed** = Results documented, lessons captured
|
|
225
|
+
|
|
226
|
+
## Example Hunts
|
|
227
|
+
|
|
228
|
+
- [H-0001.md](H-0001.md) - macOS Data Collection via AppleScript Detection (T1005, T1059.002, T1555.003)
|
|
229
|
+
- [H-0002.md](H-0002.md) - Linux Crontab Persistence Detection (T1053.003)
|
|
230
|
+
- [H-0003.md](H-0003.md) - AWS Lambda Persistence Detection (T1546.004, T1098)
|
|
231
|
+
- [FORMAT_GUIDELINES.md](FORMAT_GUIDELINES.md) - Template structure reference
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# MCP Catalog for Threat Hunting
|
|
2
|
+
|
|
3
|
+
You'll need to **do your own research** to find MCP servers for your organization's security tools. This catalog walks through **Splunk as an example** to demonstrate the process of integrating an MCP server with Claude Code for threat hunting workflows.
|
|
4
|
+
|
|
5
|
+
## Splunk Integration Walkthrough
|
|
6
|
+
|
|
7
|
+
**Transform your workflow:** Claude executes Splunk queries directly and analyzes results - no more copy-paste between tools.
|
|
8
|
+
|
|
9
|
+
**Official MCP:** [Splunkbase app 7931](https://splunkbase.splunk.com/app/7931)
|
|
10
|
+
|
|
11
|
+
**Complete setup guide:** [quickstart/splunk.md](quickstart/splunk.md) - 4 steps to get Splunk MCP working, includes troubleshooting and usage examples
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## After You Complete the Splunk Example
|
|
16
|
+
|
|
17
|
+
Once you understand how MCP integration works through the Splunk walkthrough, you can find MCPs for your other security tools:
|
|
18
|
+
|
|
19
|
+
**Where to look:**
|
|
20
|
+
|
|
21
|
+
- Check vendor GitHub repositories (e.g., <https://github.com/elastic>, <https://github.com/microsoft>)
|
|
22
|
+
- Search the official MCP servers collection: <https://github.com/modelcontextprotocol/servers>
|
|
23
|
+
- Look for vendor-published MCPs on their documentation sites
|
|
24
|
+
- Search GitHub for "[tool-name] mcp server"
|
|
25
|
+
|
|
26
|
+
**Verify before use:**
|
|
27
|
+
|
|
28
|
+
- Is it from the official vendor or a trusted source?
|
|
29
|
+
- Does it have active maintenance and community support?
|
|
30
|
+
- Does it fit your security and compliance requirements?
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## MCP Development Resources
|
|
35
|
+
|
|
36
|
+
Want to build an MCP for your security tool?
|
|
37
|
+
|
|
38
|
+
- **MCP Documentation:** <https://modelcontextprotocol.io/docs>
|
|
39
|
+
- **Python Quickstart:** <https://modelcontextprotocol.io/quickstart/server>
|
|
40
|
+
- **Example MCPs:** <https://github.com/modelcontextprotocol/servers>
|
|
41
|
+
- **Claude Code Integration:** <https://docs.claude.com/claude-code/mcp>
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
**Last Updated:** 2025-01-11
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Level 3: Generative - Bring Your Own MCP
|
|
2
|
+
|
|
3
|
+
At Level 3, you extend Claude Code's capabilities by connecting MCP (Model Context Protocol) servers for the security tools you already use. This transforms the LOCK workflow from manual investigation to tool-integrated analysis.
|
|
4
|
+
|
|
5
|
+
## What Is Level 3?
|
|
6
|
+
|
|
7
|
+
**Level 1 (Documented):** You manually document hunts in markdown files
|
|
8
|
+
**Level 2 (Searchable):** Claude reads past hunts, applies expert hunting frameworks from knowledge/hunting-knowledge.md, and uses AGENTS.md for environmental context
|
|
9
|
+
**Level 3 (Generative):** Claude executes queries, enriches data, and creates tickets through MCPs
|
|
10
|
+
|
|
11
|
+
At Level 3, Claude doesn't just read about your tools - it **uses** them.
|
|
12
|
+
|
|
13
|
+
## What Does Integration Mean?
|
|
14
|
+
|
|
15
|
+
Instead of copying queries and results back and forth between Claude and your tools, **MCPs let Claude directly interact with your security stack**.
|
|
16
|
+
|
|
17
|
+
**The transformation:**
|
|
18
|
+
|
|
19
|
+
- **Before:** You describe your tools to Claude, manually run queries, paste results back
|
|
20
|
+
- **After:** Claude executes queries, analyzes data, and takes actions through tool APIs
|
|
21
|
+
|
|
22
|
+
**We demonstrate this with Splunk**, but the same principles apply to any tool with an MCP server.
|
|
23
|
+
|
|
24
|
+
## How MCPs Enhance the LOCK Workflow
|
|
25
|
+
|
|
26
|
+
### Learn Phase
|
|
27
|
+
|
|
28
|
+
**Without MCP:** Copy-paste threat intel into Claude
|
|
29
|
+
**With MCP:** Claude queries threat intel platforms directly for TTP context
|
|
30
|
+
|
|
31
|
+
### Observe Phase
|
|
32
|
+
|
|
33
|
+
**Without MCP:** Manually list expected behaviors
|
|
34
|
+
**With MCP:** Claude queries asset inventory to understand your environment
|
|
35
|
+
|
|
36
|
+
### Check Phase
|
|
37
|
+
|
|
38
|
+
**Without MCP:** Copy queries into Splunk manually
|
|
39
|
+
**With MCP:** Claude executes queries and analyzes results
|
|
40
|
+
|
|
41
|
+
### Keep Phase
|
|
42
|
+
|
|
43
|
+
**Without MCP:** Manually create Jira tickets
|
|
44
|
+
**With MCP:** Claude auto-creates tickets with findings
|
|
45
|
+
|
|
46
|
+
## Getting Started
|
|
47
|
+
|
|
48
|
+
Ready to try Level 3? We provide a complete Splunk MCP integration walkthrough:
|
|
49
|
+
|
|
50
|
+
**[Start the Splunk walkthrough →](MCP_CATALOG.md)**
|
|
51
|
+
|
|
52
|
+
Once you complete it, you'll understand how to integrate MCPs for any security tool.
|
|
53
|
+
|
|
54
|
+
## Quick Example
|
|
55
|
+
|
|
56
|
+
### Without MCP Integration (Level 2)
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
You: "Search for SSH brute force attempts in Splunk"
|
|
60
|
+
Claude: "Here's a Splunk query you can run:
|
|
61
|
+
index=linux_secure action=failure | stats count by src_ip"
|
|
62
|
+
You: [Copies query to Splunk, runs it, pastes results back]
|
|
63
|
+
Claude: "Based on those results, I see 3 high-volume IPs..."
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### With MCP Integration (Level 3)
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
You: "Search for SSH brute force attempts"
|
|
70
|
+
Claude: [Executes Splunk query via MCP]
|
|
71
|
+
"I found 3 source IPs with high failure rates:
|
|
72
|
+
- 203.0.113.45 (127 attempts)
|
|
73
|
+
- 198.51.100.22 (89 attempts)
|
|
74
|
+
- 192.0.2.15 (67 attempts)
|
|
75
|
+
|
|
76
|
+
203.0.113.45 shows sustained activity over 2 hours. Should I pivot
|
|
77
|
+
to see what accounts were targeted?"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The difference: **Claude executes queries and analyzes results directly, no copy-paste.**
|
|
81
|
+
|
|
82
|
+
## Security Considerations
|
|
83
|
+
|
|
84
|
+
### Permissions
|
|
85
|
+
|
|
86
|
+
MCPs run with the credentials you provide. Follow the principle of least privilege:
|
|
87
|
+
|
|
88
|
+
- **Read-only access** for SIEMs and asset inventory
|
|
89
|
+
- **Create-only access** for ticketing systems
|
|
90
|
+
- **No destructive permissions** (delete, modify critical data)
|
|
91
|
+
|
|
92
|
+
### Guardrails
|
|
93
|
+
|
|
94
|
+
Always maintain human oversight:
|
|
95
|
+
|
|
96
|
+
- **Queries should be bounded** (time range, result limits)
|
|
97
|
+
- **No automatic remediation** without approval
|
|
98
|
+
- **Audit all MCP actions** in logs
|
|
99
|
+
- **Review generated queries** before execution
|
|
100
|
+
|
|
101
|
+
### Credential Management
|
|
102
|
+
|
|
103
|
+
- **Never commit credentials** to your ATHF repository
|
|
104
|
+
- **Use environment variables** for API keys
|
|
105
|
+
- **Rotate keys regularly** per your security policy
|
|
106
|
+
- **Use Claude Code's built-in permission system** to approve/deny MCP usage
|
|
107
|
+
|
|
108
|
+
## What's Next?
|
|
109
|
+
|
|
110
|
+
**[Start the Splunk MCP walkthrough →](MCP_CATALOG.md)**
|
|
111
|
+
|
|
112
|
+
## Level 4 Preview
|
|
113
|
+
|
|
114
|
+
Once you have MCP integrations working, Level 4 (Agentic) becomes possible. Instead of you asking Claude to run hunts, **autonomous agents** can:
|
|
115
|
+
|
|
116
|
+
- Monitor CTI feeds and generate draft hunts
|
|
117
|
+
- Execute scheduled hunts automatically
|
|
118
|
+
- Enrich findings with threat intel
|
|
119
|
+
- Create tickets for analyst review
|
|
120
|
+
|
|
121
|
+
Level 3 gives Claude the **tools**. Level 4 gives it **agency**.
|
|
122
|
+
|
|
123
|
+
## Support
|
|
124
|
+
|
|
125
|
+
- **MCP Documentation:** <https://modelcontextprotocol.io>
|
|
126
|
+
- **Claude Code MCP Guide:** <https://docs.claude.com/claude-code/mcp>
|
|
127
|
+
- **ATHF Issues:** <https://github.com/Nebulock-Inc/agentic-threat-hunting-framework/issues>
|
|
128
|
+
|
|
129
|
+
Happy hunting!
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Quickstart: Splunk MCP Integration
|
|
2
|
+
|
|
3
|
+
This guide shows how to connect Claude Code to Splunk Enterprise or Splunk Cloud via the official Splunk MCP Server.
|
|
4
|
+
|
|
5
|
+
## What You Get
|
|
6
|
+
|
|
7
|
+
Once configured, Claude Code can:
|
|
8
|
+
|
|
9
|
+
- **Query Splunk:** Run SPL searches and get results
|
|
10
|
+
- **Generate SPL:** AI-assisted query generation
|
|
11
|
+
- **Analyze Data:** Get insights from Splunk logs
|
|
12
|
+
- **Browse Indexes:** List and explore available data sources
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- Splunk Enterprise 8.0+ or Splunk Cloud with admin access
|
|
17
|
+
- Claude Code installed
|
|
18
|
+
|
|
19
|
+
## Setup Steps
|
|
20
|
+
|
|
21
|
+
### Step 1: Install Splunk MCP Server App
|
|
22
|
+
|
|
23
|
+
1. Download the official **Splunk MCP Server** app from [Splunkbase](https://splunkbase.splunk.com/app/7931)
|
|
24
|
+
2. Install it on your Splunk instance via **Settings → Apps → Install app from file**
|
|
25
|
+
3. Grant the `mcp_tool_execute` capability to your user role
|
|
26
|
+
|
|
27
|
+
**Documentation:** <https://help.splunk.com/en/splunk-cloud-platform/mcp-server-for-splunk-platform/>
|
|
28
|
+
|
|
29
|
+
### Step 2: Create API Token
|
|
30
|
+
|
|
31
|
+
1. Log into Splunk Web
|
|
32
|
+
2. Navigate to **Settings → Tokens**
|
|
33
|
+
3. Click **New Token**
|
|
34
|
+
4. **Set Audience to `mcp`** ⚠️ **CRITICAL** - Must be exactly `mcp`
|
|
35
|
+
5. Set expiration per your security policy
|
|
36
|
+
6. Copy the generated token
|
|
37
|
+
|
|
38
|
+
**Important:** If audience is not set to `mcp`, connection will fail with 403 error.
|
|
39
|
+
|
|
40
|
+
### Step 3: Configure Claude Code
|
|
41
|
+
|
|
42
|
+
Edit your `~/.claude.json` and add the Splunk MCP server configuration to the project section:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"projects": {
|
|
47
|
+
"/path/to/your/project": {
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"splunk-mcp-server": {
|
|
50
|
+
"command": "npx",
|
|
51
|
+
"args": [
|
|
52
|
+
"-y",
|
|
53
|
+
"mcp-remote",
|
|
54
|
+
"https://your-splunk-host.com:8089/services/mcp",
|
|
55
|
+
"--header",
|
|
56
|
+
"Authorization: Bearer YOUR_TOKEN_HERE"
|
|
57
|
+
],
|
|
58
|
+
"env": {
|
|
59
|
+
"NODE_TLS_REJECT_UNAUTHORIZED": "0"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Configuration:**
|
|
69
|
+
|
|
70
|
+
- Replace `your-splunk-host.com` with your Splunk server IP or hostname
|
|
71
|
+
- Replace `YOUR_TOKEN_HERE` with the token from Step 2
|
|
72
|
+
- Set `NODE_TLS_REJECT_UNAUTHORIZED: "0"` if using self-signed SSL certificates (testing only)
|
|
73
|
+
- For production with valid SSL certificates, remove the `env` section
|
|
74
|
+
|
|
75
|
+
**Security:** Store tokens in `.env` files, not directly in `.claude.json`.
|
|
76
|
+
|
|
77
|
+
### Step 4: Verify Connection
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Start Claude Code in your project directory
|
|
81
|
+
cd /path/to/your/project
|
|
82
|
+
claude
|
|
83
|
+
|
|
84
|
+
# Verify the connection
|
|
85
|
+
claude mcp list
|
|
86
|
+
# Expected: splunk-mcp-server ... ✓ Connected
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**That's it!** The Splunk MCP tools are now available.
|
|
90
|
+
|
|
91
|
+
## Usage Examples
|
|
92
|
+
|
|
93
|
+
Simple prompts that work once Splunk MCP is configured:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
"Show me all available Splunk indexes"
|
|
97
|
+
|
|
98
|
+
"Search Splunk for failed SSH attempts in the last 24 hours"
|
|
99
|
+
|
|
100
|
+
"Search for PowerShell executions in the last 4 hours"
|
|
101
|
+
|
|
102
|
+
"Generate a SPL query to find brute force authentication attempts"
|
|
103
|
+
|
|
104
|
+
"Run the query from hunt hypothesis H-0001"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Claude will automatically:
|
|
108
|
+
|
|
109
|
+
- Execute SPL queries
|
|
110
|
+
- Parse and format results
|
|
111
|
+
- Explain findings
|
|
112
|
+
- Suggest follow-up investigations
|
|
113
|
+
|
|
114
|
+
## Available Tools
|
|
115
|
+
|
|
116
|
+
The Splunk MCP provides these tools:
|
|
117
|
+
|
|
118
|
+
- **`run_splunk_query`** - Execute SPL searches
|
|
119
|
+
- **`get_indexes`** - List available indexes
|
|
120
|
+
- **`get_splunk_info`** - Get Splunk instance information
|
|
121
|
+
- **`generate_spl`** - AI-assisted query generation (requires Splunk AI Assistant)
|
|
122
|
+
- **`explain_spl`** - Explain what SPL queries do
|
|
123
|
+
- **`optimize_spl`** - Optimize existing queries
|
|
124
|
+
- **`get_knowledge_objects`** - Access saved searches and lookups
|
|
125
|
+
|
|
126
|
+
## Security Considerations
|
|
127
|
+
|
|
128
|
+
**Important:** Ensure you follow your organization's security policies and best practices when deploying this integration. Consider:
|
|
129
|
+
|
|
130
|
+
- Implementing least-privilege access controls for the MCP user
|
|
131
|
+
- Properly securing and rotating API tokens
|
|
132
|
+
- Monitoring and auditing MCP server usage
|
|
133
|
+
- Following your organization's SSL/TLS certificate policies
|
|
134
|
+
- Storing credentials securely (not in version control)
|
|
135
|
+
|
|
136
|
+
Consult the [official Splunk MCP documentation](https://help.splunk.com/en/splunk-cloud-platform/mcp-server-for-splunk-platform/) and your security team for specific requirements.
|
|
137
|
+
|
|
138
|
+
## Troubleshooting
|
|
139
|
+
|
|
140
|
+
**403 Error:**
|
|
141
|
+
Check token audience is set to `mcp` (not `search` or `claude-code-mcp`)
|
|
142
|
+
|
|
143
|
+
**Connection Failed:**
|
|
144
|
+
|
|
145
|
+
- Verify port 8089 is accessible
|
|
146
|
+
- For self-signed certs, add `NODE_TLS_REJECT_UNAUTHORIZED: "0"` to env
|
|
147
|
+
|
|
148
|
+
**Permission Denied:**
|
|
149
|
+
Grant user the `mcp_tool_execute` capability and index access
|
|
150
|
+
|
|
151
|
+
**Token Expired:**
|
|
152
|
+
Create a new token in Splunk Web → Settings → Tokens
|
|
153
|
+
|
|
154
|
+
## Resources
|
|
155
|
+
|
|
156
|
+
- **Splunk MCP Server App:** <https://splunkbase.splunk.com/app/7931>
|
|
157
|
+
- **Official Documentation:** <https://help.splunk.com/en/splunk-cloud-platform/mcp-server-for-splunk-platform/>
|
|
158
|
+
- **SPL Reference:** <https://docs.splunk.com/Documentation/Splunk/latest/SearchReference>
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
**Questions?** Open an issue in the ATHF repo or check the official Splunk MCP documentation.
|