Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

fix(mysql): hide password when logging DSN #903

Merged
merged 3 commits into from
Oct 6, 2022

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Oct 6, 2022

Fixes: netdata/netdata#13770

Note: the password is not hidden in debug messages which don't get into error.log

Before

[ DEBUG ] build[manager] build.go:303 building mysql[local] job, config: map[__provider__:file reader __source__:/opt/netdata/usr/lib/netdata/conf.d/go.d/mysql.conf autodetection_retry:0 dsn:root:password@tcp(127.0.0.1:3306)/ module:mysql name:local priority:70000 update_every:1]
[ DEBUG ] mysql[local] mysql.go:111 using DSN [root:password@tcp(127.0.0.1:3306)/]
[ ERROR ] mysql[local] mysql.go:126 error on pinging the mysql database [root:password@tcp(127.0.0.1:3306)/]: dial tcp 127.0.0.1:3306: connect: connection refused

After

[ DEBUG ] build[manager] build.go:303 building mysql[local] job, config: map[__provider__:file reader __source__:/opt/netdata/usr/lib/netdata/conf.d/go.d/mysql.conf autodetection_retry:0 dsn:root:password@tcp(127.0.0.1:3306)/ module:mysql name:local priority:70000 update_every:1]
[ DEBUG ] mysql[local] mysql.go:111 using DSN [root:password@tcp(127.0.0.1:3306)/]
[ ERROR ] mysql[local] mysql.go:126 error on pinging the mysql database [root:********@tcp(127.0.0.1:3306)/]: dial tcp 127.0.0.1:3306: connect: connection refused

@ilyam8 ilyam8 merged commit 3df3d40 into netdata:master Oct 6, 2022
@ilyam8 ilyam8 deleted the fix_mysql_hide_password_when_logging branch October 6, 2022 09:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: error log shows mysql password when configured with password.
1 participant