feat(store): consolidate config + data + identity into encrypted SQLite (VA-68) #74
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VA-68-encrypted-sqlite-store"
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?
Replace the sled data store and the whole-file
.vsssettings blob with two SQLCipher (encrypted SQLite) databases, both unlocked by theVERVAIN_DB_KEYenvironment variable set in the service unit at install time.crates/vervain-agent/src/store.rs: the dataStoreis now an encrypted SQLite key-value table (rusqlite + bundled-sqlcipher-vendored-openssl).Store::open(path, key)runsPRAGMA keythen touches a page, so a missing/wrong key surfaces as an error (unreadable DB). Addsput_enrolled_identity/enrolled_identity(cert + key + server CA) for the enrollment flow (VA-67), and anEnrolledIdentitytype.crates/vervain-agent-config: strip the.vssencryption surface. Deletestore.rs(InstallSecret + ChaCha20-Poly1305) and drop ring/zeroize/data-encoding;SettingsMapkeeps its deterministic serialize/deserialize and themigrate-gated.vagentreader, now used to import a plaintext seed into the encrypted config DB.crates/vervain-agent/src/settings.rs: resolve two XDG dirs via thedirectoriescrate (config in~/.config/vervain-agent, data in~/.local/share/vervain-agent), read the SQLCipher key fromVERVAIN_DB_KEY, persist theSettingsMapas one blob in the encryptedconfig.db, and bootstrap a fresh DB by importing a co-locatedvervain-agent.vagentseed. No migration from the old stores.main.rs: drop--secret-file; thread the DB key into the config + data stores;config sealbecomesconfig import.install.rs/install_windows.rs: generate a fresh 256-bit hexVERVAIN_DB_KEYat install, import the seed intoconfig.db, and inject the key via the systemd unitEnvironment=(Linux) or machine env viasetx /M(Windows). Uninstall removes the encrypted DB files.docs/local-settings-store.md.Verified green in the dev container: fmt, clippy --workspace --all-targets --deny warnings, build, test --lib, and the x86_64-pc-windows-gnu cross-check (bundled SQLCipher + vendored OpenSSL cross-compiles via MinGW).
#VA-68