
MDE/MDI Defender setup for Ludus
Ludus range config and Ansible roles for a Windows security lab pre-staged for MDE and MDI, with a fully misconfigured ADCS installation for detection coverage testing.
| Config | VMs | Purpose |
|---|---|---|
zsec-mde-mdi-lab.yml | DC01 + WKS01 | MDE/MDI detection lab with ADCS ESC1–ESC15 |
LUDUS_API_KEY set in your environmentwin2022-server-x64-template# Install roles (run on Ludus host with API key set)
cd roles/
./install-roles.sh
# Set config and deploy
ludus range config set -f zsec-mde-mdi-lab.yml
ludus range deploy
MDE and MDI are not auto-installed. Onboard both from security.microsoft.com after the range is up:
# Snapshot after onboarding so you can revert without repeating the process
ludus range snapshot create --name post-onboarding
Environment-specific values (domain name, passwords, hostnames) appear inline throughout the config. A reference table at the top of the file lists every value and where it's used — update with find-and-replace before deploying.
Shared MDE prerequisite settings live in global_role_vars (applied to all VMs). DC-specific overrides live in DC01's role_vars and take precedence automatically.
Compound FQDNs in dns_rewrites and SPN strings need updating separately.
All roles live in roles/. The install script handles everything.
Community role installed via Ansible Galaxy: badsectorlabs.ludus_adcs (DC01).
enable_asr and enable_mdi_gpo are derived from @curi0usJack's work at curi0usJack/Ludus-MDE-MDI-Roles. This repo extends those roles into a unified DC↔WKS setup and adds the ADCS misconfiguration layer, MDE prerequisites hardening, WEF pipeline, and additional roles.
AD CS lab is a snippet from my course
| Role | Used in | Purpose |
|---|
mde_prereqs | DC01, WKS01 | Defender config, audit policy, logging, LSA hardening, TLS 1.2 |
wef | DC01, WKS01 | Windows Event Forwarding (collector on DC01, forwarder on WKS01) |
sysmon | DC01, WKS01 | Sysmon install and config |
adcs_lab | DC01 | ADCS ESC1–ESC15 misconfiguration setup |
ad_population | DC01 | Users, groups, OUs, Kerberoastable/ASREPRoastable accounts |
smb_shares | DC01, WKS01 | SMB shares including honeypot share |
enable_mdi_gpo | DC01 | MDI audit GPO |
enable_asr | WKS01 | Attack Surface Reduction rules |
rsat | WKS01 | Remote Server Administration Tools |