Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't workinglabstacks/lab on alexander (VLAN 30)stacks/lab on alexander (VLAN 30)securityA credential, an exposure, or a control that is weaker than recordedA credential, an exposure, or a control that is weaker than recorded
Milestone
Description
What is true
Four small gaps in how the lab domain's build and configuration handle credentials. None is severe alone. Together they are the weak end of a domain that #449 is about to make deliberately weak on top.
1. A blank Administrator password is accepted without a word.
ansible/inventory/group_vars/all.yaml:29-30:lab_admin_password: "{{ lookup('ansible.builtin.env', 'LAB_ADMIN_PASSWORD') }}". Ifphoenix.envwas not sourced, that is"".roles/base/tasks/main.yml:118-125then runswin_user … password: "{{ lab_admin_password }}" update_password: alwaysunderno_log: true, so any error is hidden as well.- Packer has the guard Ansible lacks (
packer/variables.pkr.hcl:96-109).
2. WinRM is open to the whole segment, unencrypted, during Packer Windows builds.
packer/windows/scripts/bootstrap.ps1:32-35enables Basic auth withAllowUnencryptedand opens TCP 5985 with no-RemoteAddress.windows.pkr.hcl:148-149setswinrm_insecure = trueandwinrm_use_ssl = false.- The build password crosses VLAN 30 as cleartext Basic auth, readable by any guest there. ADR-0077's own reason for not using WinRM is that "NTLM over HTTP is one of the protocols this segment exists to have attacked."
3. packer-smoke.sh puts the Proxmox token on a command line.
scripts/packer-smoke.sh:67,77buildsAUTH="Authorization: PVEAPIToken=…=${PROXMOX_TOKEN_SECRET}"and passes it ascurl -H "${AUTH}". It is visible inpsand/proc/*/cmdlineon phoenix.scripts/deploy-agent.sh:484-486already does this properly:printf 'header = …' | curl -K -.
4. Host keys are unchecked while domain-admin passwords cross SSH.
ansible/ansible.cfg:16hashost_key_checking = false.- ADR-0077 §2 accepts this because every rebuild replaces the keys. That reasoning does not weigh that
LAB_ADMIN_PASSWORDandLAB_DSRM_PASSWORDthen cross a channel an ARP spoofer can sit in the middle of.docs/security.md:773acknowledges ARP spoofing on this segment.
What closes it
- A
pre_tasksansible.builtin.assertat the top oflab-domain.yml: both variables are defined and| length >= 14, with a message namingphoenix.env. -RemoteAddress 10.0.30.70(phoenix) on the WinRM firewall rule inbootstrap.ps1, the same restrictionopenssh.ps1uses. Better still: an HTTPS listener with a self-signed certificate created inbootstrap.ps1, andwinrm_use_ssl = true.- Switch
packer-smoke.shto thecurl -K -pattern. - Optional, as an amendment to ADR-0077 §2: after
tofu apply, read each clone's host key through the guest agent (qm guest exec … cat /etc/ssh/ssh_host_ed25519_key.pub, or the Windows equivalent). The token already hasVM.GuestAgent.*. Write a per-runknown_hosts, then turn host key checking on.
Done when
- Running
lab-domain.ymlwithoutphoenix.envfails in the first task. - A Windows build's WinRM listener refuses connections from any address but phoenix.
pson phoenix during a smoke run shows no token.
Refs ADR-0077, #448, #449. Found in the 2026-10-03 repository review.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinglabstacks/lab on alexander (VLAN 30)stacks/lab on alexander (VLAN 30)securityA credential, an exposure, or a control that is weaker than recordedA credential, an exposure, or a control that is weaker than recorded
Activity
docs(runbook): record the PhoenixHostKeys grant on Saruman (#846)
fix(lab): keep the password guard under --limit, and delete the WinRM…
fix(lab): drop run_once from the password guard (ansible-lint run-onc…
fix(packer): press for the Windows CD prompt for thirty seconds, not …
fix(lab): guard blank lab passwords, scope the build's WinRM, keep th…
docs(adr): record the renumber in ADR-0085, as ADR-0049 records its own
Gerrrt commentedon Oct 7, 2026
Closed by #931 (merged 2026-10-07 13:48 UTC as be31da3), with a follow-up in #1018. All three "done when" conditions were proven on the live lab on 2026-10-07:
lab-domain.ymlwithoutphoenix.envfails at the first task. The guard is a play onlab_domainwithany_errors_fatal, taggedalways. With the env unset it fails before any role runs, with and without--limit titan. With it set, the following plays run on all six. Its output shows the expression, never a value.packer-smoke.sh 912.pson phoenix during a smoke run shows no token. A root sampler ranps -eo args | grep -c PVEAPITokenonce a second for the whole 912 smoke run: 299 samples, 0 hits.Host keys, item 4 (ADR-0083, renumbered from 0082 in #1018):
scripts/lab-known-hosts.shpinned all six on phoenix.verify.ymlpassed on all six with host-key checking on.REMOTE HOST IDENTIFICATION HAS CHANGED.Found along the way and fixed:
Not yet checked:
SetupComplete.logon a clone of the new templates showing the HTTPS listener, rule and certificate removed. The 912 smoke clone was destroyed before it could be read. The 911 smoke run will use--keepfor it.🤖 Generated with Claude Code
docs(adr): renumber the lab host-keys ADR to 0085; main had two ADR-0…
fix(adr): catch two more host-key ADR-0082 refs, and note the renumbe…
Gerrrt commentedon Oct 7, 2026
Reopening: I closed this before every check had been done, and the one I'd left open fails.
SetupComplete.logon a smoke clone of the new 911 (2026-10-07 15:24 UTC) shows the certificate step failing withrc=1:-DeleteKeywas added in #931 from review and never ran on Windows before merging. In Windows PowerShell 5.1 it doesn't work on certificates sent down a pipeline, so thepacker-winrmcertificate stays on every clone of 911 and 912. Everything else held on the clone: WinRM is stopped and disabled, the HTTPS listener and thepacker-winrm-httpsrule are gone, and no inbound rule is open on 5985 or 5986. The leftover is a self-signed certificate that nothing trusts, the same on every clone. I couldn't confirm whether its private key is still on disk: removing it by path deleted the certificate but reported "Keyset does not exist".The fix (PR to follow):
AllowUnencryptedreset, which the build never turns on and which errors on the clone's Public network.It's proven by a 912 rebuild and a smoke run with
--keep. I'll close this again once that passes.🤖 Generated with Claude Code
fix(packer): delete the WinRM key before its certificate, keep the ce…
fix(lab): grant PhoenixBuilder beside PhoenixHostKeys per VMID (#846) (…
fix(packer): remove the build's WinRM certificate and key before sysp…
Gerrrt commentedon Oct 7, 2026
Closing again: the check that failed now passes.
The certificate cleanup is fixed by #1031, which is merged. That PR deletes the build's WinRM private key, then its certificate, in the sysprep task before generalising. The clone runs the same script again as a backstop, and a certificate is never removed while its key can't be. Both templates were rebuilt from it on 2026-10-07 and checked on a
--keepsmoke clone:psf23a6ba4…, 18:28:15left: 0left: 021aea7e1…, 19:50:52left: 0left: 0The other conditions were proven earlier and stand: the blank-password guard, WinRM scoped to phoenix during a build, no token on argv, and pinned host keys.
Still open: the six domain guests rebuilt from 15:38 UTC today were cloned from the templates as they were before #1031. Each still carries that build's
packer-winrmcertificate, and probably its key. WinRM is disabled and closed on all six, so that is a leftover, not an opening. Removing it from them is follow-up work; it isn't reopened here.🤖 Generated with Claude Code
feat(ansible): remove the build's packer-winrm certificate from the l…