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.

Protect secrets with access lists on Windows

33cbbc9d3dad71cf1bad5cf63508399a560e3b54 · Keenan Nemetz · 2d ago · parent 215f8aeb

Protect secrets with access lists on Windows

The Windows build compiled but refused to start: file modes are the secret
store's guarantee on unix and Windows has no such thing. This replaces the mode
check with the platform's own control rather than with a weaker one.

On Windows a secret is now a DACL: the service account, NT AUTHORITY\SYSTEM and
BUILTIN\Administrators at full control, inherited entries removed, and the result
read back, because SetNamedSecurityInfo reporting success does not mean the ACL
is the one meant. Directories must also have stopped inheriting — a directory
that follows its parent can be opened by a later change to the parent, which is
the kind of change nobody notices. Files inside a protected directory inherit
from it, so they carry no flag of their own.

internal/audit holds the log to the same rule through the same function, so the
log cannot drift to a weaker one than the files beside it. The unix halves keep
their checks, messages and order unchanged; the mode-based tests are built for
unix, and the new DACL tests run on a real Windows machine, which is the only
place they can run.

ssh_socket gains a per-platform default: %ProgramData%\vole\ssh.sock. The unix
path it had made configuration validation refuse every Windows start before any
of the above could run.

Verified on a Server Core 2022 guest (see the issue for the full record): init,
account creation, serve, HTTP, the admin CLI over SSH, and git push and clone all
work, with every secret and the audit log granted only to trusted principals and
the data directory protected. go build, go vet, and the secure and audit tests
pass natively on Windows as well as in the verify workflow.

Part of 01M8SCVR9GZTH7BBXHF97H817P.

forge/config/socket_other.go +8

@@ -0,0 +1,8 @@
1 //go:build !unix && !windows
2
3 package config
4
5 // defaultSSHSocket keeps the unix default on a platform with no packaged install:
6 // the value is reachable in the configuration and can be set, while nothing here
7 // is supported enough to have a convention of its own.
8 func defaultSSHSocket() string { return "/run/vole/ssh.sock" }