Serve on Windows: protect secrets with access lists, and give the platform its own socket
What
Milestone 2 of the Windows port, after #404: a Windows build that can run the server, not only compile it.
The secret store’s guarantee on Windows is an access list rather than a mode.
internal/secure now rewrites each secret’s DACL — inheritance removed, the
service account, NT AUTHORITY\SYSTEM and BUILTIN\Administrators at full
control, nothing else — and reads the result back, because
SetNamedSecurityInfo reporting success is not the same as the ACL being the
one meant. Directories are additionally required to have stopped inheriting, so
a later change to a parent cannot open a data directory that was already
hardened. internal/audit checks the log the same way, through the same
function, so the log cannot be held to a weaker rule than the files beside it.
ssh_socket gets a per-platform default (%ProgramData%\vole\ssh.sock) instead
of the unix path that made configuration validation reject every Windows start.
Verified on a real guest
Windows Server 2022 Standard Evaluation, Server Core (10.0.20348), 3 GB / 4
vCPU, under Docker + KVM (dockur/windows), against this branch:
vole admin init, account creation, andvole servecomplete; the data directory,instance.db,secrets.key, SSH host key, andaudit.logall end up owned byBUILTIN\Administrators/this account and granted only to SYSTEM, Administrators, and the service account, withAreAccessRulesProtected = True. The upgrade path works too: a directory that was clean but still inheriting is rewritten on the next start.- HTTP serves on the guest and through the forwarded port; Vole’s SSH listener
accepts the admin key;
vole admin --remote … account list,repo create, andacl set-rolework over it;git pushandgit clonesucceed againstssh://git@…/demo.git. go build ./...,go vet ./..., andgo test ./internal/secure ./internal/auditpass natively on Windows — including the new ACL tests, which CI can only cross-compile. The Windows-only tests are the only place the DACL code is exercised at runtime.
What this issue does not cover
These are the remaining Windows gaps, in the order a deployment would hit them; none of them blocks a hand-run instance as tested above:
- Service installation. A process started from an SSH session dies at logoff (Windows puts each session in a job object), and Vole is not a service binary. The guest runs it from a scheduled task; a Windows service wrapper or manifest is its own change.
ssh_listen = "socket"on Windows. The front-door socket path still assumes unix:server/server.gochmods it0660, checksos.ModeSocket, andspokenexec is unavailable (syscall.ExecreturnsEWINDOWS). The TCP listener is the supported mode here; the sshd drop-in and forced-command handoff for Windows OpenSSH are not written.- CI runner on Windows.
newProcessGroup/killProcessGroupkill the direct child only (Job Objects are the fix) andProcess.Signal(SIGTERM)returnsEWINDOWS, so a graceful stop is not graceful. The server half does not use either. - Packaging and deployment. No MSI/zip, no Windows service unit, no
cloud-init equivalent;
deploy/anddocs/deploy/stay Linux/macOS.
Acceptance criteria
GOOS=windows go build ./...andgo vet ./...pass inverify.- A Windows instance starts, serves HTTP and SSH, and pushes and clones over git.
- Secret files and the audit log are granted only to trusted principals, and verification is part of startup rather than a report.
- Unix behaviour, messages, and tests are unchanged.