feat(security): integrate HashiCorp Vault for secrets management (#17)#114
Merged
Mac-5 merged 1 commit intoSynapse-bridgez:developfrom Feb 23, 2026
Merged
Conversation
Contributor
|
Please, you are to make your pr against the develop branch not main, resolve conflicts |
b4cfca7 to
91c309b
Compare
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.
Summary
Closes #17
Replaces plaintext environment variables for sensitive secrets (DB password, Anchor secret) with a secure HashiCorp Vault integration, eliminating the risk of secret leakage through logs or process dumps.
Changes
src/secrets.rs— NewSecretsManagerservice that authenticates with Vault via AppRole on startup and exposes methods to fetch secrets dynamically.src/config.rs— Updatedconfig::load()to sourcedb_passwordandanchor_secretfrom Vault instead of environment variables.Cargo.toml— Addedvaultrscrate for Vault API integration.docker-compose.yml— Added a local Vault dev server for development and testing.How It Works
VAULT_ROLE_ID,VAULT_SECRET_ID).SecretsManagerfetches secrets from thesecret/KV v2 mount.Configat load time — no plaintext secrets ever touch env vars or config files.Testing
VAULT_ADDR,VAULT_ROLE_ID, andVAULT_SECRET_IDin your environment.Security Notes
VAULT_ROLE_IDandVAULT_SECRET_IDshould be injected at runtime via a secrets manager (e.g. Kubernetes Secrets, CI/CD vault injection) — not stored in.envfiles.Checklist
developSecretsManagerservice implementedconfig::load()updatedcargo build)cargo test)