Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

#406

Serve on Windows: access-list secrets and a platform socket default

closed · opened by keenan 2d ago

keenan opened this 2d ago

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, and vole serve complete; the data directory, instance.db, secrets.key, SSH host key, and audit.log all end up owned by BUILTIN\Administrators/this account and granted only to SYSTEM, Administrators, and the service account, with AreAccessRulesProtected = 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, and acl set-role work over it; git push and git clone succeed against ssh://git@…/demo.git.
  • go build ./..., go vet ./..., and go test ./internal/secure ./internal/audit pass 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:

  1. 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.
  2. ssh_listen = "socket" on Windows. The front-door socket path still assumes unix: server/server.go chmods it 0660, checks os.ModeSocket, and spoken exec is unavailable (syscall.Exec returns EWINDOWS). The TCP listener is the supported mode here; the sshd drop-in and forced-command handoff for Windows OpenSSH are not written.
  3. CI runner on Windows. newProcessGroup/killProcessGroup kill the direct child only (Job Objects are the fix) and Process.Signal(SIGTERM) returns EWINDOWS, so a graceful stop is not graceful. The server half does not use either.
  4. Packaging and deployment. No MSI/zip, no Windows service unit, no cloud-init equivalent; deploy/ and docs/deploy/ stay Linux/macOS.

Acceptance criteria

  • GOOS=windows go build ./... and go vet ./... pass in verify.
  • 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.

Comments (0)

No comments yet.