Support for zeroize? #4940
|
When using an encrypted database, I would like to make sure that row content fetched to memory is zeroized before being released back to the heap (dropped, in rust parlance). Is there existing support for this? |
Replies: 1 comment 1 reply
|
No, there's nothing like that today. Decrypted row content isn't zeroized when it's dropped. The encryption in Turso is page-level and at rest only. Once a page is decrypted into memory it sits there as plaintext for as long as it's cached, and when that buffer is freed it's a normal Rust drop with no scrubbing pass over the bytes. The team has said memory-side protection (zeroizing buffers, enclaves, that kind of thing) is something they'd like to explore, but it isn't built. So for what you're asking, treat it as a feature request rather than a switch you can flip. If it's a hard requirement right now, the only real lever is outside the database: keep the process short-lived so decrypted data isn't resident longer than it needs to be, and stop the memory from hitting disk (mlock the process / disable or encrypt swap). That's not the same as zeroize-on-drop, but it shrinks the window where plaintext is sitting around. Worth opening an issue if you want the real thing tracked. |
No, there's nothing like that today. Decrypted row content isn't zeroized when it's dropped.
The encryption in Turso is page-level and at rest only. Once a page is decrypted into memory it sits there as plaintext for as long as it's cached, and when that buffer is freed it's a normal Rust drop with no scrubbing pass over the bytes. The team has said memory-side protection (zeroizing buffers, enclaves, that kind of thing) is something they'd like to explore, but it isn't built. So for what you're asking, treat it as a feature request rather than a switch you can flip.
If it's a hard requirement right now, the only real lever is outside the database: keep the process short-lived so decrypte…