Skip to content

fix: remove raw vars from config trace log to prevent token leak#190

Merged
jmeridth merged 1 commit intoprivateerproj:mainfrom
vinayada1:fix/config-trace-token-leak
Apr 7, 2026
Merged

fix: remove raw vars from config trace log to prevent token leak#190
jmeridth merged 1 commit intoprivateerproj:mainfrom
vinayada1:fix/config-trace-token-leak

Conversation

@vinayada1
Copy link
Copy Markdown
Contributor

Summary

NewConfig was logging the raw vars map as a Trace field directly after calling printSanitizedVars. That meant any sensitive value — token, password, API key — in vars was emitted to the log in plaintext regardless of the sanitization helper running above it.

This removes the raw "vars", vars field from the Trace call so only the redacted output from printSanitizedVars is logged. A secondary fix switches printSanitizedVars from printf-style to proper structured hclog key/value logging.

The Trace call in NewConfig was passing the raw vars map as a log field,
which could expose sensitive values such as tokens and passwords even
though printSanitizedVars was called on the line above.

- Remove the raw 'vars' field from the Trace call in NewConfig
- Fix printSanitizedVars to use structured hclog key/value logging
  instead of printf-style formatting
@vinayada1 vinayada1 requested a review from a team as a code owner April 7, 2026 17:22
@github-actions github-actions bot added the fix label Apr 7, 2026
@jmeridth jmeridth merged commit e5bb7db into privateerproj:main Apr 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants