[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17286444#comment-17286444
 ] 

Gary D. Gregory commented on HTTPCLIENT-2138:
---------------------------------------------

This is all about logging configuration in this case.

Log4j provides rich marker support:  

[https://logging.apache.org/log4j/2.x/manual/markers.html]

There is only so much you can do to prevent users from shooting themselves in 
the foot.

If we knew for sure that a method argument or instance variable was secret, 
then we could/should use a logging marker to say so. But if we have to test for 
it in our code, then that becomes more expensive and error prone.

You could maybe consider a PR where header names are used as marker names; 
that's pretty generic, then YOUR application logging configuration would be 
delivered with these markers disabled. This would let you see other headers.

> Debug Log level logs sensitive information
> ------------------------------------------
>
>                 Key: HTTPCLIENT-2138
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2138
>             Project: HttpComponents HttpClient
>          Issue Type: Wish
>          Components: HttpClient (classic)
>            Reporter: Cyrus Vafadari
>            Priority: Minor
>
> When I enable debug level logging, I see
> ```
> [2021-01-20 18:02:35,862] DEBUG http-outgoing-0 >> Authorization: Basic 
> <CREDENTIALS_APPEAR_HEAR_IN_BASE64> (org.apache.http.headers:139) [2021-01-20 
> 18:02:35,884] DEBUG http-outgoing-0 >> "Authorization: Basic 
> <CREDENTIALS_APPEAR_HEAR_IN_BASE64>[\r][\n]" (org.apache.http.wire:54) 
> [2021-01-20 18:02:35,899] DEBUG http-outgoing-0 << " <title>Unauthorized 
> (401)</title>[\n]" (org.apache.http.wire:54)
> ```
> If agreed, I can open a PR to mask secrets in the debug log. If that makes 
> the log less useful, I can at least make this configurable, since in my case 
> it is a security violation to have any secrets whatsover in the logs



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to