Redact passwords in log file (#4198)

In some log messages user passwords were not redacted. Move and
introduce a global helper function `remove_sensitive_data` to redact
passwords.
3 files changed