feat(dgw): make libsodium (secrets) an optional mlock feature#1691
Merged
Benoît Cortier (CBenoit) merged 2 commits intoDGW-326from Feb 26, 2026
Merged
feat(dgw): make libsodium (secrets) an optional mlock feature#1691Benoît Cortier (CBenoit) merged 2 commits intoDGW-326from
Benoît Cortier (CBenoit) merged 2 commits intoDGW-326from
Conversation
Co-authored-by: CBenoit <3809077+CBenoit@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. |
Copilot
AI
changed the title
[WIP] Add in-memory encryption for credentials in Devolutions Gateway
feat(dgw): make libsodium (secrets) an optional mlock feature
Feb 26, 2026
Benoît Cortier (CBenoit)
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
secrets(libsodium) was a hard dependency, blocking builds without libsodium installed. It is now optional behind amlockfeature flag, withzeroize::Zeroizingas the no-libsodium fallback (zeroize-on-drop, no mlock/mprotect).Changes
Cargo.toml:secretsmarked optional;mlock = ["dep:secrets"]feature addedsrc/credential/crypto.rs:MasterKeyManagerkey storage conditionally compiled:mlockenabled →secrets::SecretBox<[u8; 32]>(libsodium mlock/mprotect + zeroize)mlockdisabled →zeroize::Zeroizing<[u8; 32]>(zeroize-on-drop only)src/service.rs: startupwarn!emitted in release builds withoutmlock, directing operators to rebuild with the feature.github/workflows/ci.yml(gateway job only):libsodium-devadded to Linux amd64/arm64 apt configure stepsEnable mlock for productionstep setsCARGO_FEATURES=mlockand installs libsodium via vcpkg on Windows — runs only on production profile, excludesarm64(cbake sysroot does not support libsodium cross-compilation; those builds emit the startup warning)README.md: documents the optional--features mlockbuild and its libsodium system requirementIssue: DGW-326
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.