asc.xhack.lab_dc01 role – Deploy the lab Active Directory domain controller

Note

This role is part of the asc.xhack collection (version 2.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: git clone git@ssh.dev.azure.com:v3/cloudasc/iac-ansible-collections/xhack $HOME/.ansible/collections/ansible_collections/asc/xhack.

To use it in a playbook, specify: asc.xhack.lab_dc01.

Entry point main – Deploy the lab Active Directory domain controller

New in asc.xhack 1.0.0

Synopsis

  • Deploys a Windows Server VM, promotes it to a domain controller and creates the eXtreme Hacking lab’s Active Directory domain.

  • It builds out the directory the lab attacks run against - the organizational units (including the Workstations OU the lab clients are joined into), groups and users defined in lab_dc01_root_domain_ous, lab_dc01_root_domain_groups and lab_dc01_root_domain_users.

Parameters

Parameter

Comments

lab_dc01_config

dictionary

‘lab_dc01’ role configuration

enabled

boolean

Whether to enable the lab_dc01 role

Choices:

  • false ← (default)

  • true

vm_name

string

Name of the VM to deploy

Default: "vmdc01"

vm_size

string

Size of the VM to deploy (Azure VM size)

Default: "Standard_B2as_v2"

lab_dc01_root_domain

dictionary

Configuration of the root domain

forest_mode

string

Forest mode of the root domain

Default: "Win2012R2"

fqdn

string

FQDN of the root domain

Default: "{{ internal_domain }}"

mode

string

Mode of the root domain

Default: "Win2012R2"

netbios_name

string

NetBIOS name of the root domain

Default: "{{ internal_domain.split('.')[0][:15] | upper }}"

ou

string

Base Organizational Unit for the root domain

Default: "DC={{ internal_domain.split('.') | join(',DC=') }}"

lab_dc01_root_domain_groups

dictionary

added in asc.xhack 2.0.0

Active Directory groups to create, keyed by group name.

Each group takes ou (the OU it is created in) and an optional description.

lab_dc01_root_domain_ous

dictionary

Organizational Units to create in the root domain See example config file for more details

Default: {"Departments": {"description": "Departments", "path": "{{ lab_dc01_root_domain.ou }}"}, "Finance": {"description": "Finance department", "path": "OU=Departments,{{ lab_dc01_root_domain.ou }}"}, "HR": {"description": "HR department", "path": "OU=Departments,{{ lab_dc01_root_domain.ou }}"}, "IT": {"description": "IT department", "path": "OU=Departments,{{ lab_dc01_root_domain.ou }}"}, "Workstations": {"description": "Domain-joined workstations", "path": "{{ lab_dc01_root_domain.ou }}"}}

lab_dc01_root_domain_users

dictionary

added in asc.xhack 2.0.0

Active Directory users to create, keyed by sAMAccountName.

Each user takes firstname, surname, ou, password and optionally description, city and groups (added to the user’s existing groups, not replacing them).

Authors

  • Ignace De Cock