fix: make GOAD lab plays idempotent and source bot passwords from config - #403
Merged
Merged
Conversation
**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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes:
Changed:
msDS-AllowedToDelegateTovalues before adding, only writing what is missing to avoid LDAP constraint violations on re-runs -constrained_delegation_kerb_only.ps1andconstrained_delegation_use_any.ps1in bothad/GOADandad/GOAD-Light-Forceflag instead of manually checking for and unregistering existing tasks, simplifying the create-or-replace logic -ntlm_relay.ps1,rdp_scheduler.ps1, andresponder.ps1in both lab variantseddard.stark,robb.stark) rather than being hardcoded in the scheduled-task scriptspsrole now useslookup('template', ps_script)instead oflookup('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