TNZ-97934: Redact api_password and TLS private key from JSON-serialized config#118
Merged
Merged
Conversation
abg
reviewed
Jun 24, 2026
abg
left a comment
Member
There was a problem hiding this comment.
I would just omit the config from the proxy main log line rather than jump through all these hoops.
Seems of no real value to print the full config.
Member
Author
|
I kind of agree -- my concern is maybe the config dump has diagnostic or other value in non-obvious situations; it's already dumped, after all, only for reasons I'm not clearly seeing. So, I aimed to minimally change that output. |
Old switchboard proxy logic would log the config value when loading the configuration failed. This could leak sensitive credentials unnecessarily. Align with the pattern in other components and only log an error value for troubleshooting rather than the full value. [TNZ-97934] ai-assisted=yes
abg
force-pushed
the
ai-scan/TNZ-97934-logs-record-pw-and-key
branch
from
June 30, 2026 22:00
c87becc to
5584b8b
Compare
Member
|
Per discussion, simplified this to just drop logging the config value which addresses the original concern with minimal code churn. |
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
MarshalJSONtoconfig.APIandconfig.SwitchboardApiTLSso that lager's JSON encoding of the config struct on validation failure (cmd/proxy/main.go:36) emits[REDACTED]instead of plaintext secretsAPI.PasswordandSwitchboardApiTLS.PrivateKeyare redacted; all other fields (including the publicCertificate) are preservedconfig/config_test.go)cmd/proxy/main_test.go)Jira
https://vmw-jira.broadcom.net/browse/TNZ-97934
Test plan
ginkgo ./config/— 5 new redaction unit tests pass, all 40 config specs greenginkgo ./cmd/proxy/— new validation-failure integration test passes, full suite greenPasswordorPRIVATE KEYin thedata.configfield🤖 Generated with Claude Code