Skip to content

Logging connection string exposes credentials #57

@alkar

Description

@alkar

When a DB connection cannot be established, https://github.com/wrouesnel/postgres_exporter/blob/master/postgres_exporter.go#L999 will log the connection string which includes username & password.

I'm not sure if there's any true value in logging that at all but if you want to log the connection string it'd be best to either mask the password or perhaps use url.Parse() and just log the extracted Host?

Happy to raise a PR for this. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions