agentic-threat-hunting-framework 0.2.3__py3-none-any.whl → 0.3.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.
Files changed (43) hide show
  1. {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.3.0.dist-info}/METADATA +38 -40
  2. agentic_threat_hunting_framework-0.3.0.dist-info/RECORD +51 -0
  3. athf/__version__.py +1 -1
  4. athf/cli.py +7 -2
  5. athf/commands/__init__.py +4 -0
  6. athf/commands/agent.py +452 -0
  7. athf/commands/context.py +6 -9
  8. athf/commands/env.py +2 -2
  9. athf/commands/hunt.py +3 -3
  10. athf/commands/init.py +45 -0
  11. athf/commands/research.py +530 -0
  12. athf/commands/similar.py +5 -5
  13. athf/core/research_manager.py +419 -0
  14. athf/core/web_search.py +340 -0
  15. athf/data/__init__.py +19 -0
  16. athf/data/docs/CHANGELOG.md +147 -0
  17. athf/data/docs/CLI_REFERENCE.md +1797 -0
  18. athf/data/docs/INSTALL.md +594 -0
  19. athf/data/docs/README.md +31 -0
  20. athf/data/docs/environment.md +256 -0
  21. athf/data/docs/getting-started.md +419 -0
  22. athf/data/docs/level4-agentic-workflows.md +480 -0
  23. athf/data/docs/lock-pattern.md +149 -0
  24. athf/data/docs/maturity-model.md +400 -0
  25. athf/data/docs/why-athf.md +44 -0
  26. athf/data/hunts/FORMAT_GUIDELINES.md +507 -0
  27. athf/data/hunts/H-0001.md +453 -0
  28. athf/data/hunts/H-0002.md +436 -0
  29. athf/data/hunts/H-0003.md +546 -0
  30. athf/data/hunts/README.md +231 -0
  31. athf/data/integrations/MCP_CATALOG.md +45 -0
  32. athf/data/integrations/README.md +129 -0
  33. athf/data/integrations/quickstart/splunk.md +162 -0
  34. athf/data/knowledge/hunting-knowledge.md +2375 -0
  35. athf/data/prompts/README.md +172 -0
  36. athf/data/prompts/ai-workflow.md +581 -0
  37. athf/data/prompts/basic-prompts.md +316 -0
  38. athf/data/templates/HUNT_LOCK.md +228 -0
  39. agentic_threat_hunting_framework-0.2.3.dist-info/RECORD +0 -23
  40. {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.3.0.dist-info}/WHEEL +0 -0
  41. {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.3.0.dist-info}/entry_points.txt +0 -0
  42. {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.3.0.dist-info}/licenses/LICENSE +0 -0
  43. {agentic_threat_hunting_framework-0.2.3.dist-info → agentic_threat_hunting_framework-0.3.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1797 @@
1
+ # ATHF CLI Reference
2
+
3
+ Complete reference for all `athf` command-line interface commands.
4
+
5
+ ## Command Quick Reference
6
+
7
+ | Command | Category | Description |
8
+ |---------|----------|-------------|
9
+ | [`athf init`](#athf-init) | Setup | Initialize ATHF workspace directory structure |
10
+ | [`athf env setup`](#athf-env) | Environment | Setup Python virtual environment with dependencies |
11
+ | [`athf env info`](#athf-env) | Environment | Show virtual environment information |
12
+ | [`athf hunt new`](#athf-hunt-new) | Hunt Management | Create new hunt from template with auto-generated ID |
13
+ | [`athf hunt list`](#athf-hunt-list) | Hunt Management | List all hunts with optional filtering |
14
+ | [`athf hunt validate`](#athf-hunt-validate) | Hunt Management | Validate hunt file structure and metadata |
15
+ | [`athf hunt stats`](#athf-hunt-stats) | Hunt Management | Display hunt statistics and success metrics |
16
+ | [`athf hunt search`](#athf-hunt-search) | Hunt Management | Full-text search across all hunts |
17
+ | [`athf hunt coverage`](#athf-hunt-coverage) | Hunt Management | Display MITRE ATT&CK coverage heatmap |
18
+ | [`athf investigate new`](#athf-investigate-new) | Investigation Management | Create new investigation file for exploratory work |
19
+ | [`athf investigate list`](#athf-investigate-list) | Investigation Management | List all investigations with optional filtering |
20
+ | [`athf investigate search`](#athf-investigate-search) | Investigation Management | Full-text search across investigations |
21
+ | [`athf investigate validate`](#athf-investigate-validate) | Investigation Management | Validate investigation file structure |
22
+ | [`athf investigate promote`](#athf-investigate-promote) | Investigation Management | Promote investigation to formal hunt |
23
+ | [`athf context`](#athf-context) | AI Optimization | Export AI-optimized context bundle (saves ~75% tokens) |
24
+ | [`athf similar`](#athf-similar) | AI Optimization | Find similar hunts using semantic search |
25
+
26
+ ## Table of Contents
27
+
28
+ - [Installation](#installation)
29
+ - [Global Options](#global-options)
30
+ - [athf init](#athf-init)
31
+ - [athf env](#athf-env)
32
+ - [athf context](#athf-context)
33
+ - [athf similar](#athf-similar)
34
+ - [athf hunt new](#athf-hunt-new)
35
+ - [athf hunt list](#athf-hunt-list)
36
+ - [athf hunt validate](#athf-hunt-validate)
37
+ - [athf hunt stats](#athf-hunt-stats)
38
+ - [athf hunt search](#athf-hunt-search)
39
+ - [athf hunt coverage](#athf-hunt-coverage)
40
+ - [athf investigate new](#athf-investigate-new)
41
+ - [athf investigate list](#athf-investigate-list)
42
+ - [athf investigate search](#athf-investigate-search)
43
+ - [athf investigate validate](#athf-investigate-validate)
44
+ - [athf investigate promote](#athf-investigate-promote)
45
+ - [Configuration](#configuration)
46
+ - [Exit Codes](#exit-codes)
47
+
48
+ ---
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ pip install agentic-threat-hunting-framework
54
+ ```
55
+
56
+ See [INSTALL.md](INSTALL.md) for detailed installation instructions.
57
+
58
+ ---
59
+
60
+ ## Global Options
61
+
62
+ These options work with any `athf` command:
63
+
64
+ ```bash
65
+ athf --version # Show version and exit
66
+ athf --help # Show help message
67
+ athf <command> --help # Show help for specific command
68
+ ```
69
+
70
+ ---
71
+
72
+ ## athf init
73
+
74
+ Initialize ATHF directory structure in the current directory.
75
+
76
+ ### Synopsis
77
+
78
+ ```bash
79
+ athf init [OPTIONS]
80
+ ```
81
+
82
+ ### Description
83
+
84
+ Creates the standard ATHF directory structure with templates, configuration files, and documentation. This is typically the first command you run when setting up a new threat hunting workspace.
85
+
86
+ ### Options
87
+
88
+ | Option | Type | Default | Description |
89
+ |--------|------|---------|-------------|
90
+ | `--non-interactive` | Flag | False | Skip interactive prompts and use defaults |
91
+ | `--siem` | Choice | splunk | SIEM platform: `splunk`, `sentinel`, `elastic` |
92
+ | `--edr` | Choice | crowdstrike | EDR platform: `crowdstrike`, `sentinelone`, `defender` |
93
+ | `--hunt-prefix` | String | H | Prefix for hunt IDs (e.g., H-0001) |
94
+ | `--retention-days` | Integer | 90 | Default data retention in days |
95
+
96
+ ### Examples
97
+
98
+ **Interactive mode** (recommended for first-time setup):
99
+
100
+ ```bash
101
+ athf init
102
+ ```
103
+
104
+ You'll be prompted for:
105
+ ```
106
+ SIEM platform [splunk/sentinel/elastic]: splunk
107
+ EDR platform [crowdstrike/sentinelone/defender]: crowdstrike
108
+ Hunt ID prefix [H]: HUNT
109
+ Default data retention (days) [90]: 180
110
+ ```
111
+
112
+ **Non-interactive mode** (use defaults):
113
+
114
+ ```bash
115
+ athf init --non-interactive
116
+ ```
117
+
118
+ **Custom configuration**:
119
+
120
+ ```bash
121
+ athf init \
122
+ --siem sentinel \
123
+ --edr defender \
124
+ --hunt-prefix TH \
125
+ --retention-days 180
126
+ ```
127
+
128
+ ### Directory Structure Created
129
+
130
+ ```
131
+ .
132
+ ├── .athfconfig.yaml # Configuration file
133
+ ├── AGENTS.md # AI assistant instructions
134
+ ├── hunts/ # Hunt documentation
135
+ ├── queries/ # Reusable query library
136
+ ├── runs/ # Hunt execution logs
137
+ └── templates/ # Hunt templates
138
+ └── HUNT_LOCK.md
139
+ ```
140
+
141
+ ### Configuration File
142
+
143
+ Creates `.athfconfig.yaml`:
144
+
145
+ ```yaml
146
+ siem: splunk
147
+ edr: crowdstrike
148
+ hunt_prefix: H
149
+ retention_days: 90
150
+ initialized: 2025-12-02T14:30:00
151
+ version: 0.2.1
152
+ ```
153
+
154
+ ### Exit Codes
155
+
156
+ - `0`: Success
157
+ - `1`: Directory already initialized (`.athfconfig.yaml` exists)
158
+
159
+ ---
160
+
161
+ ## athf env
162
+
163
+ Manage Python virtual environment for ATHF development.
164
+
165
+ ### Synopsis
166
+
167
+ ```bash
168
+ athf env [COMMAND] [OPTIONS]
169
+ ```
170
+
171
+ ### Description
172
+
173
+ Provides commands for managing Python virtual environments, including setup, information display, and cleanup. Simplifies dependency management and ensures consistent development environments.
174
+
175
+ ### Subcommands
176
+
177
+ | Command | Description |
178
+ |---------|-------------|
179
+ | `setup` | Setup virtual environment with dependencies |
180
+ | `info` | Show virtual environment information |
181
+ | `clean` | Remove virtual environment |
182
+ | `activate` | Show command to activate virtual environment |
183
+ | `deactivate` | Show command to deactivate virtual environment |
184
+
185
+ ### athf env setup
186
+
187
+ Setup Python virtual environment with dependencies.
188
+
189
+ **Synopsis:**
190
+ ```bash
191
+ athf env setup [OPTIONS]
192
+ ```
193
+
194
+ **Options:**
195
+
196
+ | Option | Type | Default | Description |
197
+ |--------|------|---------|-------------|
198
+ | `--python` | String | python3 | Python interpreter to use |
199
+ | `--dev` | Flag | False | Install development dependencies |
200
+ | `--clean` | Flag | False | Remove existing venv before setup |
201
+
202
+ **Examples:**
203
+
204
+ ```bash
205
+ # Basic setup
206
+ athf env setup
207
+
208
+ # Setup with dev dependencies
209
+ athf env setup --dev
210
+
211
+ # Clean install
212
+ athf env setup --clean
213
+
214
+ # Use specific Python version
215
+ athf env setup --python python3.11 --dev
216
+ ```
217
+
218
+ ### athf env info
219
+
220
+ Show virtual environment information.
221
+
222
+ **Synopsis:**
223
+ ```bash
224
+ athf env info
225
+ ```
226
+
227
+ **Examples:**
228
+
229
+ ```bash
230
+ athf env info
231
+ ```
232
+
233
+ **Output:**
234
+ ```
235
+ Virtual Environment Info:
236
+
237
+ Location: /path/to/.venv
238
+ Python: Python 3.11.5
239
+ Packages: 42 installed
240
+ athf: ✓ Installed (version 0.2.1)
241
+ scikit-learn: ✓ Installed (required for athf similar)
242
+ ```
243
+
244
+ ### athf env clean
245
+
246
+ Remove virtual environment.
247
+
248
+ **Synopsis:**
249
+ ```bash
250
+ athf env clean
251
+ ```
252
+
253
+ **Examples:**
254
+
255
+ ```bash
256
+ athf env clean
257
+ ```
258
+
259
+ ### athf env activate
260
+
261
+ Show command to activate virtual environment.
262
+
263
+ **Synopsis:**
264
+ ```bash
265
+ athf env activate
266
+ ```
267
+
268
+ **Examples:**
269
+
270
+ ```bash
271
+ # Show activation command
272
+ athf env activate
273
+
274
+ # Copy and run the printed command
275
+ source .venv/bin/activate
276
+ ```
277
+
278
+ **Note:** Cannot activate directly (subprocesses can't modify parent shell). Copy and run the printed command.
279
+
280
+ ### athf env deactivate
281
+
282
+ Show command to deactivate virtual environment.
283
+
284
+ **Synopsis:**
285
+ ```bash
286
+ athf env deactivate
287
+ ```
288
+
289
+ **Examples:**
290
+
291
+ ```bash
292
+ # Show deactivation command
293
+ athf env deactivate
294
+
295
+ # Copy and run the printed command
296
+ deactivate
297
+ ```
298
+
299
+ ### Exit Codes
300
+
301
+ - `0`: Success
302
+ - `1`: Environment operation failed
303
+
304
+ ---
305
+
306
+ ## athf context
307
+
308
+ Export AI-optimized context bundle to reduce token usage.
309
+
310
+ ### Synopsis
311
+
312
+ ```bash
313
+ athf context [OPTIONS]
314
+ ```
315
+
316
+ ### Description
317
+
318
+ Combines relevant files into a single structured output for AI assistants. Reduces context-loading from ~5 tool calls to 1, saving ~2,000 tokens per hunt (~75% reduction). Includes environment.md, hunts/INDEX.md, hunt files, and domain knowledge.
319
+
320
+ **Token Savings:**
321
+ - **Without context**: ~5 Read operations, ~3,000 tokens
322
+ - **With context**: 1 command, ~1,000 tokens
323
+ - **Savings**: ~2,000 tokens per hunt (~$0.03 per hunt)
324
+
325
+ ### Options
326
+
327
+ | Option | Type | Default | Description |
328
+ |--------|------|---------|-------------|
329
+ | `--hunt` | String | - | Hunt ID to export context for (e.g., H-0013) |
330
+ | `--tactic` | String | - | MITRE tactic to filter hunts (e.g., credential-access) |
331
+ | `--platform` | String | - | Platform to filter hunts (e.g., macos, windows, linux) |
332
+ | `--full` | Flag | False | Export full repository context (use sparingly) |
333
+ | `--format` | Choice | json | Output format: `json`, `markdown`, `yaml` |
334
+ | `--output` | Path | - | Output file path (default: stdout) |
335
+
336
+ **Note:** Must specify exactly one of: `--hunt`, `--tactic`, `--platform`, or `--full`.
337
+
338
+ ### Examples
339
+
340
+ **Export context for specific hunt:**
341
+
342
+ ```bash
343
+ athf context --hunt H-0013 --format json
344
+ ```
345
+
346
+ **Export context for all credential access hunts:**
347
+
348
+ ```bash
349
+ athf context --tactic credential-access --format json
350
+ ```
351
+
352
+ **Export context for macOS platform hunts:**
353
+
354
+ ```bash
355
+ athf context --platform macos --format json
356
+ ```
357
+
358
+ **Export as markdown:**
359
+
360
+ ```bash
361
+ athf context --hunt H-0013 --format markdown
362
+ ```
363
+
364
+ **Save to file:**
365
+
366
+ ```bash
367
+ athf context --hunt H-0013 --format json --output context.json
368
+ ```
369
+
370
+ **Export full repository context** (large output):
371
+
372
+ ```bash
373
+ athf context --full --format json
374
+ ```
375
+
376
+ ### Output Structure (JSON)
377
+
378
+ ```json
379
+ {
380
+ "metadata": {
381
+ "generated_by": "athf context",
382
+ "filters": {
383
+ "hunt": "H-0013",
384
+ "tactic": null,
385
+ "platform": null,
386
+ "full": false
387
+ }
388
+ },
389
+ "environment": "# Tech stack, data sources...",
390
+ "hunt_index": "# Hunt metadata index...",
391
+ "hunts": [
392
+ {
393
+ "hunt_id": "H-0013",
394
+ "content": "---\nhunt_id: H-0013\ntitle: ..."
395
+ }
396
+ ],
397
+ "domain_knowledge": [
398
+ {
399
+ "file": "knowledge/hunting-knowledge.md",
400
+ "content": "# Hunting knowledge..."
401
+ }
402
+ ]
403
+ }
404
+ ```
405
+
406
+ ### Use Cases
407
+
408
+ - **AI assistants**: Reduce context-loading from ~5 tool calls to 1
409
+ - **Token optimization**: Pre-filtered, structured content only
410
+ - **Hunt planning**: Get all relevant context in one shot
411
+ - **Query generation**: Include past hunt lessons and data sources
412
+
413
+ ### Exit Codes
414
+
415
+ - `0`: Success
416
+ - `1`: Invalid filter options or missing files
417
+
418
+ ---
419
+
420
+ ## athf similar
421
+
422
+ Find hunts similar to a query or hunt ID using semantic search.
423
+
424
+ ### Synopsis
425
+
426
+ ```bash
427
+ athf similar [QUERY] [OPTIONS]
428
+ athf similar --hunt HUNT_ID [OPTIONS]
429
+ ```
430
+
431
+ ### Description
432
+
433
+ Uses semantic similarity (TF-IDF) to find related hunts even when terminology differs. Better than keyword search for discovering patterns and avoiding duplicate hunts. Requires `scikit-learn` to be installed.
434
+
435
+ **Why This Helps:**
436
+ - Semantic search (not just keyword matching)
437
+ - Find related hunts with different terminology
438
+ - Discover patterns across hunt history
439
+ - Identify similar hunts to avoid duplication
440
+
441
+ ### Arguments
442
+
443
+ | Argument | Type | Description |
444
+ |----------|------|-------------|
445
+ | `QUERY` | String (optional) | Search query text |
446
+
447
+ ### Options
448
+
449
+ | Option | Type | Default | Description |
450
+ |--------|------|---------|-------------|
451
+ | `--hunt` | String | - | Hunt ID to find similar hunts for (e.g., H-0013) |
452
+ | `--limit` | Integer | 10 | Maximum number of results |
453
+ | `--format` | Choice | table | Output format: `table`, `json`, `yaml` |
454
+ | `--threshold` | Float | 0.1 | Minimum similarity score (0-1) |
455
+
456
+ **Note:** Must provide either `QUERY` or `--hunt` option.
457
+
458
+ ### Examples
459
+
460
+ **Find hunts similar to text query:**
461
+
462
+ ```bash
463
+ athf similar "password spraying via RDP"
464
+ ```
465
+
466
+ **Find hunts similar to specific hunt:**
467
+
468
+ ```bash
469
+ athf similar --hunt H-0013
470
+ ```
471
+
472
+ **Limit results to top 5:**
473
+
474
+ ```bash
475
+ athf similar "kerberos" --limit 5
476
+ ```
477
+
478
+ **Export as JSON:**
479
+
480
+ ```bash
481
+ athf similar "credential theft" --format json
482
+ ```
483
+
484
+ **Set minimum similarity threshold:**
485
+
486
+ ```bash
487
+ athf similar "reconnaissance" --threshold 0.3
488
+ ```
489
+
490
+ ### Output (Table Format)
491
+
492
+ ```
493
+ Similar to: password spraying
494
+
495
+ Found 3 similar hunts
496
+
497
+ Score Hunt ID Title Status Tactics
498
+ ─────────────────────────────────────────────────────────────
499
+ 0.421 H-0014 Password Spraying 📋 planning credential-access
500
+ 0.318 H-0008 Brute Force Login ✅ completed credential-access
501
+ 0.251 H-0022 Account Takeover 🔄 in-progress initial-access
502
+
503
+ Similarity Score Legend:
504
+ ≥0.50 = Very similar | 0.30-0.49 = Similar | 0.15-0.29 = Somewhat similar
505
+ ```
506
+
507
+ ### Output (JSON Format)
508
+
509
+ ```json
510
+ [
511
+ {
512
+ "hunt_id": "H-0014",
513
+ "similarity_score": 0.421,
514
+ "title": "Password Spraying Detection",
515
+ "status": "planning",
516
+ "tactics": ["credential-access"],
517
+ "techniques": ["T1110.003"],
518
+ "platform": ["windows"]
519
+ }
520
+ ]
521
+ ```
522
+
523
+ ### Similarity Score Interpretation
524
+
525
+ | Score Range | Meaning | Recommendation |
526
+ |-------------|---------|----------------|
527
+ | ≥0.50 | Very similar | Likely duplicate or closely related |
528
+ | 0.30-0.49 | Similar | Same domain or tactic |
529
+ | 0.15-0.29 | Somewhat similar | Related concepts |
530
+ | <0.15 | Low similarity | Different topics |
531
+
532
+ ### Installation
533
+
534
+ Requires `scikit-learn`:
535
+
536
+ ```bash
537
+ pip install "agentic-threat-hunting-framework[similarity]"
538
+ ```
539
+
540
+ Or install scikit-learn separately:
541
+
542
+ ```bash
543
+ pip install scikit-learn
544
+ ```
545
+
546
+ ### Exit Codes
547
+
548
+ - `0`: Success
549
+ - `1`: Missing query/hunt option, scikit-learn not installed, or hunt not found
550
+
551
+ ---
552
+
553
+ ## athf hunt new
554
+
555
+ Create a new hunt from template with auto-generated ID.
556
+
557
+ ### Synopsis
558
+
559
+ ```bash
560
+ athf hunt new [OPTIONS]
561
+ ```
562
+
563
+ ### Description
564
+
565
+ Creates a new hunt file with proper YAML frontmatter and LOCK structure. Automatically assigns the next available hunt ID and generates a complete template.
566
+
567
+ ### Options
568
+
569
+ **Basic Options:**
570
+
571
+ | Option | Type | Default | Description |
572
+ |--------|------|---------|-------------|
573
+ | `--non-interactive` | Flag | False | Skip interactive prompts |
574
+ | `--technique` | String | Required* | MITRE ATT&CK technique (e.g., T1003.001) |
575
+ | `--title` | String | Required* | Hunt title |
576
+ | `--tactics` | String | - | Comma-separated tactics (e.g., credential-access,defense-evasion) |
577
+ | `--platforms` | String | - | Comma-separated platforms (e.g., windows,linux,macos) |
578
+ | `--data-sources` | String | - | Comma-separated data sources |
579
+ | `--hunter` | String | AI Assistant | Your name or handle |
580
+ | `--severity` | Choice | medium | Severity: `low`, `medium`, `high`, `critical` |
581
+
582
+ **Rich Content Options (for AI assistants & automation):**
583
+
584
+ | Option | Type | Description |
585
+ |--------|------|-------------|
586
+ | `--hypothesis` | String | Full hypothesis statement |
587
+ | `--threat-context` | String | Threat intel or context motivating the hunt |
588
+ | `--actor` | String | Threat actor description (for ABLE framework) |
589
+ | `--behavior` | String | Behavior description (for ABLE framework) |
590
+ | `--location` | String | Location/scope description (for ABLE framework) |
591
+ | `--evidence` | String | Evidence description (for ABLE framework) |
592
+
593
+ \* Required in non-interactive mode
594
+
595
+ ### Examples
596
+
597
+ **Interactive mode** (recommended):
598
+
599
+ ```bash
600
+ athf hunt new
601
+ ```
602
+
603
+ Prompts:
604
+ ```
605
+ MITRE ATT&CK Technique (e.g., T1003.001): T1558.003
606
+ Hunt Title: Kerberoasting Detection via Unusual TGS Requests
607
+ Primary Tactic [credential-access]: credential-access
608
+ Target Platforms (comma-separated) [windows]: windows
609
+ Data Sources (comma-separated) [windows-event-logs]: windows-event-logs,edr-telemetry
610
+ Your Name [Your Name]: Jane Doe
611
+ Severity [medium]: high
612
+ ```
613
+
614
+ **Non-interactive mode**:
615
+
616
+ ```bash
617
+ athf hunt new \
618
+ --technique T1558.003 \
619
+ --title "Kerberoasting Detection" \
620
+ --tactics credential-access \
621
+ --platforms windows \
622
+ --data-sources "windows-event-logs,edr-telemetry" \
623
+ --hunter "Jane Doe" \
624
+ --severity high \
625
+ --non-interactive
626
+ ```
627
+
628
+ **Minimal example** (non-interactive):
629
+
630
+ ```bash
631
+ athf hunt new \
632
+ --technique T1003.001 \
633
+ --title "LSASS Memory Dumping" \
634
+ --non-interactive
635
+ ```
636
+
637
+ **AI-friendly one-liner with rich content** (full hypothesis + ABLE framework):
638
+
639
+ ```bash
640
+ athf hunt new \
641
+ --title "macOS Unix Shell Abuse for Reconnaissance" \
642
+ --technique "T1059.004" \
643
+ --tactics "execution,defense-evasion" \
644
+ --platforms "macos" \
645
+ --data-sources "EDR process telemetry" \
646
+ --hypothesis "Adversaries execute malicious commands via native macOS shells to perform reconnaissance and staging activities" \
647
+ --threat-context "macOS developer workstations are high-value targets for supply chain attacks and credential theft" \
648
+ --actor "Generic adversary (malware droppers, supply chain attackers, insider threats)" \
649
+ --behavior "Shell execution from unusual parents performing reconnaissance or accessing sensitive files" \
650
+ --location "macOS endpoints (developer workstations, CI/CD infrastructure)" \
651
+ --evidence "EDR process telemetry - Fields: process.name, process.parent.name, process.command_line" \
652
+ --hunter "Your Name" \
653
+ --non-interactive
654
+ ```
655
+
656
+ **Benefits of rich content flags:**
657
+ - ✅ AI assistants can create fully-populated hunt files in one command
658
+ - ✅ No manual file editing required for basic hunts
659
+ - ✅ All LOCK template fields can be populated via CLI
660
+ - ✅ Backwards compatible (all new flags are optional)
661
+
662
+ ### Output
663
+
664
+ ```
665
+ ✓ Created new hunt: H-0023
666
+ File: /path/to/hunts/H-0023.md
667
+ Title: Kerberoasting Detection
668
+ Technique: T1558.003
669
+
670
+ Next steps:
671
+ 1. Edit hunts/H-0023.md
672
+ 2. Fill in the LOCK sections
673
+ 3. Execute your hunt
674
+ 4. Document findings
675
+ ```
676
+
677
+ ### Generated File Structure
678
+
679
+ ```yaml
680
+ ---
681
+ hunt_id: H-0023
682
+ title: "Kerberoasting Detection"
683
+ status: in-progress
684
+ date: 2025-12-02
685
+ updated: 2025-12-02
686
+ hunter: "Jane Doe"
687
+ techniques:
688
+ - T1558.003
689
+ tactics:
690
+ - credential-access
691
+ platforms:
692
+ - windows
693
+ data_sources:
694
+ - windows-event-logs
695
+ - edr-telemetry
696
+ severity: high
697
+ tags: []
698
+ true_positives: 0
699
+ false_positives: 0
700
+ ---
701
+
702
+ ## LEARN
703
+ ...
704
+ ```
705
+
706
+ ### Exit Codes
707
+
708
+ - `0`: Success
709
+ - `1`: Missing required options (non-interactive mode)
710
+ - `2`: Invalid technique format
711
+
712
+ ---
713
+
714
+ ## athf hunt list
715
+
716
+ List all hunts with optional filtering.
717
+
718
+ ### Synopsis
719
+
720
+ ```bash
721
+ athf hunt list [OPTIONS]
722
+ ```
723
+
724
+ ### Description
725
+
726
+ Display all hunts in a formatted table. Supports filtering by status, tactic, technique, and platform. Output formats include table (default), JSON, and YAML.
727
+
728
+ ### Options
729
+
730
+ | Option | Type | Default | Description |
731
+ |--------|------|---------|-------------|
732
+ | `--status` | Choice | - | Filter by status: `in-progress`, `completed`, `paused`, `archived` |
733
+ | `--tactic` | String | - | Filter by MITRE ATT&CK tactic |
734
+ | `--technique` | String | - | Filter by technique (e.g., T1003.001) |
735
+ | `--platform` | String | - | Filter by platform |
736
+ | `--output` | Choice | table | Output format: `table`, `json`, `yaml` |
737
+
738
+ ### Examples
739
+
740
+ **List all hunts**:
741
+
742
+ ```bash
743
+ athf hunt list
744
+ ```
745
+
746
+ Output:
747
+ ```
748
+ Hunt ID Title Status Technique Findings
749
+ ─────────────────────────────────────────────────────────────────────────
750
+ H-0001 macOS Information Stealer completed T1005 1 (1 TP)
751
+ H-0002 Kerberoasting Detection in-progress T1558.003 -
752
+ H-0015 LSASS Memory Access completed T1003.001 3 (2 TP)
753
+ H-0023 Cloud Persistence via Lambda paused T1098 -
754
+ ```
755
+
756
+ **Filter by status**:
757
+
758
+ ```bash
759
+ athf hunt list --status completed
760
+ ```
761
+
762
+ **Filter by tactic**:
763
+
764
+ ```bash
765
+ athf hunt list --tactic credential-access
766
+ ```
767
+
768
+ **Filter by technique**:
769
+
770
+ ```bash
771
+ athf hunt list --technique T1003.001
772
+ ```
773
+
774
+ **Multiple filters**:
775
+
776
+ ```bash
777
+ athf hunt list --status completed --platform windows
778
+ ```
779
+
780
+ **JSON output** (for scripts/automation):
781
+
782
+ ```bash
783
+ athf hunt list --output json
784
+ ```
785
+
786
+ Output:
787
+ ```json
788
+ [
789
+ {
790
+ "hunt_id": "H-0001",
791
+ "title": "macOS Information Stealer Detection",
792
+ "status": "completed",
793
+ "techniques": ["T1005"],
794
+ "tactics": ["collection"],
795
+ "platforms": ["macos"],
796
+ "true_positives": 1,
797
+ "false_positives": 0
798
+ }
799
+ ]
800
+ ```
801
+
802
+ **YAML output**:
803
+
804
+ ```bash
805
+ athf hunt list --output yaml
806
+ ```
807
+
808
+ ### Exit Codes
809
+
810
+ - `0`: Success
811
+ - `1`: No hunts directory found (run `athf init` first)
812
+
813
+ ---
814
+
815
+ ## athf hunt validate
816
+
817
+ Validate hunt file structure and metadata.
818
+
819
+ ### Synopsis
820
+
821
+ ```bash
822
+ athf hunt validate [HUNT_ID]
823
+ ```
824
+
825
+ ### Description
826
+
827
+ Validates hunt files against the ATHF format specification. Checks YAML frontmatter, required fields, LOCK sections, and ATT&CK technique format.
828
+
829
+ ### Arguments
830
+
831
+ | Argument | Type | Description |
832
+ |----------|------|-------------|
833
+ | `HUNT_ID` | String (optional) | Specific hunt to validate (e.g., H-0001). If omitted, validates all hunts. |
834
+
835
+ ### Examples
836
+
837
+ **Validate specific hunt**:
838
+
839
+ ```bash
840
+ athf hunt validate H-0001
841
+ ```
842
+
843
+ Output (success):
844
+ ```
845
+ ✓ Hunt H-0001 is valid
846
+ - YAML frontmatter: OK
847
+ - Required fields: OK
848
+ - ATT&CK technique: OK
849
+ - LOCK sections: OK
850
+ ```
851
+
852
+ Output (errors):
853
+ ```
854
+ ✗ Hunt H-0023 has validation errors:
855
+ - Missing required field: hunter
856
+ - Invalid technique format: T1003 (expected: T1003.001)
857
+ - Missing LOCK section: CHECK
858
+ ```
859
+
860
+ **Validate all hunts**:
861
+
862
+ ```bash
863
+ athf hunt validate
864
+ ```
865
+
866
+ Output:
867
+ ```
868
+ Validating 4 hunts...
869
+
870
+ ✓ H-0001: Valid
871
+ ✗ H-0002: 1 error
872
+ - Missing required field: hunter
873
+ ✓ H-0015: Valid
874
+ ✓ H-0023: Valid
875
+
876
+ Summary: 3 valid, 1 invalid
877
+ ```
878
+
879
+ ### Validation Rules
880
+
881
+ **Required frontmatter fields**:
882
+ - `hunt_id`
883
+ - `title`
884
+ - `status`
885
+ - `date`
886
+ - `hunter`
887
+ - `techniques`
888
+
889
+ **ATT&CK technique format**:
890
+ - Pattern: `T1234.001` (technique + subtechnique)
891
+ - Must start with `T`
892
+ - Must be in techniques list
893
+
894
+ **LOCK sections**:
895
+ - All four sections must be present: LEARN, OBSERVE, CHECK, KEEP
896
+ - Sections must be Markdown H2 headers: `## LEARN`
897
+
898
+ **Status values**:
899
+ - Must be one of: `in-progress`, `completed`, `paused`, `archived`
900
+
901
+ ### Exit Codes
902
+
903
+ - `0`: All hunts valid
904
+ - `1`: Validation errors found
905
+
906
+ ---
907
+
908
+ ## athf hunt stats
909
+
910
+ Display hunt statistics and success metrics.
911
+
912
+ ### Synopsis
913
+
914
+ ```bash
915
+ athf hunt stats [OPTIONS]
916
+ ```
917
+
918
+ ### Description
919
+
920
+ Calculate and display statistics about your hunts, including success rates, true positive/false positive ratios, and hunt velocity.
921
+
922
+ ### Options
923
+
924
+ | Option | Type | Default | Description |
925
+ |--------|------|---------|-------------|
926
+ | `--period` | Choice | all | Time period: `all`, `30d`, `90d`, `1y` |
927
+ | `--output` | Choice | table | Output format: `table`, `json`, `yaml` |
928
+
929
+ ### Examples
930
+
931
+ **Overall statistics**:
932
+
933
+ ```bash
934
+ athf hunt stats
935
+ ```
936
+
937
+ Output:
938
+ ```
939
+ Hunt Statistics
940
+ ───────────────────────────────────────
941
+ Total Hunts: 23
942
+ Completed: 15 (65%)
943
+ In Progress: 5 (22%)
944
+ Paused: 2 (9%)
945
+ Archived: 1 (4%)
946
+
947
+ Success Metrics
948
+ ───────────────────────────────────────
949
+ Hunts with Findings: 12 (80% of completed)
950
+ True Positives: 18
951
+ False Positives: 7
952
+ TP/FP Ratio: 2.6:1
953
+
954
+ Average per Hunt
955
+ ───────────────────────────────────────
956
+ True Positives: 1.2
957
+ False Positives: 0.5
958
+ Time to Complete: 4.2 days
959
+
960
+ Coverage
961
+ ───────────────────────────────────────
962
+ Unique Techniques: 15
963
+ Unique Tactics: 8
964
+ Platforms Covered: 4 (Windows, Linux, macOS, AWS)
965
+ ```
966
+
967
+ **Last 30 days**:
968
+
969
+ ```bash
970
+ athf hunt stats --period 30d
971
+ ```
972
+
973
+ **JSON output**:
974
+
975
+ ```bash
976
+ athf hunt stats --output json
977
+ ```
978
+
979
+ Output:
980
+ ```json
981
+ {
982
+ "total_hunts": 23,
983
+ "completed": 15,
984
+ "in_progress": 5,
985
+ "success_rate": 0.80,
986
+ "true_positives": 18,
987
+ "false_positives": 7,
988
+ "tp_fp_ratio": 2.6,
989
+ "unique_techniques": 15,
990
+ "unique_tactics": 8
991
+ }
992
+ ```
993
+
994
+ ### Exit Codes
995
+
996
+ - `0`: Success
997
+ - `1`: No hunts found
998
+
999
+ ---
1000
+
1001
+ ## athf hunt search
1002
+
1003
+ Full-text search across all hunts.
1004
+
1005
+ ### Synopsis
1006
+
1007
+ ```bash
1008
+ athf hunt search QUERY [OPTIONS]
1009
+ ```
1010
+
1011
+ ### Description
1012
+
1013
+ Search hunt content (including frontmatter, LOCK sections, queries, and findings) for a specific term or phrase.
1014
+
1015
+ ### Arguments
1016
+
1017
+ | Argument | Type | Description |
1018
+ |----------|------|-------------|
1019
+ | `QUERY` | String | Search query (supports regex) |
1020
+
1021
+ ### Options
1022
+
1023
+ | Option | Type | Default | Description |
1024
+ |--------|------|---------|-------------|
1025
+ | `--case-sensitive` | Flag | False | Enable case-sensitive search |
1026
+ | `--regex` | Flag | False | Treat query as regex pattern |
1027
+ | `--output` | Choice | table | Output format: `table`, `json`, `yaml` |
1028
+
1029
+ ### Examples
1030
+
1031
+ **Simple search**:
1032
+
1033
+ ```bash
1034
+ athf hunt search kerberoasting
1035
+ ```
1036
+
1037
+ Output:
1038
+ ```
1039
+ Found 3 matches:
1040
+
1041
+ H-0002: Kerberoasting Detection via Unusual TGS Requests
1042
+ Match in LEARN section:
1043
+ "...technique to detect kerberoasting attacks by identifying unusual..."
1044
+
1045
+ H-0008: Service Account Reconnaissance
1046
+ Match in OBSERVE section:
1047
+ "...similar patterns to kerberoasting but focuses on enumeration..."
1048
+
1049
+ H-0012: Golden Ticket Detection
1050
+ Match in title:
1051
+ "Kerberoasting and Golden Ticket Detection"
1052
+ ```
1053
+
1054
+ **Search for technique ID**:
1055
+
1056
+ ```bash
1057
+ athf hunt search "T1003.001"
1058
+ ```
1059
+
1060
+ **Regex search**:
1061
+
1062
+ ```bash
1063
+ athf hunt search "lsass|mimikatz|procdump" --regex
1064
+ ```
1065
+
1066
+ **Case-sensitive search**:
1067
+
1068
+ ```bash
1069
+ athf hunt search "LSASS" --case-sensitive
1070
+ ```
1071
+
1072
+ **JSON output**:
1073
+
1074
+ ```bash
1075
+ athf hunt search kerberoasting --output json
1076
+ ```
1077
+
1078
+ Output:
1079
+ ```json
1080
+ [
1081
+ {
1082
+ "hunt_id": "H-0002",
1083
+ "title": "Kerberoasting Detection",
1084
+ "matches": [
1085
+ {
1086
+ "section": "LEARN",
1087
+ "line": 15,
1088
+ "context": "...technique to detect kerberoasting attacks..."
1089
+ }
1090
+ ]
1091
+ }
1092
+ ]
1093
+ ```
1094
+
1095
+ ### Exit Codes
1096
+
1097
+ - `0`: Matches found
1098
+ - `1`: No matches found
1099
+
1100
+ ---
1101
+
1102
+ ## athf hunt coverage
1103
+
1104
+ Show MITRE ATT&CK technique coverage across hunts with visual progress bars.
1105
+
1106
+ ### Synopsis
1107
+
1108
+ ```bash
1109
+ athf hunt coverage [OPTIONS]
1110
+ ```
1111
+
1112
+ ### Description
1113
+
1114
+ Displays a comprehensive visual coverage heatmap of all 14 MITRE ATT&CK tactics, showing which techniques you've hunted and which represent blind spots. Uses progress bars to visualize coverage percentage per tactic.
1115
+
1116
+ **Features:**
1117
+ - Visual progress bars for all 14 ATT&CK tactics
1118
+ - Coverage percentages (X/Y techniques covered)
1119
+ - Overall coverage statistic across the entire matrix
1120
+ - Detailed view showing technique-to-hunt mapping
1121
+
1122
+ **Use Cases:**
1123
+ - Identify blind spots in your hunting program
1124
+ - Prioritize future hunt topics
1125
+ - Demonstrate coverage to stakeholders
1126
+ - Align hunting with threat intelligence priorities
1127
+ - Balance hunt portfolio across tactics
1128
+
1129
+ ### Options
1130
+
1131
+ | Option | Type | Default | Description |
1132
+ |--------|------|---------|-------------|
1133
+ | `--detailed` | Flag | False | Show detailed technique coverage with hunt references |
1134
+
1135
+ ### Examples
1136
+
1137
+ **Show coverage heatmap:**
1138
+
1139
+ ```bash
1140
+ athf hunt coverage
1141
+ ```
1142
+
1143
+ **Output:**
1144
+ ```
1145
+ MITRE ATT&CK Coverage
1146
+ ──────────────────────────────────────────────────────────────────────
1147
+
1148
+ Reconnaissance ░░░░░░░░░░░░░░░░░░░░ 0/10 techniques (0%)
1149
+ Resource Development ░░░░░░░░░░░░░░░░░░░░ 0/7 techniques (0%)
1150
+ Initial Access ░░░░░░░░░░░░░░░░░░░░ 0/9 techniques (0%)
1151
+ Execution ░░░░░░░░░░░░░░░░░░░░ 0/12 techniques (0%)
1152
+ Persistence ███████░░░░░░░░░░░░░ 7/19 techniques (37%)
1153
+ Privilege Escalation ████░░░░░░░░░░░░░░░░ 3/13 techniques (23%)
1154
+ Defense Evasion ░░░░░░░░░░░░░░░░░░░░ 0/42 techniques (0%)
1155
+ Credential Access ░░░░░░░░░░░░░░░░░░░░ 0/15 techniques (0%)
1156
+ Discovery ░░░░░░░░░░░░░░░░░░░░ 0/30 techniques (0%)
1157
+ Lateral Movement ░░░░░░░░░░░░░░░░░░░░ 0/9 techniques (0%)
1158
+ Collection ███░░░░░░░░░░░░░░░░░ 3/17 techniques (18%)
1159
+ Command and Control ░░░░░░░░░░░░░░░░░░░░ 0/16 techniques (0%)
1160
+ Exfiltration ░░░░░░░░░░░░░░░░░░░░ 0/9 techniques (0%)
1161
+ Impact ░░░░░░░░░░░░░░░░░░░░ 0/13 techniques (0%)
1162
+
1163
+ Overall: 10/221 techniques (5%)
1164
+ ```
1165
+
1166
+ **Show detailed technique breakdown:**
1167
+
1168
+ ```bash
1169
+ athf hunt coverage --detailed
1170
+ ```
1171
+
1172
+ **Detailed Output:**
1173
+ ```
1174
+ 🔍 Detailed Technique Coverage
1175
+
1176
+ Persistence (2 hunts, 7 unique techniques)
1177
+ • T1027 - H-0002
1178
+ • T1053.003 - H-0002
1179
+ • T1059.004 - H-0002
1180
+ • T1071.001 - H-0002
1181
+ • T1078.004 - H-0003
1182
+ • T1098 - H-0003
1183
+ • T1546.004 - H-0003
1184
+
1185
+ Collection (1 hunts, 3 unique techniques)
1186
+ • T1005 - H-0001
1187
+ • T1059.002 - H-0001
1188
+ • T1555.003 - H-0001
1189
+ ```
1190
+
1191
+ ### Progress Bar Legend
1192
+
1193
+ - `█` = Covered technique
1194
+ - `░` = Uncovered technique (blind spot)
1195
+
1196
+ ### Exit Codes
1197
+
1198
+ - `0`: Success
1199
+ - `1`: No hunts found
1200
+
1201
+ ---
1202
+
1203
+ ## athf investigate new
1204
+
1205
+ Create a new investigation file for exploratory work and ad-hoc analysis.
1206
+
1207
+ ### Synopsis
1208
+
1209
+ ```bash
1210
+ athf investigate new [OPTIONS]
1211
+ ```
1212
+
1213
+ ### Description
1214
+
1215
+ Creates investigation files for work that should NOT be tracked in hunt metrics. Investigations are perfect for alert triage, data source baselining, query sandboxing, and exploratory analysis. Investigations use a flexible LOCK structure and can be promoted to formal hunts if they prove valuable.
1216
+
1217
+ **When to use investigations:**
1218
+ - Alert triage and finding investigation
1219
+ - Baseline new data sources
1220
+ - Explore query logic before formal hunt
1221
+ - Ad-hoc analysis without metrics pollution
1222
+ - Sandbox work for uncertain hypotheses
1223
+
1224
+ **Key differences from hunts:**
1225
+ - NOT tracked in metrics (no TP/FP counts)
1226
+ - Flexible LOCK structure (sections optional)
1227
+ - Lightweight validation
1228
+ - Can be promoted to formal hunts
1229
+
1230
+ ### Options
1231
+
1232
+ | Option | Type | Default | Description |
1233
+ |--------|------|---------|-------------|
1234
+ | `--title` | String | Required* | Investigation title |
1235
+ | `--type` | Choice | exploratory | Type: `finding`, `baseline`, `exploratory`, `other` |
1236
+ | `--tags` | String | - | Comma-separated tags (e.g., alert-triage,powershell) |
1237
+ | `--data-source` | String | - | Data sources (can specify multiple with multiple flags) |
1238
+ | `--related-hunt` | String | - | Related hunt IDs (can specify multiple with multiple flags) |
1239
+ | `--investigator` | String | ATHF | Investigator name |
1240
+ | `--non-interactive` | Flag | False | Skip interactive prompts |
1241
+
1242
+ \* Required in non-interactive mode
1243
+
1244
+ ### Examples
1245
+
1246
+ **Interactive mode** (recommended):
1247
+
1248
+ ```bash
1249
+ athf investigate new
1250
+ ```
1251
+
1252
+ **Non-interactive with all options:**
1253
+
1254
+ ```bash
1255
+ athf investigate new \
1256
+ --title "Alert Triage - PowerShell Execution" \
1257
+ --type finding \
1258
+ --tags alert-triage,powershell,customer-x \
1259
+ --data-source "EDR Telemetry" \
1260
+ --data-source "ClickHouse" \
1261
+ --related-hunt H-0013 \
1262
+ --investigator "Jane Doe" \
1263
+ --non-interactive
1264
+ ```
1265
+
1266
+ **Create baseline investigation:**
1267
+
1268
+ ```bash
1269
+ athf investigate new \
1270
+ --title "Baseline AWS CloudTrail Events" \
1271
+ --type baseline \
1272
+ --tags baseline,cloudtrail,aws \
1273
+ --data-source "CloudTrail" \
1274
+ --non-interactive
1275
+ ```
1276
+
1277
+ **Create exploratory investigation:**
1278
+
1279
+ ```bash
1280
+ athf investigate new \
1281
+ --title "Credential Access Pattern Exploration" \
1282
+ --type exploratory \
1283
+ --tags sandbox,credential-access \
1284
+ --non-interactive
1285
+ ```
1286
+
1287
+ ### Output
1288
+
1289
+ ```
1290
+ 🔍 Creating new investigation
1291
+
1292
+ Investigation ID: I-0001
1293
+
1294
+ ✅ Created I-0001: Alert Triage - PowerShell Execution
1295
+
1296
+ Next steps:
1297
+ 1. Edit investigations/I-0001.md to document your investigation
1298
+ 2. Use LOCK pattern sections (optional/flexible)
1299
+ 3. View all investigations: athf investigate list
1300
+ 4. Promote to hunt if valuable: athf investigate promote I-0001
1301
+ ```
1302
+
1303
+ ### Generated File Structure
1304
+
1305
+ ```yaml
1306
+ ---
1307
+ investigation_id: I-0001
1308
+ title: "Alert Triage - PowerShell Execution"
1309
+ date: 2025-12-17
1310
+ investigator: "Jane Doe"
1311
+ type: finding
1312
+ related_hunts:
1313
+ - H-0013
1314
+ data_sources:
1315
+ - EDR Telemetry
1316
+ - ClickHouse
1317
+ tags:
1318
+ - alert-triage
1319
+ - powershell
1320
+ - customer-x
1321
+ ---
1322
+
1323
+ # I-0001: Alert Triage - PowerShell Execution
1324
+
1325
+ ...LOCK sections (optional)...
1326
+ ```
1327
+
1328
+ ### Exit Codes
1329
+
1330
+ - `0`: Success
1331
+ - `1`: Missing required options (non-interactive mode)
1332
+
1333
+ ---
1334
+
1335
+ ## athf investigate list
1336
+
1337
+ List all investigations with optional filtering.
1338
+
1339
+ ### Synopsis
1340
+
1341
+ ```bash
1342
+ athf investigate list [OPTIONS]
1343
+ ```
1344
+
1345
+ ### Description
1346
+
1347
+ Display all investigations in a formatted table. Supports filtering by type, tags, and multiple output formats.
1348
+
1349
+ ### Options
1350
+
1351
+ | Option | Type | Default | Description |
1352
+ |--------|------|---------|-------------|
1353
+ | `--type` | Choice | - | Filter by type: `finding`, `baseline`, `exploratory`, `other` |
1354
+ | `--tags` | String | - | Filter by tags (comma-separated) |
1355
+ | `--output` | Choice | table | Output format: `table`, `json`, `yaml` |
1356
+
1357
+ ### Examples
1358
+
1359
+ **List all investigations:**
1360
+
1361
+ ```bash
1362
+ athf investigate list
1363
+ ```
1364
+
1365
+ Output:
1366
+ ```
1367
+ Investigations
1368
+ ╭──────┬─────────────────┬─────────────┬──────────────┬────────────╮
1369
+ │ ID │ Title │ Type │ Tags │ Date │
1370
+ ├──────┼─────────────────┼─────────────┼──────────────┼────────────┤
1371
+ │ I-01 │ Alert Triage │ finding │ alert-triage │ 2025-12-17 │
1372
+ │ I-02 │ CloudTrail │ baseline │ baseline,aws │ 2025-12-17 │
1373
+ │ │ Baseline │ │ │ │
1374
+ │ I-03 │ Credential │ exploratory │ sandbox │ 2025-12-17 │
1375
+ │ │ Patterns │ │ │ │
1376
+ ╰──────┴─────────────────┴─────────────┴──────────────┴────────────╯
1377
+
1378
+ Total: 3 investigations
1379
+ ```
1380
+
1381
+ **Filter by type:**
1382
+
1383
+ ```bash
1384
+ athf investigate list --type finding
1385
+ ```
1386
+
1387
+ **Filter by tags:**
1388
+
1389
+ ```bash
1390
+ athf investigate list --tags alert-triage
1391
+ ```
1392
+
1393
+ **JSON output:**
1394
+
1395
+ ```bash
1396
+ athf investigate list --output json
1397
+ ```
1398
+
1399
+ Output:
1400
+ ```json
1401
+ [
1402
+ {
1403
+ "file_path": "investigations/I-0001.md",
1404
+ "investigation_id": "I-0001",
1405
+ "frontmatter": {
1406
+ "investigation_id": "I-0001",
1407
+ "title": "Alert Triage - PowerShell Execution",
1408
+ "date": "2025-12-17",
1409
+ "type": "finding",
1410
+ "tags": ["alert-triage", "powershell"]
1411
+ }
1412
+ }
1413
+ ]
1414
+ ```
1415
+
1416
+ ### Exit Codes
1417
+
1418
+ - `0`: Success
1419
+ - `1`: No investigations directory found
1420
+
1421
+ ---
1422
+
1423
+ ## athf investigate search
1424
+
1425
+ Full-text search across all investigation files.
1426
+
1427
+ ### Synopsis
1428
+
1429
+ ```bash
1430
+ athf investigate search QUERY
1431
+ ```
1432
+
1433
+ ### Description
1434
+
1435
+ Performs full-text search across all investigation files, including frontmatter, LOCK sections, and findings.
1436
+
1437
+ ### Arguments
1438
+
1439
+ | Argument | Type | Description |
1440
+ |----------|------|-------------|
1441
+ | `QUERY` | String | Search query (case-insensitive) |
1442
+
1443
+ ### Examples
1444
+
1445
+ **Search for PowerShell:**
1446
+
1447
+ ```bash
1448
+ athf investigate search "PowerShell"
1449
+ ```
1450
+
1451
+ Output:
1452
+ ```
1453
+ Found 2 investigation(s) matching "PowerShell":
1454
+
1455
+ I-0001: Alert Triage - PowerShell Execution
1456
+ investigations/I-0001.md
1457
+
1458
+ I-0005: Process Execution Baseline
1459
+ investigations/I-0005.md
1460
+ ```
1461
+
1462
+ **Search for customer-specific findings:**
1463
+
1464
+ ```bash
1465
+ athf investigate search "customer-x"
1466
+ ```
1467
+
1468
+ **Search for baseline work:**
1469
+
1470
+ ```bash
1471
+ athf investigate search "baseline CloudTrail"
1472
+ ```
1473
+
1474
+ ### Exit Codes
1475
+
1476
+ - `0`: Matches found
1477
+ - `1`: No matches found
1478
+
1479
+ ---
1480
+
1481
+ ## athf investigate validate
1482
+
1483
+ Validate investigation file structure.
1484
+
1485
+ ### Synopsis
1486
+
1487
+ ```bash
1488
+ athf investigate validate INVESTIGATION_ID
1489
+ ```
1490
+
1491
+ ### Description
1492
+
1493
+ Validates investigation files against the ATHF format specification. Uses lightweight validation checking only minimal required fields. Does NOT validate LOCK sections (which are optional/flexible for investigations) or findings counts.
1494
+
1495
+ ### Arguments
1496
+
1497
+ | Argument | Type | Description |
1498
+ |----------|------|-------------|
1499
+ | `INVESTIGATION_ID` | String | Investigation to validate (e.g., I-0001) |
1500
+
1501
+ ### Examples
1502
+
1503
+ **Validate specific investigation:**
1504
+
1505
+ ```bash
1506
+ athf investigate validate I-0001
1507
+ ```
1508
+
1509
+ Output (success):
1510
+ ```
1511
+ ✅ I-0001 is valid
1512
+ ```
1513
+
1514
+ Output (errors):
1515
+ ```
1516
+ ❌ I-0001 has validation errors:
1517
+ • Missing required frontmatter field: title
1518
+ • Invalid investigation_id format: I-001 (expected format: I-0001)
1519
+ ```
1520
+
1521
+ ### Validation Rules
1522
+
1523
+ **Required frontmatter fields** (minimal):
1524
+ - `investigation_id`
1525
+ - `title`
1526
+ - `date`
1527
+
1528
+ **Investigation ID format:**
1529
+ - Pattern: `I-0001` (I- prefix + 4 digits)
1530
+ - Must match filename
1531
+
1532
+ **Type values** (if present):
1533
+ - Must be one of: `finding`, `baseline`, `exploratory`, `other`
1534
+
1535
+ **Note:** Unlike hunt validation, investigation validation is lightweight and does NOT check:
1536
+ - LOCK section structure (sections are optional/flexible)
1537
+ - Findings counts (investigations not tracked in metrics)
1538
+ - Tactics/techniques (optional metadata)
1539
+
1540
+ ### Exit Codes
1541
+
1542
+ - `0`: Investigation valid
1543
+ - `1`: Validation errors found
1544
+
1545
+ ---
1546
+
1547
+ ## athf investigate promote
1548
+
1549
+ Promote investigation to formal hunt with hunt-required metadata.
1550
+
1551
+ ### Synopsis
1552
+
1553
+ ```bash
1554
+ athf investigate promote INVESTIGATION_ID [OPTIONS]
1555
+ ```
1556
+
1557
+ ### Description
1558
+
1559
+ Converts an investigation to a formal hunt, adding hunt-required metadata (tactics, techniques, platform) and enabling metrics tracking. The investigation file remains in the investigations directory, and both files cross-reference each other.
1560
+
1561
+ **What promotion does:**
1562
+ 1. Creates new hunt file (H-XXXX.md) in hunts/ directory
1563
+ 2. Copies investigation content to hunt file
1564
+ 3. Adds required hunt metadata (tactics, techniques, platform)
1565
+ 4. Adds hunt tracking fields (findings_count, true_positives, false_positives)
1566
+ 5. Creates bidirectional references:
1567
+ - Hunt includes `spawned_from: I-XXXX`
1568
+ - Investigation updated with promotion note
1569
+
1570
+ ### Arguments
1571
+
1572
+ | Argument | Type | Description |
1573
+ |----------|------|-------------|
1574
+ | `INVESTIGATION_ID` | String | Investigation to promote (e.g., I-0001) |
1575
+
1576
+ ### Options
1577
+
1578
+ | Option | Type | Default | Description |
1579
+ |--------|------|---------|-------------|
1580
+ | `--technique` | String | Required* | MITRE ATT&CK technique (e.g., T1003.001) |
1581
+ | `--tactic` | String | - | MITRE tactics (can specify multiple with multiple flags) |
1582
+ | `--platform` | String | - | Target platforms (can specify multiple with multiple flags) |
1583
+ | `--status` | Choice | in-progress | Hunt status: `planning`, `in-progress`, `completed`, `archived` |
1584
+ | `--non-interactive` | Flag | False | Skip interactive prompts |
1585
+
1586
+ \* Required in non-interactive mode
1587
+
1588
+ ### Examples
1589
+
1590
+ **Interactive promotion** (prompts for details):
1591
+
1592
+ ```bash
1593
+ athf investigate promote I-0042
1594
+ ```
1595
+
1596
+ **Non-interactive with all options:**
1597
+
1598
+ ```bash
1599
+ athf investigate promote I-0042 \
1600
+ --technique T1059.001 \
1601
+ --tactic execution \
1602
+ --tactic defense-evasion \
1603
+ --platform Windows \
1604
+ --status in-progress \
1605
+ --non-interactive
1606
+ ```
1607
+
1608
+ ### Output
1609
+
1610
+ ```
1611
+ 🔄 Promoting investigation to hunt
1612
+
1613
+ Investigation: I-0042 - PowerShell Execution Analysis
1614
+
1615
+ Hunt ID: H-0023
1616
+
1617
+ ✅ Promoted I-0042 to H-0023
1618
+ Updated investigations/I-0042.md with promotion note
1619
+
1620
+ Next steps:
1621
+ 1. Edit hunts/H-0023.md to refine hunt hypothesis
1622
+ 2. Add MITRE ATT&CK coverage if needed
1623
+ 3. Validate hunt: athf hunt validate H-0023
1624
+ 4. View hunt: athf hunt list --status in-progress
1625
+ ```
1626
+
1627
+ ### After Promotion
1628
+
1629
+ - **Hunt file created:** hunts/H-0023.md (tracked in metrics)
1630
+ - **Investigation updated:** investigations/I-0042.md (promotion note added)
1631
+ - **Investigation remains:** Still NOT tracked in metrics
1632
+ - **Cross-references:** Both files link to each other
1633
+
1634
+ ### Exit Codes
1635
+
1636
+ - `0`: Success
1637
+ - `1`: Investigation not found or parsing error
1638
+ - `2`: Missing required options (non-interactive mode)
1639
+
1640
+ ---
1641
+
1642
+ ## Configuration
1643
+
1644
+ ATHF uses `.athfconfig.yaml` for configuration:
1645
+
1646
+ ```yaml
1647
+ # SIEM platform
1648
+ siem: splunk # Options: splunk, sentinel, elastic
1649
+
1650
+ # EDR platform
1651
+ edr: crowdstrike # Options: crowdstrike, sentinelone, defender
1652
+
1653
+ # Hunt ID prefix
1654
+ hunt_prefix: H # Generates: H-0001, H-0002, etc.
1655
+
1656
+ # Default data retention
1657
+ retention_days: 90
1658
+
1659
+ # Metadata (auto-generated)
1660
+ initialized: 2025-12-02T14:30:00
1661
+ version: 0.2.1
1662
+ ```
1663
+
1664
+ ### Environment Variables
1665
+
1666
+ | Variable | Description | Default |
1667
+ |----------|-------------|---------|
1668
+ | `ATHF_CONFIG` | Path to config file | `.athfconfig.yaml` |
1669
+ | `ATHF_HUNTS_DIR` | Path to hunts directory | `./hunts` |
1670
+ | `ATHF_TEMPLATE_DIR` | Path to templates | `./templates` |
1671
+
1672
+ Example:
1673
+
1674
+ ```bash
1675
+ export ATHF_HUNTS_DIR="/opt/threat-hunting/hunts"
1676
+ athf hunt list
1677
+ ```
1678
+
1679
+ ---
1680
+
1681
+ ## Exit Codes
1682
+
1683
+ All `athf` commands use standard exit codes:
1684
+
1685
+ | Code | Meaning |
1686
+ |------|---------|
1687
+ | `0` | Success |
1688
+ | `1` | General error (file not found, validation failed, etc.) |
1689
+ | `2` | Invalid arguments or options |
1690
+ | `130` | Interrupted by user (Ctrl+C) |
1691
+
1692
+ Use in scripts:
1693
+
1694
+ ```bash
1695
+ if athf hunt validate H-0001; then
1696
+ echo "Hunt is valid"
1697
+ else
1698
+ echo "Hunt has errors"
1699
+ exit 1
1700
+ fi
1701
+ ```
1702
+
1703
+ ---
1704
+
1705
+ ## Tips and Tricks
1706
+
1707
+ ### Use with Grep and Awk
1708
+
1709
+ ```bash
1710
+ # List only completed hunts
1711
+ athf hunt list --output json | jq '.[] | select(.status=="completed")'
1712
+
1713
+ # Count hunts by tactic
1714
+ athf hunt list --output json | jq -r '.[].tactics[]' | sort | uniq -c
1715
+
1716
+ # Find high-severity hunts
1717
+ athf hunt list --output json | jq '.[] | select(.severity=="high")'
1718
+ ```
1719
+
1720
+ ### Automation with Shell Scripts
1721
+
1722
+ ```bash
1723
+ #!/bin/bash
1724
+ # Create weekly hunt report
1725
+
1726
+ WEEK=$(date +%Y-W%V)
1727
+ REPORT="reports/hunt-report-$WEEK.md"
1728
+
1729
+ echo "# Weekly Hunt Report - $WEEK" > "$REPORT"
1730
+ echo "" >> "$REPORT"
1731
+
1732
+ echo "## Statistics" >> "$REPORT"
1733
+ athf hunt stats --period 7d >> "$REPORT"
1734
+
1735
+ echo "" >> "$REPORT"
1736
+ echo "## Completed Hunts" >> "$REPORT"
1737
+ athf hunt list --status completed --output json | \
1738
+ jq -r '.[] | "- \(.hunt_id): \(.title)"' >> "$REPORT"
1739
+
1740
+ echo "Report generated: $REPORT"
1741
+ ```
1742
+
1743
+ ### CI/CD Integration
1744
+
1745
+ ```yaml
1746
+ # .github/workflows/validate-hunts.yml
1747
+ name: Validate Hunts
1748
+
1749
+ on: [push, pull_request]
1750
+
1751
+ jobs:
1752
+ validate:
1753
+ runs-on: ubuntu-latest
1754
+ steps:
1755
+ - uses: actions/checkout@v3
1756
+ - uses: actions/setup-python@v4
1757
+ with:
1758
+ python-version: '3.9'
1759
+ - run: pip install agentic-threat-hunting-framework
1760
+ - run: athf hunt validate
1761
+ ```
1762
+
1763
+ ### Batch Operations
1764
+
1765
+ ```bash
1766
+ # Create multiple hunts from a list
1767
+ cat techniques.txt | while read tech title; do
1768
+ athf hunt new \
1769
+ --technique "$tech" \
1770
+ --title "$title" \
1771
+ --non-interactive
1772
+ done
1773
+
1774
+ # Validate all hunts and save results
1775
+ for hunt in hunts/H-*.md; do
1776
+ hunt_id=$(basename "$hunt" .md)
1777
+ athf hunt validate "$hunt_id" 2>&1 | tee "validation-$hunt_id.log"
1778
+ done
1779
+ ```
1780
+
1781
+ ---
1782
+
1783
+ ## See Also
1784
+
1785
+ - [Getting Started Guide](getting-started.md)
1786
+ - [Installation Guide](INSTALL.md)
1787
+ - [Hunt Format Guidelines](../hunts/FORMAT_GUIDELINES.md)
1788
+ - [MITRE ATT&CK Framework](https://attack.mitre.org/)
1789
+
1790
+ ---
1791
+
1792
+ ## Need Help?
1793
+
1794
+ - **CLI help**: `athf --help` or `athf <command> --help`
1795
+ - **GitHub Issues**: [Report bugs or request features](https://github.com/Nebulock-Inc/agentic-threat-hunting-framework/issues)
1796
+ - **Discussions**: [Ask questions and share ideas](https://github.com/Nebulock-Inc/agentic-threat-hunting-framework/discussions)
1797
+ - **Documentation**: [docs/getting-started.md](getting-started.md)