mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-28 15:29:09 +01:00
[management] Mask credentials in logged URLs (#8250)
This commit is contained in:
@@ -758,7 +758,7 @@ func logAgentNetworkConfig(cfg *CombinedConfig) {
|
||||
|
||||
// logEnvVars logs all NB_ environment variables that are currently set
|
||||
func logEnvVars() {
|
||||
log.Info("=== Environment Variables ===")
|
||||
log.Debug("=== Environment Variables ===")
|
||||
found := false
|
||||
for _, env := range os.Environ() {
|
||||
if strings.HasPrefix(env, "NB_") {
|
||||
@@ -770,14 +770,14 @@ func logEnvVars() {
|
||||
} else if strings.Contains(keyLower, "dsn") {
|
||||
value = maskDSNPassword(value)
|
||||
}
|
||||
log.Infof(" %s=%s", key, value)
|
||||
log.Debugf(" %s=%s", key, value)
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
log.Info(" (none set)")
|
||||
log.Debug(" (none set)")
|
||||
}
|
||||
log.Info("=== End Environment Variables ===")
|
||||
log.Debug("=== End Environment Variables ===")
|
||||
}
|
||||
|
||||
// maskDSNPassword masks the password in a DSN string.
|
||||
|
||||
Reference in New Issue
Block a user