Skip to content

Commit 8e4b952

Browse files
DISTMYSQL-406: Orchestrator exposes MySQLOrchestratorPassword variable
https://perconadev.atlassian.net/browse/DISTMYSQL-406 Problem: Error log contains password of Orchestrator's backend database Cause: Commit b8b30e6 passed the whole connection URI to the logger as a context to be displayed together with logs. The problem was only for Orchestrator's backend database. Managed instances were unaffected. Solution: Pass only host and port as a context to be displayed together with logs.
1 parent be6a8d5 commit 8e4b952

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

go/db/db.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func openOrchestratorMySQLGeneric() (db *sql.DB, fromCache bool, err error) {
131131
if config.Config.MySQLOrchestratorUseMutualTLS {
132132
uri, _ = SetupMySQLOrchestratorTLS(uri)
133133
}
134-
sqlUtilsLogger := SqlUtilsLogger{client_context: config.Config.MySQLOrchestratorHost + ":" + config.Config.MySQLOrchestratorHost}
134+
sqlUtilsLogger := SqlUtilsLogger{client_context: config.Config.MySQLOrchestratorHost + ":" + strconv.FormatUint(uint64(config.Config.MySQLOrchestratorPort), 10)}
135135
return sqlutils.GetDB(uri, sqlUtilsLogger)
136136
}
137137

@@ -200,7 +200,7 @@ func OpenOrchestrator() (db *sql.DB, err error) {
200200
}
201201
}
202202
dsn := getMySQLURI()
203-
sqlUtilsLogger := SqlUtilsLogger{client_context: dsn}
203+
sqlUtilsLogger := SqlUtilsLogger{client_context: config.Config.MySQLOrchestratorHost + ":" + strconv.FormatUint(uint64(config.Config.MySQLOrchestratorPort), 10)}
204204
db, fromCache, err = sqlutils.GetDB(dsn, sqlUtilsLogger)
205205
if err == nil && !fromCache {
206206
log.Debugf("Connected to orchestrator backend: %v", safeMySQLURI(dsn))

0 commit comments

Comments
 (0)