-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Censor DB password when outputting to logs #5265
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle i'd say - looks good.
However, please remove the .terraform submodule which seems to have been commited by mistake (best via rebase so it's gone from history, too).
Yep. It was indeed a mistake. I've removed the submodule from the branch. It should hopefully be good now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like the only case where the db-url is logged with password is when it's wrong - but i guess then it's ok / acceptable - as it might show you the error too.
Great job - LGTM 👍
Thank you! I was thinking of adding validation for that edge case. But then, I guess SQLAlchemy would handle that and raise the error as It wouldn't be able to establish a connection. |
Summary
Censor password from logs when providing a DB connection URI
E.g:
From:
postgresql+psycopg2://scott123:scott123@host/dbname
Outputs the following to logs:
postgresql+psycopg2://scott123:*****@host/dbname
Quick changelog