Skip to content

Commit

Permalink
Fix missing dsn sanitization for logging
Browse files Browse the repository at this point in the history
This log line was not sanitized previously which could result in logging sensitive information. I have scanned the rest of the files and I don't see anywhere else that DSN is used in a log line without this filter.

Resolves prometheus-community#1042

Signed-off-by: Joe Adams <[email protected]>
  • Loading branch information
sysadmind committed Dec 22, 2024
1 parent 6f36adf commit aff0f28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/postgres_exporter/postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
if err := e.scrapeDSN(ch, dsn); err != nil {
errorsCount++

logger.Error("error scraping dsn", "err", err, "dsn", dsn)
logger.Error("error scraping dsn", "err", err, "dsn", loggableDSN(dsn))

if _, ok := err.(*ErrorConnectToServer); ok {
connectionErrorsCount++
Expand Down

0 comments on commit aff0f28

Please sign in to comment.