|
| 1 | +# Scenario Schema Reference |
| 2 | + |
| 3 | +This document describes the EvidenceForge scenario file schema, including Phase 2.4 enhanced fields. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Scenario files are YAML documents that define the environment, users, systems, personas, and storyline for log generation. All fields marked "Phase 2.4+" are optional and backward compatible with Phase 1 scenarios. |
| 8 | + |
| 9 | +## Top-Level Structure |
| 10 | + |
| 11 | +```yaml |
| 12 | +version: "1.0" |
| 13 | +name: scenario-name # Alphanumeric, dash, underscore |
| 14 | +description: | |
| 15 | + Multi-line scenario description |
| 16 | +environment: ... |
| 17 | +personas: [...] # Optional |
| 18 | +time_window: ... |
| 19 | +baseline_activity: ... |
| 20 | +storyline: [...] # Optional |
| 21 | +output: ... |
| 22 | +``` |
| 23 | +
|
| 24 | +## Environment |
| 25 | +
|
| 26 | +```yaml |
| 27 | +environment: |
| 28 | + description: "Corporate office network" |
| 29 | + timezone: |
| 30 | + default: "America/New_York" |
| 31 | + systems: # Optional pattern-based overrides |
| 32 | + "EU-*": "Europe/London" |
| 33 | + "AP-*": "Asia/Tokyo" |
| 34 | + users: [...] |
| 35 | + systems: [...] |
| 36 | + groups: [...] # Optional |
| 37 | +``` |
| 38 | +
|
| 39 | +### Timezone Configuration |
| 40 | +
|
| 41 | +All internal timestamps are stored in UTC. The timezone configuration controls output formatting. |
| 42 | +
|
| 43 | +- **default**: Applied to all systems unless overridden (default: `"UTC"`) |
| 44 | +- **systems**: Pattern-based overrides using fnmatch glob syntax (`*`, `?`, `[seq]`) |
| 45 | + - First matching pattern wins |
| 46 | + - Unmatched hostnames use the default |
| 47 | + |
| 48 | +Valid timezone names are any [pytz timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) (e.g., `America/New_York`, `Europe/London`, `Asia/Tokyo`, `UTC`). |
| 49 | + |
| 50 | +### Users |
| 51 | + |
| 52 | +```yaml |
| 53 | +users: |
| 54 | + - username: jsmith # Required: alphanumeric, dash, underscore |
| 55 | + full_name: "Jane Smith" # Required |
| 56 | + email: jane@example.com # Required |
| 57 | + groups: ["developers"] # Optional |
| 58 | + enabled: true # Optional (default: true) |
| 59 | + persona: developer # Optional: reference to persona name |
| 60 | + primary_system: WS-01 # Optional: reference to system hostname |
| 61 | +``` |
| 62 | + |
| 63 | +### Systems |
| 64 | + |
| 65 | +```yaml |
| 66 | +systems: |
| 67 | + - hostname: WS-01 # Required: RFC 1123 compliant |
| 68 | + ip: "10.0.1.10" # Required: IPv4 or IPv6 |
| 69 | + os: "Windows 10" # Required |
| 70 | + type: workstation # Required: workstation|server|domain_controller |
| 71 | + assigned_user: jsmith # Optional: reference to username |
| 72 | + services: ["IIS"] # Optional |
| 73 | +``` |
| 74 | + |
| 75 | +## Personas |
| 76 | + |
| 77 | +Personas define user behavior patterns for activity generation. |
| 78 | + |
| 79 | +```yaml |
| 80 | +personas: |
| 81 | + - name: developer # Required: unique identifier |
| 82 | + description: "Software developer who codes and browses" # Required |
| 83 | + typical_activities: # Optional list of activity strings |
| 84 | + - coding |
| 85 | + - web_browsing |
| 86 | + work_hours: "9am-5pm" # Optional (default: "9am-5pm") |
| 87 | + application_usage: # Optional |
| 88 | + - vscode |
| 89 | + - chrome |
| 90 | + risk_profile: low # Optional: low|medium|high (default: "medium") |
| 91 | +``` |
| 92 | + |
| 93 | +### Work Hours Format |
| 94 | + |
| 95 | +The `work_hours` field supports these formats: |
| 96 | +- `"9am-5pm"` - Basic range |
| 97 | +- `"8:30am-5:30pm"` - Half-hour precision |
| 98 | +- `"9am-5pm (lunch 12pm-1pm)"` - With lunch break |
| 99 | +- `"8:30am-5:30pm (lunch 12:30pm-1:30pm)"` - Both combined |
| 100 | + |
| 101 | +Work hours are automatically parsed into a `work_hours_parsed` dict containing: |
| 102 | +- `start`: Start hour as float (e.g., 9.0, 8.5) |
| 103 | +- `end`: End hour as float (e.g., 17.0, 17.5) |
| 104 | +- `lunch`: Tuple of (start, end) if specified, else null |
| 105 | +- `hours`: List of active integer hours (excluding lunch) |
| 106 | +- `peak_hours`: Mid-morning and mid-afternoon hours |
| 107 | + |
| 108 | +### Phase 2.4+ Optional Fields |
| 109 | + |
| 110 | +These fields are for future LLM expansion (Phase 3.1) and are not required: |
| 111 | + |
| 112 | +```yaml |
| 113 | +personas: |
| 114 | + - name: developer |
| 115 | + # ... Phase 1 fields above ... |
| 116 | +
|
| 117 | + expanded_activities: # Phase 2.4+: LLM-populated activity sequences |
| 118 | + - activity_type: process_code |
| 119 | + sequence: |
| 120 | + - action: open_ide |
| 121 | + app: VS Code |
| 122 | + - action: edit_files |
| 123 | + duration_minutes: 30 |
| 124 | + temporal_pattern: morning_focus |
| 125 | + frequency: daily |
| 126 | +
|
| 127 | + activity_intensity: # Phase 2.4+: Per-activity events/hour overrides |
| 128 | + process_code: 20 |
| 129 | + connection_web: 5 |
| 130 | +``` |
| 131 | + |
| 132 | +**expanded_activities** items must have: |
| 133 | +- `activity_type` (required): Maps to baseline activity types |
| 134 | +- `sequence` (optional): List of action steps |
| 135 | +- `temporal_pattern` (optional): When this activity typically occurs |
| 136 | +- `frequency` (optional): How often (hourly, daily, weekly) |
| 137 | + |
| 138 | +## Time Window |
| 139 | + |
| 140 | +```yaml |
| 141 | +time_window: |
| 142 | + start: "2024-01-15T10:00:00Z" # Required: ISO 8601 UTC |
| 143 | + end: "2024-01-15T18:00:00Z" # Either end OR duration required |
| 144 | + duration: "8h" # Supports: "10h", "3d", "2h30m" |
| 145 | +``` |
| 146 | + |
| 147 | +## Baseline Activity |
| 148 | + |
| 149 | +```yaml |
| 150 | +baseline_activity: |
| 151 | + description: "Normal office activity" |
| 152 | + intensity: medium # low|medium|high (events/user/hour) |
| 153 | + variation: low # low|medium|high (timing variation) |
| 154 | +``` |
| 155 | + |
| 156 | +Intensity mapping: low=5, medium=15, high=40 events/user/hour. |
| 157 | + |
| 158 | +## Storyline |
| 159 | + |
| 160 | +Storyline events define specific actions at specific times. |
| 161 | + |
| 162 | +```yaml |
| 163 | +storyline: |
| 164 | + - time: "+2h30m" # Required: ISO 8601, relative offset, or seconds |
| 165 | + actor: attacker # Required: username or "attacker" |
| 166 | + system: WS-01 # Required: system hostname |
| 167 | + activity: "lateral movement" # Required: activity description |
| 168 | + details: # Optional: activity-specific details |
| 169 | + target_ip: "10.0.1.20" |
| 170 | + method: "pass-the-hash" |
| 171 | +``` |
| 172 | + |
| 173 | +### Phase 2.4+ Optional Fields |
| 174 | + |
| 175 | +```yaml |
| 176 | +storyline: |
| 177 | + - time: "+2h30m" |
| 178 | + # ... Phase 1 fields above ... |
| 179 | +
|
| 180 | + event_sequence: # Phase 2.4+: Multi-step sub-events |
| 181 | + - sub_event_type: process |
| 182 | + delay_seconds: 5 |
| 183 | + details: |
| 184 | + process_name: powershell.exe |
| 185 | + - sub_event_type: file |
| 186 | + delay_seconds: 10 |
| 187 | + details: |
| 188 | + file_path: C:\temp\payload.exe |
| 189 | +
|
| 190 | + duration: "30m" # Phase 2.4+: Event duration |
| 191 | + success_probability: 0.8 # Phase 2.4+: 0.0-1.0 |
| 192 | + retry_on_failure: true # Phase 2.4+: Retry flag |
| 193 | +``` |
| 194 | + |
| 195 | +**event_sequence** items must have: |
| 196 | +- `sub_event_type` (required): Type of sub-event (e.g., process, file, network) |
| 197 | +- `delay_seconds` (optional): Delay before this sub-event |
| 198 | +- `details` (optional): Sub-event-specific details |
| 199 | + |
| 200 | +## Output |
| 201 | + |
| 202 | +```yaml |
| 203 | +output: |
| 204 | + logs: |
| 205 | + - format: windows_event_security |
| 206 | + - format: zeek_conn |
| 207 | + - format: ecar |
| 208 | + destination: ./output |
| 209 | + compression: false # Optional (default: false) |
| 210 | +``` |
| 211 | + |
| 212 | +Supported formats: `windows_event_security`, `zeek_conn`, `ecar`, `syslog`, `bash_history`, `snort_alert`, `web_access`. |
| 213 | + |
| 214 | +## Backward Compatibility |
| 215 | + |
| 216 | +All Phase 2.4+ fields are optional with null defaults. Existing Phase 1 scenarios work without modification: |
| 217 | +- `expanded_activities`, `work_hours_parsed`, `activity_intensity` default to null |
| 218 | +- `event_sequence`, `duration`, `retry_on_failure`, `success_probability` default to null |
| 219 | +- `work_hours_parsed` is auto-populated from the `work_hours` string if not explicitly provided |
0 commit comments