TNZ-97928 Redact galera-agent password from bootstrap failure logs#119
Merged
Conversation
Replaces the full rootConfig passed to logger.Error with only non-sensitive fields (repair_mode, healthcheck_urls), preventing the galera-agent password from appearing in BOSH errand output on failure. Adds json:"-" to Config.Password and BackendTLS.CA as defense-in-depth so future log statements cannot accidentally re-introduce the leak. ai-assisted=yes [TNZ-97928](https://vmw-jira.broadcom.net/browse/TNZ-97928) Authored-by: Kim Bassett <[email protected]> Made-with: Claude Code
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
rootConfig(including plaintextPassword) was passed tologger.Erroron bootstrap/rejoin-unsafe failure, causing the galera-agent password to appear in BOSH errand outputlager.Data{"config": rootConfig}with only non-sensitive fields (repair_mode,healthcheck_urls)json:"-"toConfig.PasswordandBackendTLS.CAas defense-in-depth, preventing future log statements from accidentally re-introducing the leakJira: https://vmw-jira.broadcom.net/browse/TNZ-97928
Test plan
main_test.go: builds binary, runs it against an unreachable galera-agent URL to trigger the failure path, asserts the password string is absent from all outputconfig/config_test.go: marshal aConfigto JSON and verify neitherPasswordnorBackendTLS.CAcontent appears in the outputgo test ./...)🤖 Generated with Claude Code