This lab simulates a realistic network security environment using Suricata IDS and multiple Docker-based components. It enables hands-on testing of attack detection, traffic routing, and network visibility using modern container workflows.
.
├── README.md
├── docker
│ ├── adversary # Simulated attacker (nmap, curl, etc.)
│ ├── docker-compose.yml # Container orchestration
│ ├── gateway # Layer-3 router and traffic mirror
│ ├── scripts # Setup scripts (e.g. tc-mirror)
│ ├── suricata # IDS container (Suricata)
│ ├── target # Simulated production target (SSH, Nginx)
│ └── test # Additional test scripts
├── docs # Documentation and diagramsMain goals:
- Simulate network attacks (e.g., ICMP, HTTP probes, port scans)
- Route traffic through an inline gateway
- Mirror traffic to Suricata IDS using tc-mirred
Traffic flow:
Adversary (external-net)
⇨ Gateway (external-net)
⇨ Gateway (internal-net)
⇨ Target (internal-net)
Response:
Target ⇨ Gateway ⇨ Adversary
Meanwhile:
Traffic mirrored via tc-mirred (eth0 & eth1 → eth2) ⇨ Suricata (sensor-net)
| Container | Purpose | Networks (with IPs) |
|---|---|---|
adversary |
Simulates attacks (nmap, curl, etc.) | external-net – 172.28.0.4 |
gateway |
Inline Layer-3 router + traffic mirroring | external-net – 172.28.0.5sensor-net – 172.29.0.5internal-net – 172.30.0.5 |
target |
Simulated production host (SSH, Nginx) | internal-net – 172.30.0.3 |
suricata |
Intrusion Detection System (passive analysis) | sensor-net – 172.29.0.2 |
dns |
Local DNS server (dnsmasq) | external-net – 172.28.0.53 |
Defined Docker networks:
external-net→ 172.28.0.0/24sensor-net→ 172.29.0.0/24internal-net→ 172.30.0.0/24
All workflows are integrated as VS Code Tasks. Open the Command Palette (F1 or Ctrl+Shift+P) and run the desired task by name.
- Run:
System: Start All Services
Launches all containers and prepares logging directories.
- Run:
System: Validate Network Setup
Automatically verifies correct connectivity and shuts down the containers afterward.
Service: Terminal Access - AdversaryService: Terminal Access - GatewayService: Terminal Access - TargetService: Terminal Access - SuricataService: Terminal Access - DNS
- Run:
Adversary: Run Port Scan (→ Target)Launches a simulated scan from the
adversarytotarget(172.30.0.3).
- Run:
Suricata: Clear Log Files
Deletes all.logand.jsonfiles from Suricata logs.
- Stop containers:
System: Stop All Services - Full cleanup:
System: Full Cleanup (Images + Volumes)
- Run:
DNS: Reload DNSMasq Configuration
SendsSIGHUPto reloaddnsmasqinside the DNS container