[auth] Remove token signatures in logs#1398
Merged
barroco merged 2 commits intointeruss:masterfrom Mar 24, 2026
Merged
Conversation
barroco
reviewed
Mar 18, 2026
mickmis
approved these changes
Mar 19, 2026
| for key, values := range newHeaders { | ||
| if strings.ToLower(key) == "authorization" { | ||
| for i, val := range values { | ||
| newHeaders[key][i] = tokenRegex.ReplaceAllString(val, "$1[REDACTED]") |
Contributor
There was a problem hiding this comment.
If we are targeting the authorization header, might as well redact the whole value and not try to match the token itself, no?
Contributor
Author
There was a problem hiding this comment.
Not sure I understand, idea was to keep the base of the token for debugging, but make it useless without the signature.
Contributor
There was a problem hiding this comment.
I think there is value is keeping the content of the token safely by redacting the signature.
Since this is already an improvement compared to the current state, I propose to move forward and @mickmis feel free to propose another PR or open issue when you come back if there is still any concern.
barroco
approved these changes
Mar 24, 2026
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.
I noticed that the DSS logs are recording full tokens, which is a security concern.
This PR redacts the signature of JWT tokens, making them unusable while still logging the core payload to be debuggable.