agentic-threat-hunting-framework 0.3.1__py3-none-any.whl → 0.5.0__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.3.1.dist-info → agentic_threat_hunting_framework-0.5.0.dist-info}/METADATA +4 -1
- {agentic_threat_hunting_framework-0.3.1.dist-info → agentic_threat_hunting_framework-0.5.0.dist-info}/RECORD +27 -17
- {agentic_threat_hunting_framework-0.3.1.dist-info → agentic_threat_hunting_framework-0.5.0.dist-info}/WHEEL +1 -1
- athf/__version__.py +1 -1
- athf/cli.py +25 -10
- athf/commands/__init__.py +24 -3
- athf/commands/agent.py +43 -1
- athf/commands/hunt.py +63 -12
- athf/commands/splunk.py +323 -0
- athf/core/clickhouse_connection.py +396 -0
- athf/core/metrics_tracker.py +518 -0
- athf/core/query_executor.py +169 -0
- athf/core/query_parser.py +203 -0
- athf/core/query_suggester.py +235 -0
- athf/core/query_validator.py +240 -0
- athf/core/session_manager.py +764 -0
- athf/core/splunk_client.py +360 -0
- athf/core/template_engine.py +7 -1
- athf/data/docs/CHANGELOG.md +29 -0
- athf/data/docs/CLI_REFERENCE.md +518 -12
- athf/data/docs/getting-started.md +47 -3
- athf/data/docs/level4-agentic-workflows.md +9 -1
- athf/data/docs/maturity-model.md +56 -14
- athf/plugin_system.py +48 -0
- {agentic_threat_hunting_framework-0.3.1.dist-info → agentic_threat_hunting_framework-0.5.0.dist-info}/entry_points.txt +0 -0
- {agentic_threat_hunting_framework-0.3.1.dist-info → agentic_threat_hunting_framework-0.5.0.dist-info}/licenses/LICENSE +0 -0
- {agentic_threat_hunting_framework-0.3.1.dist-info → agentic_threat_hunting_framework-0.5.0.dist-info}/top_level.txt +0 -0
|
@@ -124,16 +124,21 @@ At Level 4, multiple specialized agents work together, coordinating through your
|
|
|
124
124
|
|
|
125
125
|
```
|
|
126
126
|
[Triggered by CTI Monitor]
|
|
127
|
+
- Runs: athf agent run similarity-scorer --query "cmd.exe process execution" --limit 5
|
|
127
128
|
- Reviews similar hunts: H-0042 (PowerShell), H-0089 (Process Execution)
|
|
129
|
+
- Runs: athf research new --topic "Qakbot cmd.exe execution" --technique T1059.003 --depth basic
|
|
128
130
|
- Extracts lessons: "Include parent-child process chains", "Filter System32 parents"
|
|
131
|
+
- Runs: athf agent run hypothesis-generator --threat-intel "Qakbot T1059.003 campaign" --technique T1059.003
|
|
129
132
|
- Generates LOCK hypothesis:
|
|
130
133
|
|
|
131
|
-
Learn: Qakbot campaign using T1059.003 detected in CTI
|
|
134
|
+
Learn: Qakbot campaign using T1059.003 detected in CTI. Research document R-0042 created.
|
|
132
135
|
Observe: Adversaries spawn cmd.exe from suspicious parents (Office, browsers)
|
|
133
136
|
Check: [Generated Splunk query with bounds and limits]
|
|
134
137
|
Keep: [Placeholder for execution results]
|
|
135
138
|
|
|
139
|
+
- Runs: athf hunt new --technique T1059.003 --title "Qakbot cmd.exe Detection" --research R-0042 --non-interactive
|
|
136
140
|
- Creates: hunts/H-0156.md
|
|
141
|
+
- Runs: athf agent run query-validator --sql "[generated query]"
|
|
137
142
|
- Validates query syntax
|
|
138
143
|
- Decision: Draft ready, trigger Validator
|
|
139
144
|
```
|
|
@@ -142,12 +147,15 @@ At Level 4, multiple specialized agents work together, coordinating through your
|
|
|
142
147
|
|
|
143
148
|
```
|
|
144
149
|
[Triggered by Hypothesis Generator]
|
|
150
|
+
- Runs: athf hunt validate H-0156
|
|
145
151
|
- Reads AGENTS.md for data source availability
|
|
146
152
|
- Checks: index=sysmon exists ✓
|
|
147
153
|
- Checks: EventCode=1 available ✓
|
|
148
154
|
- Validates: MITRE technique T1059.003 format ✓
|
|
155
|
+
- Runs: athf agent run query-validator --sql "[generated query from H-0156]"
|
|
149
156
|
- Reviews: Query has time bounds ✓
|
|
150
157
|
- Reviews: Query has result limits ✓
|
|
158
|
+
- Runs: athf agent run coverage-analyzer --tactic initial-access
|
|
151
159
|
- Decision: Hunt validated, trigger Notifier
|
|
152
160
|
```
|
|
153
161
|
|
athf/data/docs/maturity-model.md
CHANGED
|
@@ -169,7 +169,7 @@ The AI automatically searches your hunts directory, references past investigatio
|
|
|
169
169
|
4. Open your repo in Claude Code or similar AI assistant
|
|
170
170
|
5. Start asking questions about your hunts
|
|
171
171
|
|
|
172
|
-
**CLI Commands at Level 2:**
|
|
172
|
+
**CLI Commands at Level 2 (v0.3.0+):**
|
|
173
173
|
At this level, you still run commands manually, but AI helps you decide what to run:
|
|
174
174
|
```bash
|
|
175
175
|
# AI suggests: "Let me search for related hunts first"
|
|
@@ -180,6 +180,12 @@ athf hunt coverage
|
|
|
180
180
|
|
|
181
181
|
# AI suggests: "Let's see your success rates"
|
|
182
182
|
athf hunt stats
|
|
183
|
+
|
|
184
|
+
# AI suggests: "Let's do pre-hunt research first"
|
|
185
|
+
athf research new --topic "LSASS dumping" --technique T1003.001
|
|
186
|
+
|
|
187
|
+
# AI suggests: "Use the hypothesis generator agent"
|
|
188
|
+
athf agent run hypothesis-generator --threat-intel "APT29 credential theft"
|
|
183
189
|
```
|
|
184
190
|
|
|
185
191
|
The AI reads your hunt files and provides context-aware suggestions, but you execute the commands.
|
|
@@ -250,23 +256,45 @@ Should I create a Jira ticket for investigation?"
|
|
|
250
256
|
|
|
251
257
|
**The difference:** Claude executes queries, enriches data, and creates tickets - not just suggests them.
|
|
252
258
|
|
|
253
|
-
### CLI Integration at Level 3
|
|
259
|
+
### CLI Integration at Level 3 (v0.3.0+)
|
|
254
260
|
|
|
255
261
|
At Level 3, AI uses CLI commands directly as part of workflows:
|
|
256
262
|
|
|
257
|
-
**Example: AI-Driven Hunt Creation**
|
|
263
|
+
**Example: AI-Driven Hunt Creation with Research**
|
|
258
264
|
```
|
|
259
|
-
You: "
|
|
265
|
+
You: "Research and create a hunt for SSH brute force"
|
|
266
|
+
|
|
267
|
+
AI: [Uses: athf research new --topic "SSH brute force" --depth basic]
|
|
268
|
+
"Research complete. Key findings:
|
|
269
|
+
- SSH brute force typically targets default accounts
|
|
270
|
+
- Failed auth patterns indicate automated tools
|
|
271
|
+
- Successful login after failures is high-confidence indicator"
|
|
260
272
|
|
|
261
|
-
|
|
273
|
+
[Uses: athf agent run hypothesis-generator --threat-intel "SSH brute force campaign"]
|
|
274
|
+
"Generated hypothesis focusing on failed auth clustering"
|
|
275
|
+
|
|
276
|
+
[Executes Splunk query via MCP]
|
|
262
277
|
[Gets results: 3 high-volume IPs]
|
|
263
|
-
[Uses: athf hunt new --technique T1110.001 --
|
|
278
|
+
[Uses: athf hunt new --technique T1110.001 --research R-0023]
|
|
264
279
|
[Documents findings in hunt file]
|
|
265
280
|
[Uses: athf hunt validate to check structure]
|
|
266
|
-
"Created H-0087.md
|
|
281
|
+
"Created H-0087.md with research link. Review?"
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Example: Orchestrated Hunt Execution (v0.3.0+)**
|
|
285
|
+
```
|
|
286
|
+
You: "Execute hunt H-0042 end-to-end"
|
|
287
|
+
|
|
288
|
+
AI: [Uses: athf hunt execute H-0042 --dry-run]
|
|
289
|
+
"Dry run validates all queries and data sources"
|
|
290
|
+
[Uses: athf hunt execute H-0042]
|
|
291
|
+
"Executing hunt with agent orchestration:
|
|
292
|
+
- Context loaded via context-loader agent
|
|
293
|
+
- Queries validated via query-validator agent
|
|
294
|
+
- Results analyzed, 2 suspicious findings flagged"
|
|
267
295
|
```
|
|
268
296
|
|
|
269
|
-
**The difference:** You direct the workflow, AI executes both MCP tools (Splunk) and CLI commands (athf).
|
|
297
|
+
**The difference:** You direct the workflow, AI executes both MCP tools (Splunk) and CLI commands (athf), including research and agent orchestration.
|
|
270
298
|
|
|
271
299
|
### Getting Started at Level 3
|
|
272
300
|
|
|
@@ -329,7 +357,7 @@ At Level 4, multiple specialized agents work together:
|
|
|
329
357
|
**You wake up to:**
|
|
330
358
|
> "3 new draft hunts created overnight based on recent CTI. Ready for your review."
|
|
331
359
|
|
|
332
|
-
### CLI Commands in Autonomous Workflows
|
|
360
|
+
### CLI Commands in Autonomous Workflows (v0.3.0+)
|
|
333
361
|
|
|
334
362
|
At Level 4, agents use CLI commands without your intervention:
|
|
335
363
|
|
|
@@ -337,28 +365,42 @@ At Level 4, agents use CLI commands without your intervention:
|
|
|
337
365
|
```bash
|
|
338
366
|
# CTI Monitor Agent (runs every 6 hours)
|
|
339
367
|
athf hunt search "T1059.003" # Check for existing hunts
|
|
368
|
+
athf agent run similarity-scorer --query "Qakbot JavaScript" # Find related hunts
|
|
340
369
|
# No matches found
|
|
341
370
|
|
|
371
|
+
# Research Agent (triggered if new TTP)
|
|
372
|
+
athf research new \
|
|
373
|
+
--topic "Qakbot JavaScript dropper" \
|
|
374
|
+
--technique T1059.003 \
|
|
375
|
+
--depth basic # Quick research for autonomous workflows
|
|
376
|
+
|
|
342
377
|
# Hypothesis Generator Agent (triggered by CTI Monitor)
|
|
378
|
+
athf agent run hypothesis-generator \
|
|
379
|
+
--threat-intel "Qakbot campaign using T1059.003 for initial access" \
|
|
380
|
+
--technique T1059.003
|
|
381
|
+
|
|
382
|
+
# Create hunt file with generated hypothesis and research link
|
|
343
383
|
athf hunt new \
|
|
344
384
|
--technique T1059.003 \
|
|
345
385
|
--title "Qakbot JavaScript Dropper Detection" \
|
|
386
|
+
--research R-0042 \
|
|
346
387
|
--platform windows \
|
|
347
388
|
--non-interactive
|
|
348
389
|
|
|
349
390
|
# Validator Agent (triggered by Generator)
|
|
391
|
+
athf agent run query-validator --sql "[generated query]"
|
|
350
392
|
athf hunt validate H-0156 # Ensure structure is correct
|
|
351
|
-
athf
|
|
393
|
+
athf agent run coverage-analyzer --tactic initial-access # Update coverage metrics
|
|
352
394
|
|
|
353
395
|
# Notifier Agent (triggered by Validator)
|
|
354
|
-
# Posts to Slack: "H-0156 ready for review"
|
|
396
|
+
# Posts to Slack: "H-0156 ready for review (research: R-0042)"
|
|
355
397
|
```
|
|
356
398
|
|
|
357
399
|
**The progression:**
|
|
358
400
|
- **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
|
|
401
|
+
- **Level 2:** AI suggests when to run `athf hunt new` and `athf agent run`
|
|
402
|
+
- **Level 3:** AI runs `athf hunt new`, `athf agent run`, and `athf research new` when you ask
|
|
403
|
+
- **Level 4:** Agents run all commands autonomously based on objectives
|
|
362
404
|
|
|
363
405
|
### The Maturity Progression
|
|
364
406
|
|
athf/plugin_system.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Plugin system for ATHF extensions."""
|
|
2
|
+
from typing import Dict, Type, Callable
|
|
3
|
+
import importlib.metadata
|
|
4
|
+
from click import Command
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PluginRegistry:
|
|
8
|
+
"""Central registry for ATHF plugins."""
|
|
9
|
+
|
|
10
|
+
_agents: Dict[str, Type] = {}
|
|
11
|
+
_commands: Dict[str, Command] = {}
|
|
12
|
+
|
|
13
|
+
@classmethod
|
|
14
|
+
def register_agent(cls, name: str, agent_class: Type) -> None:
|
|
15
|
+
"""Register an agent plugin."""
|
|
16
|
+
cls._agents[name] = agent_class
|
|
17
|
+
|
|
18
|
+
@classmethod
|
|
19
|
+
def register_command(cls, name: str, command: Command) -> None:
|
|
20
|
+
"""Register a CLI command plugin."""
|
|
21
|
+
cls._commands[name] = command
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def get_agent(cls, name: str) -> Type:
|
|
25
|
+
"""Get registered agent by name."""
|
|
26
|
+
return cls._agents.get(name)
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def get_command(cls, name: str) -> Command:
|
|
30
|
+
"""Get registered command by name."""
|
|
31
|
+
return cls._commands.get(name)
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def load_plugins(cls) -> None:
|
|
35
|
+
"""Auto-discover and load all installed plugins."""
|
|
36
|
+
try:
|
|
37
|
+
for ep in importlib.metadata.entry_points(group='athf.commands'):
|
|
38
|
+
command = ep.load()
|
|
39
|
+
cls.register_command(ep.name, command)
|
|
40
|
+
except Exception:
|
|
41
|
+
pass # No plugins installed yet
|
|
42
|
+
|
|
43
|
+
try:
|
|
44
|
+
for ep in importlib.metadata.entry_points(group='athf.agents'):
|
|
45
|
+
agent = ep.load()
|
|
46
|
+
cls.register_agent(ep.name, agent)
|
|
47
|
+
except Exception:
|
|
48
|
+
pass # No plugins installed yet
|
|
File without changes
|
|
File without changes
|
|
File without changes
|