feat(agent): wipe spent enrollment material; install bundle via stdin (VA-75) #79
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VA-75-enroll-wipe-stdin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Security hardening of the VA-67 enrollment flow: the agent wipes the single-use bootstrap material after it enrolls, and the installer accepts the bundle on stdin so the Option 2 one-liner can pipe it without leaving a private key in a file.
What changed
bootstrap::wipe_enrollment_files()(new) deletes the files named byVERVAIN_ENROLL_CERT_FILE/_KEY_FILE/_ENROLLMENT_CA_FILE/_SERVER_CA_FILE. It runs at the end ofnet::enroll(), once the issued cert + server CA + domain + group id are persisted. The steady-state connection needs none of the bootstrap material (the issued client cert lives in the store/TPM; the server CA returned by enroll is in the DB), so the single-use enrollment private key no longer lingers on disk.ProtectSystem=strict(config dir read-only), the installer now writes the bootstrap PEMs into the data dir (/var/lib/vervain-agent,ReadWritePaths/StateDirectory, writable) and points the unit'sVERVAIN_*_FILEenv there. Mirrored on Windows (%ProgramData%\vervain-agent\data,setx /M). Mode 600 preserved.install --from -(stdin). The installers take the bundle JSON content;mainreads it from the file or, when--from -, from stdin. Enablescurl .../enroll-bundle?token=... | sudo vervain-agent install --system --from -.Why
The enrollment key + cert are single-use and short-TTL, but leaving the private key on disk after it is spent is needless exposure. Wiping it bounds the credential's lifetime to the moment of enrollment. Keeping it in the writable data dir (not the read-only config dir) is what lets the sandboxed service actually delete it.
Acceptance criteria
install --system --from -reads the bundle from stdin (no bundle file on disk).just pre-commitgreen (incl.--features tpmswtpm test and the Windows cross-compile).Testing
just pre-commit(fullcheck.Dockerfile): fmt,clippy --all-targets -D warnings, build, lib tests (incl. a newbootstrap::wipe_oneunit test), Windows cross-compile, agent-gui, and the--features tpmswtpm test.Related
Completes the agent half of the dual-port onboarding. Server + UI halves tracked in VS-69 (self-contained bundle + one-time bundle-fetch endpoint + delete legacy
.vagentminting) and VAPP-38 (SPA "+ New Device" → enroll-tokens). Hardens VA-67.🤖 Generated with Claude Code