Skip to content

[auth] Remove token signatures in logs#1398

Merged
barroco merged 2 commits intointeruss:masterfrom
Orbitalize:remove_token_in_logs
Mar 24, 2026
Merged

[auth] Remove token signatures in logs#1398
barroco merged 2 commits intointeruss:masterfrom
Orbitalize:remove_token_in_logs

Conversation

@the-glu
Copy link
Contributor

@the-glu the-glu commented Mar 18, 2026

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.

@the-glu the-glu requested a review from barroco March 18, 2026 15:01
Copy link
Contributor

@mickmis mickmis left a comment

Choose a reason for hiding this comment

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

LGTM modulo comment

for key, values := range newHeaders {
if strings.ToLower(key) == "authorization" {
for i, val := range values {
newHeaders[key][i] = tokenRegex.ReplaceAllString(val, "$1[REDACTED]")
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are targeting the authorization header, might as well redact the whole value and not try to match the token itself, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I understand, idea was to keep the base of the token for debugging, but make it useless without the signature.

Copy link
Contributor

Choose a reason for hiding this comment

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

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 barroco changed the title Remove token signatures in logs [auth] Remove token signatures in logs Mar 24, 2026
@barroco barroco merged commit 0996514 into interuss:master Mar 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants