-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove password from log messages #273
Comments
I think you could configure a logging filter for that to avoid the password being logged. Out of curiosity, have you looked at what requests/urllib3 is logging? I'm wondering whether the easiest fix would simply be to remove Line 383 in c24036f
Line 427 in c24036f
|
Thanks for the answer. I would not remove L383 and 427 as it is exactly those ones I need to monitor the indexing (!) More precisely, I am using the I did log
but it's impossible to read as it consists in the (big) list of docs to index. However I noticed that the password was somehow encrypted, and double-checked here: https://github.com/psf/requests/blob/a4c18cd733f97b5659a29589432d8a39e7a0de87/requests/auth.py#L66, where One option would be use regex to clean up the pass (to be tested thoroughly, though): import re
url = "https://myuser:[email protected]/solr/collection/update/"
new_url = re.sub('(https://[^:]+:)([^@]+)(@.+)', r'\1password\3', s)
=> 'https://myuser:[email protected]/solr/collection/update/' |
I was thinking it might be safest to |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
For security reasons, would it be possible to anonymized the URL in log messages of
send_request
, i.e. removing at least the password?The text was updated successfully, but these errors were encountered: