Skip to content

Commit 12c3eac

Browse files
DavidJBiancoclaude
andcommitted
Add GROUND_TRUTH.md feature specification to PRD and TODO
Adds comprehensive specification for attack ground truth documentation: - Auto-generated GROUND_TRUTH.md in output directory for scenarios with malicious activity - Three-section format: Attack Summary (narrative), Timeline (key events with timestamps/record IDs), IOCs (atomic indicators grouped by type) - Integration into generation engine (Phase 1.7) and evaluation framework (Phase 3.4) - Validation of IOC presence during evaluation phase This provides ground truth for threat hunting training exercises and enables verification that detection rules capture malicious activity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eaec3fc commit 12c3eac

2 files changed

Lines changed: 106 additions & 2 deletions

File tree

TODO.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,17 @@
7777
- [ ] Basic baseline activity generation (fixed patterns, no LLM)
7878
- [ ] Simple storyline execution
7979
- [ ] Coordinate emitters for cross-log consistency
80+
- [ ] Generate GROUND_TRUTH.md when malicious activities present
8081
- [ ] `generation/activity.py` - Activity execution logic
82+
- [ ] `generation/ground_truth.py` - Ground truth documentation generator
83+
- [ ] Extract attack narrative from storyline
84+
- [ ] Build timeline of key malicious events with timestamps and record IDs
85+
- [ ] Collect atomic IOCs (IPs, usernames, hostnames, processes, file paths, command lines)
86+
- [ ] Write formatted GROUND_TRUTH.md
8187
- [ ] Test: Small scenario end-to-end (<1000 events)
8288
- [ ] Test: Cross-log consistency (LogonIDs, PIDs match)
89+
- [ ] Test: GROUND_TRUTH.md generation for attack scenarios
90+
- [ ] Test: No GROUND_TRUTH.md for baseline-only scenarios
8391

8492
### 1.8 CLI Framework (Basic Commands)
8593

@@ -251,15 +259,18 @@
251259
- [ ] Cross-reference consistency (100% resolution)
252260
- [ ] Statistical properties (event distributions, logon/logoff balance within 5%)
253261
- [ ] Completeness (no orphaned references)
262+
- [ ] Ground truth validation (if GROUND_TRUTH.md exists, verify all IOCs present)
254263
- [ ] `evaluation/evaluator.py` - Main evaluation logic
255264
- [ ] `evaluation/report.py` - JSON report generation
256265
- [ ] Command: `forge evaluate` - Evaluate generated logs
257266
- [ ] Load logs from output directory
258267
- [ ] Run all metrics
268+
- [ ] Validate GROUND_TRUTH.md IOCs if present
259269
- [ ] Generate report (JSON)
260270
- [ ] --verbose flag for detailed findings
261271
- [ ] Test: Metrics calculation
262272
- [ ] Test: Report generation
273+
- [ ] Test: Ground truth IOC validation
263274

264275
### 3.5 Pre-Built Persona Library
265276

docs/PRD.md

Lines changed: 95 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The tool addresses the need for realistic, large-volume training datasets withou
3434
- Checkpointing for long-running generation jobs
3535
- Schema validation and LLM-based semantic validation with interactive repair
3636
- Optional realism evaluation with concrete metrics
37+
- Ground truth documentation (GROUND_TRUTH.md) for scenarios with malicious activity: attack narrative, timeline, atomic IOCs
3738
- Comprehensive test coverage (95%+) with pytest
3839
- Ship with pre-built persona library to reduce LLM usage
3940
- Flexible timezone handling (UTC internal, configurable per-system/format for output)
@@ -146,6 +147,10 @@ log-generator generate SCENARIO_FILE [--output DIR] [--resume]
146147
11. Show progress bar with ETA (based on moving average of last 10% progress)
147148
12. Log details to generation.log in output directory
148149
13. Create checkpoint files every 5 minutes (or 100K events) for resume capability
150+
14. Generate GROUND_TRUTH.md file when malicious/suspicious activities are present:
151+
- Attack narrative summary (malicious activities only, excludes benign baseline)
152+
- Timeline of key malicious events with timestamps and optional record IDs
153+
- Atomic IOCs grouped by type (IP addresses, usernames, hostnames, processes, file paths, command lines, etc.)
149154

150155
#### Workflow 5: Evaluate Output
151156
```bash
@@ -157,8 +162,9 @@ log-generator evaluate OUTPUT_DIR
157162
- Consistency (cross-references resolve correctly)
158163
- Statistical properties (distributions, timing patterns)
159164
- Completeness (no orphaned references)
160-
3. Generate report with scores and specific findings
161-
4. Optional: Save report for comparison across runs
165+
3. If GROUND_TRUTH.md exists, validate that all documented IOCs are present in logs
166+
4. Generate report with scores and specific findings
167+
5. Optional: Save report for comparison across runs
162168

163169
### 4.2 Data Model
164170

@@ -426,6 +432,92 @@ class GeneratorState:
426432
checkpoint_data: dict # For resume capability
427433
```
428434

435+
#### Output Files
436+
437+
**Directory Structure**
438+
439+
Generated logs are written to a timestamped output directory:
440+
```
441+
output/
442+
scenario-name-YYYYMMDD-HHMMSS/
443+
generation.log # Detailed generation log
444+
GROUND_TRUTH.md # Attack ground truth (if malicious activity present)
445+
windows_events.xml # Windows Event Logs
446+
zeek_conn.log # Zeek connection logs
447+
syslog.log # Linux syslogs
448+
snort_alerts.log # Snort/Suricata alerts
449+
web_access.log # Web/proxy logs
450+
.checkpoints/ # Resume checkpoints (deleted on success)
451+
```
452+
453+
**GROUND_TRUTH.md Format**
454+
455+
When a scenario includes malicious or suspicious activities (not baseline-only scenarios), the generator creates a GROUND_TRUTH.md file documenting the attack for training and evaluation purposes.
456+
457+
```markdown
458+
# Ground Truth: [Scenario Name]
459+
460+
Generated: YYYY-MM-DD HH:MM:SS UTC
461+
Time Window: [start] to [end]
462+
463+
## Attack Summary
464+
465+
[Narrative description of the malicious/suspicious activities. Excludes benign baseline
466+
activity. Describes the attack from initial access through objectives, including
467+
techniques used, systems compromised, data accessed, etc.]
468+
469+
## Timeline
470+
471+
Chronological sequence of key malicious events. Each entry includes:
472+
- Timestamp (ISO 8601 format)
473+
- Optional record ID (EventRecordID, UID, line number) if applicable
474+
- Human-readable description with relevant context
475+
476+
Format:
477+
YYYY-MM-DDTHH:MM:SS.ssssssZ [RecordID: 12345] - Description with IOCs
478+
479+
Example:
480+
2024-01-15T10:23:45.123456Z [EventRecordID: 12345] - Initial access: Threat actor logged in to WIN-TEST-01 as CORP\jdoe from source IP 203.0.113.50
481+
2024-01-15T10:24:12.789012Z - C2 communication: Outbound connection from 192.168.1.100 to C2 server 198.51.100.45:443
482+
2024-01-15T10:25:03.456789Z [EventRecordID: 12389] - Credential dumping: Process mimikatz.exe (PID 4532) executed by CORP\jdoe
483+
484+
## Indicators of Compromise (IOCs)
485+
486+
Atomic indicators that can be searched for in the logs to identify malicious activity.
487+
Grouped by type for easy reference.
488+
489+
### Network Indicators
490+
- Attacker IP addresses: 203.0.113.50, 198.51.100.45
491+
- C2 domains: evil-c2.example.com, malware-download.net
492+
- C2 IP:Port combinations: 198.51.100.45:443, 198.51.100.45:8080
493+
494+
### User Accounts
495+
- Compromised accounts: CORP\jdoe, CORP\admin-backup
496+
- Created accounts: CORP\backdoor-admin
497+
498+
### Host Indicators
499+
- Compromised systems: WIN-TEST-01, WIN-TEST-05, DC-01
500+
- Malicious processes: mimikatz.exe, nc.exe, evil-payload.exe
501+
- Process IDs: 4532 (mimikatz.exe), 5123 (nc.exe)
502+
- File paths: C:\Temp\mimikatz.exe, C:\Users\jdoe\Downloads\payload.exe
503+
- Command lines: "mimikatz.exe privilege::debug sekurlsa::logonpasswords"
504+
505+
### Other Indicators
506+
- [Additional categories as relevant: registry keys, scheduled tasks, services, etc.]
507+
```
508+
509+
**Purpose:**
510+
- Provides ground truth for threat hunting training exercises
511+
- Enables validation that detection rules capture the malicious activity
512+
- Documents the attack narrative for educational purposes
513+
- Lists atomic IOCs for direct searching in SIEM/analysis tools
514+
515+
**Generation:**
516+
- Created automatically during log generation when storyline contains malicious activities
517+
- Not generated for baseline-only scenarios (no malicious activity)
518+
- IOCs extracted from actual generated events (guaranteed to be present in logs)
519+
- Timeline includes only key events (not every single malicious log entry)
520+
429521
### 4.3 CLI Interface
430522

431523
**Command: init**
@@ -507,6 +599,7 @@ Evaluates generated logs for concrete metrics:
507599
- Consistency: 100% of cross-references resolve (LogonIDs, PIDs, connection IDs)
508600
- Statistical properties: Event type distributions, logon/logoff balance (within 5%)
509601
- Completeness: No orphaned references
602+
- Ground truth validation: If GROUND_TRUTH.md exists, verify all documented IOCs are present in logs
510603

511604
Report is informational only (no pass/fail thresholds for MVP).
512605
Outputs JSON report with scores and specific findings.

0 commit comments

Comments
 (0)