Commit 20e5e50
committed
feat(backup): encrypt backup envelopes at rest with a configurable KEK
Splits backup_envelope.rs into a module (types, read, write, crypto) and
adds an optional AES-256-GCM encryption layer for backup envelopes. A new
`BackupEncryptionSettings` config section points to the 32-byte KEK file.
When the KEK is present the orchestrator calls `finalize_encrypted` and
restore auto-detects the envelope version (1 = plain, 2 = encrypted) to
dispatch to the appropriate parser. If no KEK is configured a per-backup
warning is emitted rather than silently producing a plaintext archive.
The backup KEK is loaded at startup into `ServerState::backup_kek` and a
warning is logged when it shares the same path as the WAL KEK.1 parent 992f2b5 commit 20e5e50
14 files changed
Lines changed: 1121 additions & 471 deletions
File tree
- nodedb-types
- src
- backup_envelope
- nodedb/src
- config/server
- control
- backup
- state
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
0 commit comments