File size: 7,542 Bytes
55c5066 b198790 55c5066 b198790 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | ---
license: mit
pretty_name: Cyber Range Virtual Lab
tags:
- cybersecurity
- blue-team
- red-team
- wazuh
- owasp
- docker
- soc
- homelab
---
# Cyber Range β Blue Team + Red Team Virtual Lab
A profile-based learning range for the ten supplied cybersecurity resources. It combines isolated Docker services, an advisory-only local AI analyst, and supported VM/external tracks for platforms that should not be containerized.
> **Authorized use only.** Scan and exploit only this lab or systems you own or are explicitly authorized to test. Juice Shop and GOAD are deliberately vulnerable. Keep every published endpoint on localhost and every attack VM on a host-only network.
## What is included
| # | Resource | Delivery | Start / open |
|---|---|---|---|
| 1 | Wazuh SIEM | Official single-node containers, pinned to 4.14.10 | `python lab.py wazuh-setup` |
| 2 | Web Application Firewall | OWASP ModSecurity CRS β Juice Shop | `python lab.py up core` |
| 3 | Home SOC with AI | Wazuh + WAF logs + local Ollama/copilot | Start Wazuh, then `python lab.py up ai` |
| 4 | AI SOC analyst | Advisory JSONL reports and local web UI | `http://127.0.0.1:8082` |
| 5 | Security Onion | Supported ISO/VM track | [Security Onion guide](docs/SECURITY_ONION.md) |
| 6 | Android application hacking | MobSF static analysis + OWASP crackmes | `python lab.py up mobile` |
| 7 | Nmap reconnaissance | Allowlisted, on-demand container | `python lab.py scan waf -- -sV` |
| 8 | PortSwigger Academy | Official hosted labs | [Academy track](docs/PORTSWIGGER.md) |
| 9 | OWASP Juice Shop | Isolated target behind the WAF | `http://127.0.0.1:8080` |
| 10 | Active Directory GOAD | Official Vagrant/VM track | [GOAD guide](docs/GOAD.md) |
## Architecture
```text
localhost :8080 internal range_net
β ββββββββββββββββββββββββ
βΌ β β
OWASP CRS WAF βββββββββββββββββΆβ OWASP Juice Shop β
β β Nmap (on demand) β
βΌ ββββββββββββββββββββββββ
named WAF log volume ββββββββββΆ Wazuh manager (blue profile)
β
βΌ alerts.json (read-only share)
SOC copilot ββββββββββΆ Ollama (local, optional)
β
βΌ localhost :8082 / JSONL
```
- No Docker socket, host PID namespace, or privileged services.
- Juice Shop is not directly exposed to the host.
- Wazuh, MobSF, WAF, and copilot UIs bind to `127.0.0.1`.
- Ollama has no host port; alert content stays local.
- The AI analyst cannot execute containment or incident-response actions.
## Prerequisites
- Windows 11 + Docker Desktop, or Linux/macOS with Docker Engine.
- Docker Compose v2 and enough free disk for selected images.
- Python 3.11 or later.
- Git, only for Wazuh setup and GOAD.
- PyYAML, only for static validation: `python -m pip install -r requirements-dev.txt`.
Check the host before downloading anything:
```bash
python lab.py preflight
```
A missing Docker engine blocks deployment but not unit/static validation.
## Quick start
### 1. Core web target and WAF (approximately 2.5 GiB ceiling)
```bash
python lab.py up core
python lab.py urls
```
Open `http://127.0.0.1:8080`. Juice Shop is reachable through the WAF, not directly.
Run a safe baseline and a WAF test:
```bash
curl -I http://127.0.0.1:8080/
curl "http://127.0.0.1:8080/?q=%27%20OR%201%3D1--"
python lab.py scan waf -- -sV --top-ports 100
```
The second request should be inspected and may receive a CRS `403`. Confirm behavior in logs rather than relying only on the status code. Exercises are in [the runbook](docs/RUNBOOK.md).
### 2. Wazuh blue-team stack (approximately 9 GiB with WAF and Juice Shop)
```bash
python lab.py wazuh-setup
```
Open `https://127.0.0.1:5443` and accept the lab's self-signed-certificate warning. Official local defaults are `admin` / `SecretPassword`; do not expose this instance or reuse those credentials outside the disposable lab.
Setup clones the official `wazuh-docker` `v4.14.10` release into `.vendor/`, generates its certificates, applies localhost/resource overrides, and starts the stack. It downloads several gigabytes on first use.
To start an already-installed blue stack and WAF later:
```bash
python lab.py up blue
```
### 3. Local AI SOC analyst (approximately 6.5 GiB plus Wazuh)
```bash
python lab.py up ai
python lab.py pull-model
```
The default model is `llama3.2:3b`; the download is optional. Without it, the copilot still produces deterministic triage. Open `http://127.0.0.1:8082` or read `http://127.0.0.1:8082/reports.json`.
Test the fallback immediately without Wazuh:
```bash
python lab.py triage examples/alerts.json
```
### 4. Android static analysis (approximately 3 GiB)
```bash
python lab.py up mobile
```
Open `http://127.0.0.1:8000`; the official image's default local credentials are `mobsf` / `mobsf`. Upload only your own APK or a training APK. See [the Android track](docs/ANDROID.md) for OWASP MAS Crackmes and dynamic-analysis limitations.
### 5. VM and hosted tracks
- [Security Onion](docs/SECURITY_ONION.md): begin with Import mode for PCAP/EVTX analysis; use Evaluation for live network visibility.
- [GOAD](docs/GOAD.md): use GOAD-Light on a 32 GiB host and keep other heavyweight workloads stopped.
- [PortSwigger Academy](docs/PORTSWIGGER.md): follow the official SQL injection, XSS, authentication, and access-control sequence.
## Resource policy
| Profile | Approximate configured memory ceiling | Notes |
|---|---:|---|
| `core` | 2.5 GiB | WAF + Juice Shop; Nmap runs on demand |
| `blue` | 9 GiB | Wazuh + WAF/Juice Shop |
| `mobile` | 3 GiB | MobSF |
| `ai` | 6.5 GiB | Ollama + copilot; model usage varies |
| `all-containers` | 19 GiB | Requires at least 30 GiB detected physical RAM |
These are limits, not expected steady-state usage. Do not run Security Onion or GOAD with `all-containers`. Full GOAD needs about 24 GiB for its VMs alone and is tight on a 32 GiB host.
## Lifecycle
```bash
python lab.py status # configured Docker projects
python lab.py down # stop containers; preserve named volumes
python lab.py validate # static policy checks
python -m unittest discover -s tests -v
```
`down` never deletes volumes. Destructive reset and backup instructions are deliberately separate in [the runbook](docs/RUNBOOK.md).
## Configuration
Copy `.env.example` to `.env` only when changing image tags, ports, resource limits, WAF mode, or AI settings. The rolling WAF/MobSF/Ollama tags follow upstream recommendations; for a frozen classroom, pull once and pin the resulting image digests in `.env`. Juice Shop and Wazuh are version-pinned.
## Verification status
This package contains unit tests and static policy validation. Runtime deployment requires Docker and is reported separately in [VALIDATION.md](VALIDATION.md); configuration files are not represented as proof that containers were started.
## Documentation
- [Daily exercises and reset/backup](docs/RUNBOOK.md)
- [All official resource links](docs/RESOURCES.md)
- [Troubleshooting](docs/TROUBLESHOOTING.md)
- [Architecture/design record](docs/superpowers/specs/2026-11-26-cyber-range-design.md)
|