Skip to content

TNZ-97927 Prevent Authorization header leaking into switchboard debug logs#121

Open
kimago wants to merge 1 commit into
mainfrom
TNZ-97927/scrub-switchboard-log
Open

TNZ-97927 Prevent Authorization header leaking into switchboard debug logs#121
kimago wants to merge 1 commit into
mainfrom
TNZ-97927/scrub-switchboard-log

Conversation

@kimago

@kimago kimago commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • handleUpdate() in api/cluster.go called httputil.DumpRequest(req, true) and logged the result at Debug level, serialising the Authorization: Basic <base64> header verbatim
  • This silently bypassed the redaction already applied by the Logger middleware, which only runs after the inner handler returns
  • Fix removes the DumpRequest call entirely; the Logger middleware already covers equivalent request metadata (headers without Authorization, body, URL, host, remote addr) for every /v0 request

Test plan

  • New red/green test in api/cluster_test.go: sends a PATCH with Authorization: Basic and asserts the base64 credential value does not appear in debug logs
  • All 28 existing api package specs continue to pass
  • net/http/httputil import removed; go vet clean

Closes TNZ-97927

🤖 Generated with Claude Code

… logs

httputil.DumpRequest serialises all headers verbatim including
Authorization: Basic <base64(user:pass)>, bypassing the redaction
already applied by the Logger middleware. Remove the DumpRequest call
and its log statement; the Logger middleware covers the same request
metadata (without credentials) for every /v0 request.

ai-assisted=yes

[TNZ-97927](https://vmw-jira.broadcom.net/browse/TNZ-97927)

Authored-by: Kim Bassett <[email protected]>

Made-with: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant