hub v0.157.0: app_definition_refused (R-971), the vault time moves on a re-vault (R-954), the hub's own snapshot count (R-895 slice); uninstall knows felhom-thin-check
gates / gates (push) Successful in 6m58s

- hub: `app_definition_refused` in allowedEventTypes + operatorOnlyEvents (controller v0.328.0's catalog
  allow-list refusal); SaveHostRecoveryCredential moves set_at on a re-vault (found live: both rotated hosts
  kept their first vault's time); the daily key audit also lists the box's restic snapshots/ read-only over the
  login the hub already holds and logs count/newest/oldest (no alarm yet).
- installer (main only, rides the next tag): --uninstall removes /usr/local/sbin/felhom-thin-check (agent
  v0.159.0's bundle file); test_hostinstall.py knows it.
- runbook whole-guest-backup-orphan-thin.md: the human repair the agent's new orphan finding points to.

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-10-17 16:27:51 +02:00
1 parent ab2fc21a9c
commit 8f97b8009b
12 files changed
+276 -1

No files matched your search

+4 -1
View File
@@ -18,7 +18,9 @@ type HostRecoveryCredential struct {
}
// SaveHostRecoveryCredential upserts a host's break-glass credential (last-write-wins: day-0 sets it,
// --rotate re-sets). R-133 (hub v0.135.0): the secret is SEALED at rest with the same key and the same
// --rotate re-sets). set_at is the time THIS secret was vaulted — a re-vault moves it (R-954 follow-up, hub v0.157.0:
// it used to keep the FIRST vault's time, so the Console access card said „last vaulted 2026-07-21" over a password
// rotated minutes before; pinned by TestHostRecovery_ReVaultMovesSetAt). R-133 (hub v0.135.0): the secret is SEALED at rest with the same key and the same
// helpers as the off-site sub-account passwords (offsite_seal.go, OFFSITE_SECRET_KEY) — a copy of hub.db
// alone no longer holds any box's console password. No key → the save is REFUSED (ErrNoSealKey): a hub that
// cannot seal must not fall back to plaintext. The hub NEVER logs the secret and only ever returns it over
@@ -34,6 +36,7 @@ func (s *Store) SaveHostRecoveryCredential(hostID, username, secret string) erro
ON CONFLICT(host_id) DO UPDATE SET
username = excluded.username,
secret = excluded.secret,
set_at = datetime('now'),
updated_at = datetime('now')`,
hostID, username, sealed)
return err
@@ -0,0 +1,37 @@
package store
import (
"testing"
"time"
)
// R-954 follow-up (hub v0.157.0): a re-vault (`--rotate-recovery`, the operator's own set-and-vault) MOVES set_at — the
// time the Console access card shows as „last vaulted". Found live 2026-10-17: demo-hp's and Tester 1's rotated
// passwords both still read set_at = their FIRST vault (2026-07-21, 2026-10-04). RED-PROOF
// (felhom.eu audits/agent-allowlist-rotation-2026-10-17/P3/redproof-set-at.txt): without `set_at = datetime('now')` in
// the upsert this test fails on both the meta and the credential read.
func TestHostRecovery_ReVaultMovesSetAt(t *testing.T) {
st := sealTestStore(t)
if err := st.SaveHostRecoveryCredential("h1", "root@pam", "first-Pw-1"); err != nil {
t.Fatal(err)
}
// Age the first vault by a year, as a real day-0 vault would be.
if _, err := st.db.Exec(`UPDATE host_recovery SET set_at = '2025-10-17 10:00:00' WHERE host_id = 'h1'`); err != nil {
t.Fatal(err)
}
before := time.Now().UTC().Add(-time.Minute)
if err := st.SaveHostRecoveryCredential("h1", "root@pam", "second-Pw-2"); err != nil {
t.Fatal(err)
}
c, err := st.GetHostRecoveryCredential("h1")
if err != nil || c == nil || c.Secret != "second-Pw-2" {
t.Fatalf("credential = %+v, %v", c, err)
}
if c.SetAt.Before(before) {
t.Fatalf("credential set_at = %v — the re-vault kept the first vault's time", c.SetAt)
}
m, err := st.GetHostRecoveryMeta("h1")
if err != nil || m == nil || m.SetAt.Before(before) {
t.Fatalf("meta set_at = %+v, %v — the card would show the first vault's time", m, err)
}
}