Prod hardening: SealedStore encryption at rest (SIGIL_SEAL_PASS) #4

Merged
leora merged 1 commits from leora/prod-sealed-store into sigil-initial 2026-10-06 04:59:30 +08:00
Contributor

Sealed store / encryption at rest for the Sigil prod build (Quarry 18a5d762).

Stacked on PR #3 (leora/prod-offbox-anchor).

What

SealedStore / env SIGIL_SEAL_PASS seals the on-disk DB with AES-256-GCM:

  • Magic SIGILSEAL1 + salt + nonce + ciphertext
  • PBKDF2-HMAC-SHA256 (480k iterations) → 32-byte key
  • Working copy is a temp SQLite file while open; flush() / close() re-seals
  • File mode 0600; refuses to open a cleartext DB as sealed
  • CLI auto-uses SealedStore when SIGIL_SEAL_PASS is set (or DB is already sealed)

Incremental path short of SQLCipher (no page-level encryption while open). Real working encryption of the sensitive file with tests.

Tests

11 new tests in tests/test_sealed.py. Full suite 130 green (includes PR #3 anchor tests).

Still open: independent crypto review; platform glue / kill switch (passcodes stay).

bigpickle: inform only — no review gate.

Sealed store / encryption at rest for the Sigil prod build (Quarry 18a5d762). Stacked on PR #3 (`leora/prod-offbox-anchor`). ## What `SealedStore` / env `SIGIL_SEAL_PASS` seals the on-disk DB with AES-256-GCM: - Magic `SIGILSEAL1` + salt + nonce + ciphertext - PBKDF2-HMAC-SHA256 (480k iterations) → 32-byte key - Working copy is a temp SQLite file while open; `flush()` / `close()` re-seals - File mode `0600`; refuses to open a cleartext DB as sealed - CLI auto-uses SealedStore when `SIGIL_SEAL_PASS` is set (or DB is already sealed) Incremental path short of SQLCipher (no page-level encryption while open). Real working encryption of the sensitive file with tests. ## Tests 11 new tests in `tests/test_sealed.py`. Full suite **130** green (includes PR #3 anchor tests). Still open: independent crypto review; platform glue / kill switch (passcodes stay). bigpickle: inform only — no review gate.
leora added 1 commit 2026-10-06 04:59:08 +08:00
Tokens/codes/secrets were already digests; a stolen cleartext SQLite file
still leaked the agent roster, revocation state and audit history.
SealedStore / SIGIL_SEAL_PASS wraps on-disk bytes in AES-256-GCM
(PBKDF2-HMAC-SHA256, 480k iters). Working copy is plaintext only while
open (temp file); flush/close re-seals. Incremental path short of
SQLCipher page-level encryption.

11 new tests in test_sealed.py (stolen seal has no SQLite header / no
agent rows; wrong passphrase fails; works with off-box anchor). Suite
130 green.

Part of Quarry 18a5d762. Independent crypto review + platform glue remain.
leora changed target branch from leora/prod-offbox-anchor to sigil-initial 2026-10-06 04:59:28 +08:00
leora merged commit c0027bb9f6 into sigil-initial 2026-10-06 04:59:30 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bigpickle/sigil#4
No description provided.