cyber-range / README.md
philippefunk's picture
Publish core lab configuration
b198790 verified
|
Raw History Blame Contribute Delete
7.54 kB
metadata
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
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
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

Architecture

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:

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)

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:

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.

2. Wazuh blue-team stack (approximately 9 GiB with WAF and Juice Shop)

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:

python lab.py up blue

3. Local AI SOC analyst (approximately 6.5 GiB plus Wazuh)

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:

python lab.py triage examples/alerts.json

4. Android static analysis (approximately 3 GiB)

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 for OWASP MAS Crackmes and dynamic-analysis limitations.

5. VM and hosted tracks

  • Security Onion: begin with Import mode for PCAP/EVTX analysis; use Evaluation for live network visibility.
  • GOAD: use GOAD-Light on a 32 GiB host and keep other heavyweight workloads stopped.
  • PortSwigger Academy: 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

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.

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; configuration files are not represented as proof that containers were started.

Documentation