Skip to content

Commit 20e5e50

Browse files
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/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ nodedb-codec = { workspace = true }
2626
crc32c = { workspace = true }
2727
roaring = { workspace = true }
2828
bytemuck = { workspace = true }
29+
aes-gcm = { workspace = true }
30+
getrandom = { workspace = true }
31+
sha2 = { workspace = true }
2932

3033
[dev-dependencies]
3134
toml = { workspace = true }

0 commit comments

Comments
 (0)