You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(hosts): make identity persistence durable and check the CA file #86
Three small gaps in apps/host_agent/internal/identity/identity.go:
Prepare creates the identity directory with Mkdir (around line 77) but never fsyncs its parent. After power loss the pending key can vanish, breaking "Persist pending key/CSR before redemption" in host-enrollment.md.
On the exclusive link path (around lines 143 and 157-173), the .identity-* temp name is removed after the directory fsync and that removal is never synced. A crash can leave a second copy of the private key.
The server CA file (around lines 434-449) is checked for symlinks and size only. A group- or world-writable CA file can be replaced to impersonate the control plane.
Acceptance criteria
The parent directory is fsynced after a successful Mkdir.
The temp name is removed before the directory fsync on the link path.
The CA file must be owned by root or the agent's user and not group/other-writable; its path is validated as absolute and clean in Prepare and validate.
Tests cover the refusals; make check is green.
Found by the independent pilot review on 2026-10-16. Builds on the pilot branch pilot/installable-pilot-pr (split from #83); start from its current head.
Activity
fix(hosts): sync identity parent and temp removal
fix(hosts): require safe server CA file
fix(hosts): sync identity parent and temp removal
fix(hosts): require safe server CA file
fix(hosts): sync identity parent and temp removal
fix(hosts): require safe server CA file
fix(hosts): sync identity parent and temp removal
fix(hosts): require safe server CA file
fix(hosts): sync identity parent and temp removal
fix(hosts): require safe server CA file
fix(hosts): sync identity parent and temp removal
fix(hosts): require safe server CA file
wstein commentedon Oct 16, 2026
Done in #92. Final
make checkon main1cb22c2: GREEN (850 harness, 654 Go, 200 ExUnit).