Skip to content

feat(dgw): make libsodium (secrets) an optional mlock feature#1691

Merged
Benoît Cortier (CBenoit) merged 2 commits intoDGW-326from
copilot/sub-pr-1689
Feb 26, 2026
Merged

feat(dgw): make libsodium (secrets) an optional mlock feature#1691
Benoît Cortier (CBenoit) merged 2 commits intoDGW-326from
copilot/sub-pr-1689

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

secrets (libsodium) was a hard dependency, blocking builds without libsodium installed. It is now optional behind a mlock feature flag, with zeroize::Zeroizing as the no-libsodium fallback (zeroize-on-drop, no mlock/mprotect).

Changes

  • Cargo.toml: secrets marked optional; mlock = ["dep:secrets"] feature added
  • src/credential/crypto.rs: MasterKeyManager key storage conditionally compiled:
    • mlock enabled → secrets::SecretBox<[u8; 32]> (libsodium mlock/mprotect + zeroize)
    • mlock disabled → zeroize::Zeroizing<[u8; 32]> (zeroize-on-drop only)
  • src/service.rs: startup warn! emitted in release builds without mlock, directing operators to rebuild with the feature
  • .github/workflows/ci.yml (gateway job only):
    • libsodium-dev added to Linux amd64/arm64 apt configure steps
    • New Enable mlock for production step sets CARGO_FEATURES=mlock and installs libsodium via vcpkg on Windows — runs only on production profile, excludes arm64 (cbake sysroot does not support libsodium cross-compilation; those builds emit the startup warning)
  • README.md: documents the optional --features mlock build and its libsodium system requirement

Issue: 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.

Co-authored-by: CBenoit <3809077+CBenoit@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 26, 2026

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
@CBenoit Benoît Cortier (CBenoit) marked this pull request as ready for review February 26, 2026 08:40
@CBenoit Benoît Cortier (CBenoit) merged commit 8bd9835 into DGW-326 Feb 26, 2026
@CBenoit Benoît Cortier (CBenoit) deleted the copilot/sub-pr-1689 branch February 26, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants