Skip to content

fix: make GOAD lab plays idempotent and source bot passwords from config - #403

Merged
mwendigg merged 1 commit into
dreadnode:mainfrom
l50:upstream/ps-scripts-from-lab-config
Aug 3, 2026
Merged

fix: make GOAD lab plays idempotent and source bot passwords from config#403
mwendigg merged 1 commit into
dreadnode:mainfrom
l50:upstream/ps-scripts-from-lab-config

Conversation

@l50

@l50 l50 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Key Changes:

  • Made constrained delegation scripts idempotent to survive lab resets without failing on LDAP constraint violations
  • Replaced hardcoded bot-account passwords with Jinja references to the lab config
  • Switched the Ansible PowerShell task to render scripts as templates so config values are injected at runtime

Changed:

  • Constrained delegation scripts now query existing SPNs and msDS-AllowedToDelegateTo values before adding, only writing what is missing to avoid LDAP constraint violations on re-runs - constrained_delegation_kerb_only.ps1 and constrained_delegation_use_any.ps1 in both ad/GOAD and ad/GOAD-Light
  • Scheduled-task scripts now register with the -Force flag instead of manually checking for and unregistering existing tasks, simplifying the create-or-replace logic - ntlm_relay.ps1, rdp_scheduler.ps1, and responder.ps1 in both lab variants
  • Bot-account passwords are now pulled from the lab config via Jinja expressions (e.g. eddard.stark, robb.stark) rather than being hardcoded in the scheduled-task scripts
  • The Ansible ps role now uses lookup('template', ps_script) instead of lookup('file', ...) so scripts are rendered as Jinja templates and can source values like passwords from the lab config, with an added comment documenting why templating every script is safe - ansible/roles/ps/tasks/main.yml

**Changed:**

- Delegation scripts now query existing SPNs and `msDS-AllowedToDelegateTo` values before adding, only writing missing entries to avoid LDAP constraint violations that fail plays on lab reset - `constrained_delegation_kerb_only.ps1` and `constrained_delegation_use_any.ps1` for both GOAD and GOAD-Light
- Scheduled task scripts now use `Register-ScheduledTask -Force` instead of manually checking for and unregistering existing tasks - `ntlm_relay.ps1`, `rdp_scheduler.ps1`, and `responder.ps1` for both GOAD and GOAD-Light
- Hardcoded bot-account passwords replaced with Jinja references to lab config values, keeping secrets out of the scripts
- The `ps` role now renders scripts via `lookup('template')` rather than `lookup('file')` so Jinja expressions such as config-sourced passwords are resolved before reaching the host - `ansible/roles/ps/tasks/main.yml`
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added lab/GOAD Changes made to GOAD lab area/ad-labs Changes made to AD lab definitions area/roles Changes made to Ansible roles lab/GOAD-Light Changes made to GOAD-Light lab labels Aug 3, 2026
@mwendigg
mwendigg added this pull request to the merge queue Aug 3, 2026
Merged via the queue into dreadnode:main with commit 112e006 Aug 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ad-labs Changes made to AD lab definitions area/roles Changes made to Ansible roles lab/GOAD Changes made to GOAD lab lab/GOAD-Light Changes made to GOAD-Light lab

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants