Skip to content

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

Merged
abg merged 1 commit into
mainfrom
TNZ-97927/scrub-switchboard-log
Jun 30, 2026
Merged

TNZ-97927 Prevent Authorization header leaking into switchboard debug logs#121
abg merged 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 <kim.bassett@broadcom.com>

Made-with: Claude Code

@abg abg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jun 30, 2026
@abg
abg merged commit 914b363 into main Jun 30, 2026
5 checks passed
@abg
abg deleted the TNZ-97927/scrub-switchboard-log branch June 30, 2026 22:31
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Jun 30, 2026
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.

2 participants