feat(system): seal backup archives with an install HMAC #36
No reviewers
Labels
No labels
adr
android
area/calendar
area/design-system
area/i18n
area/jobs
area/offline
area/server
area/testing
bug
ci
duplicate
enhancement
help wanted
invalid
notifications
question
reliability
security
severity/low
severity/medium
tracking
web
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
eagraiclainne/app!36
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/archive-seal"
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?
Stacked on #35 (
fix/request-body-caps).Backup archives were plain gzip+JSON — a doctored backup restored by a well-meaning admin imported attacker password hashes, API keys, and a known
jwt_secretwith nothing to warn anyone.Seal: top-level
"seal"field in the JSON envelope, hex(HMAC-SHA256) over the envelope with the seal absent. In-envelope (not a proto side-channel) because every restore path is file-based (web blob download, CLIos.WriteFile) — a detached seal would be lost on exactly the flows that matter.formatVersionstays 1; old importers ignore the field.Key: new
archive_seal_keyin SystemSettings, crypto/rand-minted at boot, independent ofjwt_secretso rotation never orphans seals. Scrubbed by the sanitize map and stripped from every archive (a key riding the archive could re-seal tampering). Import re-stamps the install's own key — the key names the install, not the data.Verdicts (warn, never block):
ImportDataResponse.seal_verdict= VALID / UNSEALED / MISMATCH; the audit label carries it; CLI and web setup-restore word their notices by verdict (mismatch is expected when restoring onto a fresh install). Cross-install restores and pre-seal archives keep working.ADR-0022/0023 amended.
make check, integration suite, buf lint + breaking all green.Fixes #22
🤖 Generated with Claude Code
9b3dd4ab6521dde444d6