agentic-threat-hunting-framework 0.2.2__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.
Files changed (38) hide show
  1. {agentic_threat_hunting_framework-0.2.2.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/METADATA +1 -1
  2. agentic_threat_hunting_framework-0.2.4.dist-info/RECORD +47 -0
  3. athf/__version__.py +1 -1
  4. athf/cli.py +1 -1
  5. athf/commands/context.py +29 -15
  6. athf/commands/hunt.py +1 -3
  7. athf/commands/init.py +45 -0
  8. athf/commands/similar.py +2 -2
  9. athf/core/hunt_manager.py +7 -0
  10. athf/data/__init__.py +14 -0
  11. athf/data/docs/CHANGELOG.md +147 -0
  12. athf/data/docs/CLI_REFERENCE.md +1797 -0
  13. athf/data/docs/INSTALL.md +594 -0
  14. athf/data/docs/README.md +31 -0
  15. athf/data/docs/environment.md +256 -0
  16. athf/data/docs/getting-started.md +419 -0
  17. athf/data/docs/level4-agentic-workflows.md +480 -0
  18. athf/data/docs/lock-pattern.md +149 -0
  19. athf/data/docs/maturity-model.md +400 -0
  20. athf/data/docs/why-athf.md +44 -0
  21. athf/data/hunts/FORMAT_GUIDELINES.md +507 -0
  22. athf/data/hunts/H-0001.md +453 -0
  23. athf/data/hunts/H-0002.md +436 -0
  24. athf/data/hunts/H-0003.md +546 -0
  25. athf/data/hunts/README.md +231 -0
  26. athf/data/integrations/MCP_CATALOG.md +45 -0
  27. athf/data/integrations/README.md +129 -0
  28. athf/data/integrations/quickstart/splunk.md +162 -0
  29. athf/data/knowledge/hunting-knowledge.md +2375 -0
  30. athf/data/prompts/README.md +172 -0
  31. athf/data/prompts/ai-workflow.md +581 -0
  32. athf/data/prompts/basic-prompts.md +316 -0
  33. athf/data/templates/HUNT_LOCK.md +228 -0
  34. agentic_threat_hunting_framework-0.2.2.dist-info/RECORD +0 -23
  35. {agentic_threat_hunting_framework-0.2.2.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/WHEEL +0 -0
  36. {agentic_threat_hunting_framework-0.2.2.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/entry_points.txt +0 -0
  37. {agentic_threat_hunting_framework-0.2.2.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/licenses/LICENSE +0 -0
  38. {agentic_threat_hunting_framework-0.2.2.dist-info → agentic_threat_hunting_framework-0.2.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,400 @@
1
+ # The Five Levels of Agentic Hunting
2
+
3
+ ATHF defines a simple maturity model for evolving your hunting program. Each level builds on the previous one.
4
+
5
+ **Most teams will live at Levels 1–2. Everything beyond that is optional maturity.**
6
+
7
+ ![The Five Levels of Agentic Hunting](../../../assets/athf_fivelevels.png)
8
+
9
+ ## Overview
10
+
11
+ | Level | Capability | What You Get | Time to Implement |
12
+ |-------|-----------|--------------|-------------------|
13
+ | **0** | Ad-hoc | Hunts exist in Slack, tickets, or analyst notes | Current state |
14
+ | **1** | Documented | Persistent hunt records using LOCK | 1 day |
15
+ | **2** | Searchable | AI reads and recalls your hunts | 1 week |
16
+ | **3** | Generative | AI executes queries via MCP tools | 2-4 weeks |
17
+ | **4** | Agentic | Autonomous agents monitor and act | 1-3 months |
18
+
19
+ ---
20
+
21
+ ## How ATHF CLI Commands Support Each Level
22
+
23
+ **Important:** The CLI is optional. ATHF is markdown-first - you can achieve all maturity levels using just markdown files and your AI assistant. The CLI provides convenience commands for common workflows, but the framework structure works without it.
24
+
25
+ **If you choose to use the CLI**, it provides consistent commands across all maturity levels. What changes is **who uses them** and **how they're used**:
26
+
27
+ | Level | Who Uses CLI | How It's Used | Example |
28
+ |-------|--------------|---------------|---------|
29
+ | **1** | You (manually) | Create and validate hunts | `athf hunt new` creates structured hunt files<br>OR manually create markdown files |
30
+ | **2** | You + AI (interactive) | AI searches hunts, suggests refinements | AI uses `athf hunt search` to recall past work<br>OR AI searches markdown files directly |
31
+ | **3** | AI (on your behalf) | AI executes queries and documents results | AI uses MCP tools + `athf hunt new` to create hunts<br>OR AI writes markdown files directly |
32
+ | **4** | Autonomous agents | Agents coordinate through CLI | CTI agent uses `athf hunt new`, validator uses `athf hunt validate`<br>OR agents manipulate markdown files |
33
+
34
+ **Key insights:**
35
+ - The CLI doesn't change between levels - it becomes building blocks for increasingly sophisticated automation
36
+ - The framework structure (hunts/, LOCK pattern, AGENTS.md) is what enables AI assistance, not the CLI
37
+ - Choose CLI for convenience, skip it if you prefer direct markdown manipulation
38
+
39
+ ---
40
+
41
+ ## Level 1: Documented Hunts
42
+
43
+ **What you get:**
44
+
45
+ - **Persistent hunt records** that survive beyond Slack threads
46
+ - **Standardized structure** using the LOCK pattern
47
+ - **Knowledge transfer** for new team members
48
+ - **Searchable history** of what's been tested
49
+
50
+ You document hunts using LOCK in markdown.
51
+
52
+ ### Example Hunt File
53
+
54
+ **File:** `hunts/H-0031.md`
55
+
56
+ ```markdown
57
+ # H-0031: Detecting Remote Management Abuse via PowerShell and WMI (TA0002 / T1028 / T1047)
58
+
59
+ **Learn**
60
+ Incident response from a recent ransomware case showed adversaries using PowerShell remoting and WMI to move laterally between Windows hosts.
61
+ These techniques often bypass EDR detections that look only for credential theft or file-based artifacts.
62
+ Telemetry sources available: Sysmon (Event IDs 1, 3, 10), Windows Security Logs (Event ID 4624), and EDR process trees.
63
+
64
+ **Observe**
65
+ Adversaries may execute PowerShell commands remotely or invoke WMI for lateral movement using existing admin credentials.
66
+ Suspicious behavior includes PowerShell or wmiprvse.exe processes initiated by non-admin accounts or targeting multiple remote systems in a short time window.
67
+
68
+ **Check**
69
+ index=sysmon OR index=edr
70
+ (EventCode=1 OR EventCode=10)
71
+ | search (Image="*powershell.exe" OR Image="*wmiprvse.exe")
72
+ | stats count dc(DestinationHostname) as unique_targets by User, Computer, CommandLine
73
+ | where unique_targets > 3
74
+ | sort - unique_targets
75
+
76
+ **Keep**
77
+ Detected two accounts showing lateral movement patterns:
78
+ - `svc_backup` executed PowerShell sessions on five hosts in under ten minutes
79
+ - `itadmin-temp` invoked wmiprvse.exe from a workstation instead of a jump server
80
+
81
+ Confirmed `svc_backup` activity as legitimate backup automation.
82
+ Marked `itadmin-temp` as suspicious; account disabled pending review.
83
+
84
+ Next iteration: expand to include remote registry and PSExec telemetry for broader coverage.
85
+ ```
86
+
87
+ ### Benefits
88
+
89
+ When someone new joins the team, they can quickly see what was tested, what was learned, and what should be tried next. This alone prevents redundant hunts and lost context.
90
+
91
+ ### Getting Started at Level 1
92
+
93
+ **Using the CLI (Recommended):**
94
+ ```bash
95
+ # Initialize workspace
96
+ athf init
97
+
98
+ # Create your first hunt
99
+ athf hunt new --technique T1003.001 --title "LSASS Credential Dumping"
100
+
101
+ # Validate structure
102
+ athf hunt validate
103
+
104
+ # View your hunt catalog
105
+ athf hunt list
106
+ ```
107
+
108
+ **Without the CLI (Pure Markdown):**
109
+ 1. Copy a hunt template from [templates/](../templates/)
110
+ 2. Fill out the LOCK sections
111
+ 3. Save as `hunts/H-XXXX.md`
112
+ 4. Commit to your repository
113
+
114
+ > **Note:** Both paths are equally valid. The CLI provides convenience, but the markdown-first approach gives you complete control. Many teams prefer pure markdown for simplicity and transparency. Choose what works best for your workflow.
115
+
116
+ **You can be operational at Level 1 within a day.**
117
+
118
+ ---
119
+
120
+ ## Level 2: Searchable Memory
121
+
122
+ **What you get:**
123
+
124
+ - **AI reads your repo** and understands your hunt history
125
+ - **AI recalls past hunts** when you ask questions
126
+ - **AI gives contextually correct suggestions** based on your environment
127
+ - **Instant context retrieval** - seconds instead of minutes
128
+
129
+ At Level 2, you add context files to your repository that provide AI assistants (Claude Code, GitHub Copilot, Cursor) with the knowledge they need to assist effectively.
130
+
131
+ ### Required Context Files
132
+
133
+ #### [AGENTS.md](../../../AGENTS.md)
134
+
135
+ Provides environmental and structural context:
136
+
137
+ - Your repository structure (hunts/, templates/, queries/)
138
+ - Available data sources (SIEM indexes, EDR platforms, network logs)
139
+ - Workflow expectations and guardrails
140
+ - How AI should search past hunts before generating new ones
141
+
142
+ #### [knowledge/hunting-knowledge.md](../knowledge/hunting-knowledge.md)
143
+
144
+ Embeds threat hunting expertise:
145
+
146
+ - Pattern-based hypothesis generation frameworks (TTP-driven, Actor-driven, Behavior-driven, Telemetry Gap-driven)
147
+ - Quality criteria for evaluating hypotheses (falsifiable, scoped, observable, actionable, contextual)
148
+ - Observable-to-TTP mapping guidance
149
+ - Data quality considerations (completeness, timeliness, fidelity, accuracy, consistency)
150
+ - Best practices for working within the LOCK pattern
151
+
152
+ ### What It Enables
153
+
154
+ Once these context files exist, you can open your repo in Claude Code or similar tools and ask:
155
+
156
+ > "What have we learned about T1028?"
157
+
158
+ The AI automatically searches your hunts directory, references past investigations, and suggests refined hypotheses based on lessons learned - applying expert threat hunting frameworks from the knowledge base. What used to take 20 minutes of grepping and copy-pasting now takes under five seconds.
159
+
160
+ **The combination of AGENTS.md (environmental context) and hunting-knowledge.md (domain expertise) transforms AI assistants from generic helpers into informed threat hunting partners.**
161
+
162
+ ![Manual vs. AI-Assisted Content Creation](../../../assets/athf_manual_v_ai.png)
163
+
164
+ ### Getting Started at Level 2
165
+
166
+ 1. Review the included [AGENTS.md](../../../AGENTS.md) template
167
+ 2. Customize it with your environment details
168
+ 3. Review [knowledge/hunting-knowledge.md](../knowledge/hunting-knowledge.md) (already included)
169
+ 4. Open your repo in Claude Code or similar AI assistant
170
+ 5. Start asking questions about your hunts
171
+
172
+ **CLI Commands at Level 2:**
173
+ At this level, you still run commands manually, but AI helps you decide what to run:
174
+ ```bash
175
+ # AI suggests: "Let me search for related hunts first"
176
+ athf hunt search "T1003"
177
+
178
+ # AI suggests: "Check your coverage gaps"
179
+ athf hunt coverage
180
+
181
+ # AI suggests: "Let's see your success rates"
182
+ athf hunt stats
183
+ ```
184
+
185
+ The AI reads your hunt files and provides context-aware suggestions, but you execute the commands.
186
+
187
+ **You can be operational at Level 2 within a week.**
188
+
189
+ ---
190
+
191
+ ## Level 3: Generative Capabilities
192
+
193
+ **What you get:**
194
+
195
+ - **AI executes queries** directly in your SIEM
196
+ - **AI enriches findings** with threat intel lookups
197
+ - **AI creates tickets** in your case management system
198
+ - **AI updates hunt files** with results and commits changes
199
+
200
+ At this stage, you give your AI assistant **tools to interact with your security stack** via MCP (Model Context Protocol) servers. Instead of manually copying queries to Splunk or looking up IOCs in threat intel, Claude does it directly.
201
+
202
+ **Level 3 is about execution. The AI doesn't just suggest queries; it runs them with your tools.**
203
+
204
+ ### Tool Integration
205
+
206
+ Connect MCP servers or APIs for the tools you already use in your security operations:
207
+
208
+ - **SIEM search** (Splunk, Elastic, Chronicle)
209
+ - **Endpoint data** (CrowdStrike, SentinelOne, Microsoft Defender)
210
+ - **Ticket creation** (Jira, ServiceNow, GitHub Issues)
211
+ - **Threat intel queries** (MISP, VirusTotal, AlienVault OTX)
212
+
213
+ **Level 3 is "Bring Your Own Tools"** - you connect MCP servers or APIs for whatever tools you already use.
214
+
215
+ ### Capabilities
216
+
217
+ Your AI Assistant Can:
218
+
219
+ - **Run queries** - Execute hunt queries and retrieve results directly
220
+ - **Enrich findings** - Look up IOCs, correlate threat intelligence, check reputation
221
+ - **Update hunts** - Document findings and commit changes to hunt files
222
+ - **Trigger actions** - Create tickets, generate alerts, update case management
223
+
224
+ ### Simple vs. Advanced Workflows
225
+
226
+ **Simple Example: Without MCP (Level 2)**
227
+
228
+ ```
229
+ You: "Search for SSH brute force attempts"
230
+ Claude: "Here's a Splunk query: index=linux_secure action=failure | stats count by src_ip"
231
+ You: [Copies query to Splunk, runs it, pastes results back]
232
+ Claude: "I see 3 high-volume IPs..."
233
+ ```
234
+
235
+ **With Splunk MCP (Level 3)**
236
+
237
+ ```
238
+ You: "Search for SSH brute force attempts"
239
+ Claude: [Executes Splunk query via MCP]
240
+ "Found 3 source IPs with high failure rates:
241
+ - 203.0.113.45 (127 attempts)
242
+ - 198.51.100.22 (89 attempts)
243
+ - 192.0.2.15 (67 attempts)
244
+
245
+ Let me check CrowdStrike for detections..."
246
+ [Queries CrowdStrike MCP]
247
+ "203.0.113.45 connected to 3 hosts with Qakbot detections.
248
+ Should I create a Jira ticket for investigation?"
249
+ ```
250
+
251
+ **The difference:** Claude executes queries, enriches data, and creates tickets - not just suggests them.
252
+
253
+ ### CLI Integration at Level 3
254
+
255
+ At Level 3, AI uses CLI commands directly as part of workflows:
256
+
257
+ **Example: AI-Driven Hunt Creation**
258
+ ```
259
+ You: "Search for SSH brute force and create a hunt"
260
+
261
+ AI: [Executes Splunk query via MCP]
262
+ [Gets results: 3 high-volume IPs]
263
+ [Uses: athf hunt new --technique T1110.001 --title "SSH Brute Force Detection"]
264
+ [Documents findings in hunt file]
265
+ [Uses: athf hunt validate to check structure]
266
+ "Created H-0087.md documenting SSH brute force activity. Review?"
267
+ ```
268
+
269
+ **The difference:** You direct the workflow, AI executes both MCP tools (Splunk) and CLI commands (athf).
270
+
271
+ ### Getting Started at Level 3
272
+
273
+ 1. Browse the catalog: See [integrations/MCP_CATALOG.md](../integrations/MCP_CATALOG.md)
274
+ 2. Pick your first MCP: Start with Splunk or CrowdStrike
275
+ 3. Follow quickstart guide: [integrations/quickstart/](../integrations/quickstart/)
276
+ 4. Review example hunts: See [hunts/](../hunts/) directory
277
+
278
+ **Detailed workflows:** See [../integrations/README.md](../integrations/README.md) for comprehensive examples
279
+
280
+ ### Success Criteria
281
+
282
+ - Claude **executes** hunt queries instead of just writing them
283
+ - IOCs are **enriched** automatically with threat intel
284
+ - Incident tickets are **created** with full context
285
+ - You focus on **analysis and decision-making**, not manual task execution
286
+
287
+ **Learn more:** [integrations/README.md](../integrations/README.md)
288
+
289
+ ---
290
+
291
+ ## Level 4: Agentic Workflows
292
+
293
+ **What you get:**
294
+
295
+ - **Agents monitor** CTI feeds without your intervention
296
+ - **Agents generate** draft hunts based on new threats
297
+ - **Agents coordinate** through shared LOCK memory
298
+ - **You validate and approve** rather than create from scratch
299
+
300
+ At this stage, you move from **reactive assistance** to **proactive automation**. Instead of asking your AI for help with each task, you deploy autonomous agents that monitor, reason, and act based on objectives you define.
301
+
302
+ The key difference from Level 3: **agents operate autonomously** rather than waiting for your prompts. They detect events, make decisions within guardrails, and coordinate with each other through shared memory (your LOCK-structured hunts).
303
+
304
+ ### Multi-Agent Coordination
305
+
306
+ At Level 4, multiple specialized agents work together:
307
+
308
+ - **CTI Monitor Agent** - Watches threat feeds, identifies relevant TTPs
309
+ - **Hypothesis Generator Agent** - Creates draft hunt files in LOCK format
310
+ - **Validator Agent** - Checks queries against your data sources
311
+ - **Notifier Agent** - Alerts analysts when human review is needed
312
+
313
+ **Detailed workflows:** See [level4-agentic-workflows.md](level4-agentic-workflows.md) for comprehensive examples
314
+
315
+ ### Example Scenario
316
+
317
+ 1. **CTI Monitor Agent** runs every 6 hours, checking threat feeds
318
+ 2. Detects new Qakbot campaign using T1059.003
319
+ 3. Searches past hunts - finds we haven't covered this sub-technique
320
+ 4. **Triggers Hypothesis Generator Agent**
321
+ 5. Generator searches historical hunts for context
322
+ 6. Creates draft hunt `H-0156.md` with LOCK structure
323
+ 7. **Triggers Validator Agent**
324
+ 8. Validator checks query against data sources from `AGENTS.md`
325
+ 9. Flags for human review
326
+ 10. **Triggers Notifier Agent**
327
+ 11. Posts to Slack: "New hunt H-0156 ready for review"
328
+
329
+ **You wake up to:**
330
+ > "3 new draft hunts created overnight based on recent CTI. Ready for your review."
331
+
332
+ ### CLI Commands in Autonomous Workflows
333
+
334
+ At Level 4, agents use CLI commands without your intervention:
335
+
336
+ **Autonomous Agent Workflow:**
337
+ ```bash
338
+ # CTI Monitor Agent (runs every 6 hours)
339
+ athf hunt search "T1059.003" # Check for existing hunts
340
+ # No matches found
341
+
342
+ # Hypothesis Generator Agent (triggered by CTI Monitor)
343
+ athf hunt new \
344
+ --technique T1059.003 \
345
+ --title "Qakbot JavaScript Dropper Detection" \
346
+ --platform windows \
347
+ --non-interactive
348
+
349
+ # Validator Agent (triggered by Generator)
350
+ athf hunt validate H-0156 # Ensure structure is correct
351
+ athf hunt coverage # Update coverage metrics
352
+
353
+ # Notifier Agent (triggered by Validator)
354
+ # Posts to Slack: "H-0156 ready for review"
355
+ ```
356
+
357
+ **The progression:**
358
+ - **Level 1:** You run `athf hunt new` manually
359
+ - **Level 2:** AI suggests when to run `athf hunt new`
360
+ - **Level 3:** AI runs `athf hunt new` when you ask
361
+ - **Level 4:** Agents run `athf hunt new` autonomously based on objectives
362
+
363
+ ### The Maturity Progression
364
+
365
+ - **Level 2:** You ask AI questions, it responds
366
+ - **Level 3:** You direct AI to use tools
367
+ - **Level 4:** Agents work autonomously toward objectives, notify you when human judgment is needed
368
+
369
+ ### Success Criteria
370
+
371
+ - Agents **monitor** CTI feeds without your intervention
372
+ - Agents **generate** draft hunts based on new threats
373
+ - Agents **coordinate** through shared memory (LOCK hunts)
374
+ - You focus on **validating** and **approving** rather than creating from scratch
375
+
376
+ ### Implementation Options
377
+
378
+ Level 4 can be built using various agent frameworks:
379
+
380
+ - **LangGraph** - For building stateful, multi-agent workflows
381
+ - **CrewAI** - For role-based agent collaboration
382
+ - **AutoGen** - For conversational agent patterns
383
+ - **Custom orchestration** - Purpose-built for your environment
384
+
385
+ The key is that **all agents share the same memory layer** - your LOCK-structured hunts - ensuring consistency and enabling true coordination.
386
+
387
+ **Success can look like many things at Level 4.** You might have agents that autonomously execute queries using tools like the Splunk MCP server, or agents that orchestrate multi-step workflows across your security stack. At this stage, you're mature enough to make these architectural decisions based on your team's needs and risk tolerance.
388
+
389
+ ---
390
+
391
+ ## Choosing Your Level
392
+
393
+ **Most teams should start at Level 1 and move to Level 2.** Everything beyond that is optional maturity that depends on your team's needs, risk tolerance, and technical capability.
394
+
395
+ **Level 1:** Operational within a day
396
+ **Level 2:** Operational within a week
397
+ **Level 3:** 2-4 weeks depending on tool availability
398
+ **Level 4:** 1-3 months with custom agent development
399
+
400
+ The framework is designed to be flexible. Use what works for you, modify what doesn't, and skip what isn't relevant.
@@ -0,0 +1,44 @@
1
+ # Why ATHF Exists
2
+
3
+ Most threat hunting programs lose valuable context once a hunt ends. Notes live in Slack or tickets, queries are written once and forgotten, and lessons learned exist only in analysts' heads. When someone asks, "Have we hunted this before?", the answer depends entirely on who remembers.
4
+
5
+ Even AI tools start from zero every time without access to your environment, your data, or your past hunts.
6
+
7
+ **ATHF changes that** by giving your hunts structure, persistence, and context - turning disjointed documentation into a foundation for memory and learning.
8
+
9
+ ## The Problem: Memory Loss
10
+
11
+ Without structured documentation:
12
+
13
+ - **Context disappears** - Hunt notes scattered across Slack, tickets, and personal notes
14
+ - **Queries are forgotten** - Detection logic written once, never reused or refined
15
+ - **Lessons don't transfer** - Knowledge exists only in analysts' heads
16
+ - **AI starts from zero** - Tools can't learn from your environment or past hunts
17
+ - **Teams repeat work** - "Have we hunted this before?" depends on who remembers
18
+
19
+ ## The Solution: Structured Memory
20
+
21
+ ATHF provides:
22
+
23
+ 1. **Persistent hunt records** - Every investigation documented in LOCK format
24
+ 2. **Searchable history** - AI can recall past hunts and lessons learned
25
+ 3. **Contextual awareness** - Environment files make AI aware of your data sources
26
+ 4. **Knowledge transfer** - New team members see what's been tested
27
+ 5. **Continuous improvement** - Each hunt builds on lessons from the past
28
+
29
+ ## The Vision: Agentic Capability
30
+
31
+ As your program matures:
32
+
33
+ - **Level 1:** Document hunts for human memory
34
+ - **Level 2:** AI reads and recalls your history
35
+ - **Level 3:** AI executes queries and enriches findings
36
+ - **Level 4:** Autonomous agents monitor and act on your behalf
37
+
38
+ **The goal:** Build systems that remember, learn, and support human judgment with contextual recall.
39
+
40
+ ## Start Small
41
+
42
+ You don't need to implement everything at once. Start by documenting one hunt in LOCK format. Add structure. Build memory. Everything else follows naturally.
43
+
44
+ Memory is the multiplier. Agency is the force. Once your program can remember, everything else becomes possible.