fix(oauth2): mask sensitive tokens in HTTP logs#1900
Conversation
Disables automatic logging by google-http-java-client in StsRequestHandler and UrlIdentityPoolSubjectTokenSupplier to prevent leakage of access_token and subject_token. Explicit secure logging via LoggingUtils is introduced instead, which hashes sensitive keys.
* chore: Remove Code Coverage requirements * chore: Remove redelcaration in child pom
|
Should we also mask content in for Json? |
We can. I don't recall exactly what is in the content. In practice, I think we only want to hash where absolutely necessary, otherwise log with all hash don't provide much value. Again, this is under terms that this logging is not designed for production usage, but for debug purposes only. See warnings in guide. |
Gotcha. I just added reference to it just in case. Looks like if there is no match to sensitive keys, it'll just keep it as-is. I think that should be fine since it's most likely the case that the JsonHttpContent doesn't have anything that needs to be masked. |
|




Disables automatic logging by google-http-java-client throughout the auth library to prevent leakage of sensitive tokens like (access_token and subject_token). Token masking logging via LoggingUtils is introduced instead, which hashes sensitive keys.
This was discovered in use cases where info level logging was enabled and CIs were outputting Bearer Token values.
See b/456079208 and b/465090182 for more info
Behavior change