Skip to content

Commit 03ec16f

Browse files
DavidJBiancoclaude
andcommitted
Document network diagram input methods in PRD and TODO
Add network topology diagram input specifications to PRD: - Three input methods: CLI flag with Mermaid file, conversational definition, or skip entirely - Document CLI reads file locally and sends contents to LLM for parsing into YAML - MVP supports Mermaid format only - Future enhancements tracked for Graphviz/DOT, draw.io exports, and network discovery tool outputs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 08e73d6 commit 03ec16f

2 files changed

Lines changed: 49 additions & 5 deletions

File tree

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@
415415
- [ ] Config file inheritance/templating
416416
- [ ] PyPI package distribution
417417
- [ ] Additional log formats (CloudTrail, Azure Activity, GCP Audit, database logs)
418+
- [ ] Additional network diagram formats (Graphviz/DOT, draw.io exports, network discovery tool outputs)
418419
- [ ] Performance optimizations (Rust extensions, better parallelization)
419420

420421
### Medium-term

docs/PRD.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The tool addresses the need for realistic, large-volume training datasets withou
3535
- Schema validation and LLM-based semantic validation with interactive repair
3636
- Optional realism evaluation with concrete metrics
3737
- Ground truth documentation (GROUND_TRUTH.md) for scenarios with malicious activity: attack narrative, timeline, atomic IOCs
38+
- Network topology and sensor placement modeling: Define network segments, sensor locations, and traffic visibility to ensure only observable network traffic is generated
3839
- Comprehensive test coverage (95%+) with pytest
3940
- Ship with pre-built persona library to reduce LLM usage
4041
- Flexible timezone handling (UTC internal, configurable per-system/format for output)
@@ -86,6 +87,7 @@ log-generator new [--config CONFIG_FILE]
8687
1. System starts conversational interface
8788
2. Asks clarifying questions about:
8889
- Environment (size, type of organization, systems, users)
90+
- Network topology (optional: provide Mermaid diagram file, define conversationally, or skip)
8991
- Baseline activity patterns (or select from pre-built persona library)
9092
- Specific attack scenarios or activities to inject
9193
- Time windows
@@ -243,6 +245,25 @@ environment:
243245
- path: string
244246
permissions: list[string] # Group names
245247
248+
network:
249+
segments:
250+
- name: string # Segment identifier (e.g., "workstations", "servers", "dmz")
251+
cidr: string # CIDR notation (e.g., "10.0.10.0/24")
252+
description: string # Human-readable description
253+
systems: list[string] # Optional: Hostnames in this segment (inferred from system IPs if omitted)
254+
255+
sensors:
256+
- type: string # network|ids|firewall (determines which log formats this sensor generates)
257+
name: string # Sensor identifier
258+
monitoring_segments: list[string] # Segment names this sensor monitors
259+
direction: string # inbound|outbound|bidirectional (what traffic is visible)
260+
log_formats: list[string] # Which formats this sensor generates (e.g., ["zeek_conn", "snort"])
261+
description: string # Optional description
262+
263+
# Note: Network topology defines which connections are observable by sensors.
264+
# Phase 1: Basic validation (no localhost, no same src/dst, no link-local/multicast)
265+
# Phase 2: Full topology-aware validation (only generate traffic visible to configured sensors)
266+
246267
personas:
247268
# Note: LLM expands high-level persona descriptions into detailed activity patterns
248269
# during conversation phase. Can reference pre-built personas or define custom.
@@ -347,6 +368,7 @@ common_fields:
347368
# Type System for Format Definitions:
348369
# - datetime: ISO 8601 timestamp, rendered per format (epoch, ISO, custom)
349370
# - integer: 64-bit signed integer
371+
# - float: IEEE 754 double-precision floating point
350372
# - string: UTF-8 string
351373
# - ip_address: IPv4 or IPv6 address
352374
# - ipv4: IPv4 address specifically
@@ -362,6 +384,12 @@ common_fields:
362384
# - uuid: UUID v4
363385
# - base64: Base64-encoded string
364386
387+
# Format-Specific Precision Requirements:
388+
# - Zeek timestamps: Epoch float with exactly 6 decimal places (microsecond precision)
389+
# Format: f"{timestamp:.6f}" to preserve trailing zeros during JSON serialization
390+
# - Windows Event timestamps: ISO 8601 with millisecond precision (YYYY-MM-DDTHH:MM:SS.sssZ)
391+
# - Syslog timestamps: RFC 3339 format with timezone offset
392+
365393
variants: # For formats with subtypes (channels, log types)
366394
- name: string
367395
description: string
@@ -539,13 +567,23 @@ Non-interactive: Simply writes heavily-commented config file with:
539567
540568
**Command: new**
541569
```
542-
log-generator new [--config CONFIG_FILE]
570+
log-generator new [--config CONFIG_FILE] [--network-diagram DIAGRAM_FILE]
543571

544572
Options:
545-
--config Path to config file (default: ./config.yaml)
573+
--config Path to config file (default: ./config.yaml)
574+
--network-diagram Path to Mermaid diagram file defining network topology (optional)
546575

547576
Starts interactive conversational interface for scenario creation.
548577
Outputs scenario YAML file based on user responses.
578+
579+
Network topology can be provided in three ways:
580+
1. Via --network-diagram flag: Provide Mermaid (.mmd or .md) diagram file. CLI reads file
581+
locally and sends contents to LLM for parsing into structured YAML network schema.
582+
2. Conversationally: LLM prompts for network topology details and builds schema interactively.
583+
3. Skip: Omit network topology entirely (simple scenarios or manual YAML editing later).
584+
585+
MVP supports Mermaid diagram format only. Future enhancements may add Graphviz/DOT, draw.io
586+
exports, or network discovery tool outputs.
549587
```
550588
551589
**Command: validate**
@@ -1033,8 +1071,13 @@ Note: Warnings do not affect exit code.
10331071
- Circular parent references: Error
10341072
10351073
**Network impossibilities:**
1036-
- Connection to private IP from external actor: Warn (might be VPN/proxy)
1074+
- Connection where src_ip == dst_ip: Skip with warning (network sensors cannot observe localhost traffic)
1075+
- Connection involving localhost addresses (127.0.0.0/8): Skip with warning (never traverses network)
1076+
- Connection involving link-local addresses (169.254.0.0/16): Skip with warning (auto-config, not routed)
1077+
- Connection involving multicast/reserved addresses (224.0.0.0/4): Skip with warning (special handling required)
1078+
- Connection to private IP from external actor: Warn (might be VPN/proxy, but allow)
10371079
- Response bytes > 0 for failed connection: Adjust to 0, warn
1080+
- Phase 2: Connection not visible to configured sensors: Skip based on network topology and sensor placement
10381081
10391082
**Logon without logoff:**
10401083
- Within time window: Acceptable and common (user still logged in, forgot to log off, system crash)
@@ -1063,7 +1106,7 @@ Note: Warnings do not affect exit code.
10631106
**Connection to private IP from external actor:**
10641107
- Allow but warn: "External actor accessing private IP - consider modeling VPN/proxy/compromised perimeter"
10651108
- Don't auto-create NAT infrastructure
1066-
- User should explicitly model network topology if needed (or note as future enhancement)
1109+
- User should explicitly model network topology to represent VPN/proxy/perimeter devices (see environment.network schema)
10671110
10681111
## 9. Testing Strategy
10691112
@@ -1279,7 +1322,7 @@ class FormatDefinition:
12791322
- Generate logs for systems we don't have format definitions for
12801323
- Guarantee detection rule triggering (depends on SIEM/tool configuration)
12811324
- Provide bit-perfect reproducibility (LLM expansion is non-deterministic; save and reuse scenario files)
1282-
- Auto-generate complete network topology (external->internal connections flagged with warning)
1325+
- Auto-infer network topology from system IPs (users must explicitly define network segments and sensor placement)
12831326

12841327
**Performance bounds (MVP):**
12851328
- Max 1000 users (technical limit, not enforced)

0 commit comments

Comments
 (0)