Repository navigation
fix(packer,lab): no plaintext build password left in Panther on Windows clones (#1099) - #1102
Merged
Merged
Conversation
…ws clones (#1099) C:\Windows\Panther\unattend-original.xml is Setup's untouched copy of the build answer file. Read on all seven running Windows guests (2026-10-09), it holds two password elements, both <PlainText>true</PlainText>, readable by BUILTIN\Users. The check counted them and printed no value. It is created at template build time, so 911 and 912 carried it into every clone. Panther\unattend.xml beside it is scrubbed by Setup and stays. - sysprep.ps1: the generated packer-sysprep.cmd deletes it as its last step before sysprep /generalize. - SetupComplete.cmd: deletes it again before a clone's first logon, and logs whether it is gone. - roles/base: removes it on every run (existing clones, and clones of templates built before this). verify.yml asserts it is absent. Checked on carbuncle without touching Panther: PowerShell's parser reads sysprep.ps1 with 0 errors, and the new SetupComplete lines, run against a temp folder, delete a present file and pass over an absent one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The verification can pass while another credential-bearing Panther answer file remains.
1 open finding
What changed in this PR
Removes the plaintext Windows build credential from cloned guests and adds remediation and verification safeguards.
Changes:
- Deletes the exposed answer file during sysprep and clone setup.
- Removes it from existing Ansible-managed guests.
- Adds verification and operational documentation.
| File | Description |
|---|---|
packer/windows/scripts/sysprep.ps1 |
Deletes the build answer copy before generalization. |
packer/windows/scripts/SetupComplete.cmd |
Adds clone-time deletion and logging. |
ansible/roles/base/tasks/main.yml |
Removes the exposed file during convergence. |
ansible/verify.yml |
Adds a credential-file absence check. |
docs/changelog.md |
Records the finding, fix, and rollout steps. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Gerrrt
enabled auto-merge (squash)
October 9, 2026 03:23
unattend-oobe.xml, the answer sysprep uses on a clone's first boot, carries the build Administrator password in plaintext as well. SetupComplete.cmd deletes it, but verify.yml checked only unattend-original.xml, so a failed deletion would pass (review on #1102). roles/base now removes both, and the check requires both absent. On carbuncle, where both are gone, the check's expression evaluates True. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…upComplete.cmd (#1099) #1103, merged alongside, deletes unattend-original.xml and unattend.xml in SetupComplete.cmd and refuses to start the guest agent if either survives, and its smoke test checks for them. This PR's own SetupComplete.cmd lines would have duplicated that step in a weaker form, so they are dropped. The file now matches main. #1102 keeps the template-build deletion in sysprep.ps1, roles/base's cleanup of existing clones and of unattend-oobe.xml, and verify.yml's check. The changelog entry now says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 9, 2026
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.

Closes #1099. The seven running guests were already cleaned through the guest agent on 2026-10-09; this lands the prevention for them and for future clones.
What's there, measured
I checked all seven running Windows guests on 2026-10-09: bahamut, leviathan, titan, ramuh, carbuncle, siren and dot-windows. Every one has
C:\Windows\Panther\unattend-original.xml, readable byBUILTIN\Users.<PlainText>true</PlainText>unattend-original.xml(~9 KB)unattend.xml(~1.5 KB)The check counted elements and printed no value.
Where it comes from. It is created during the template build, about half an hour before each clone's own first boot. On carbuncle: created 2026-10-07 15:18Z,
SetupComplete.log15:52Z, and the same pattern on dot-windows. So it's baked into 911 and 912, and every clone inherits it. It's Setup's untouched copy of the build answer file: the build Administrator password and the build AutoLogon.Why it matters.
roles/baserotates the local Administrator away from the build password, but the template reuses that password, and clones Ansible hasn't touched keep it. That includes dot-windows, and any new clone until base runs. On the endpoints, ordinary domain users log on interactively.The fix, alongside #1103
#1103, merged while this was open, handles each clone's first boot. Its
SetupComplete.cmddeletesunattend-original.xmlandunattend.xmland refuses to start the guest agent if either survives, and its smoke test checks for them. This PR's ownSetupComplete.cmdlines were dropped in favour of it, so that file now matchesmain. What this PR adds:packer/windows/scripts/sysprep.ps1: the generatedpacker-sysprep.cmdrunsdel /f /q "%WINDIR%\Panther\unattend-original.xml"as its last step beforesysprep /generalize, so a rebuilt template no longer carries the file.ansible/roles/base:win_file … state: absentforunattend-original.xmlandunattend-oobe.xml(the first-boot answer file, which also carries the build password) on every run. That cleans any clone of the current templates.ansible/verify.yml: no plaintext answer file in Panther, which fails if either file is present.Checked
sysprep.ps1with 0 errors (run on carbuncle). The new line sits inpacker-sysprep.cmddirectly beforesysprep.exe.check_docs.pyand markdownlint pass. ansible-lint runs in CI.After merge
SetupComplete.cmdandroles/baseremove it from every clone.🤖 Generated with Claude Code