mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(security): do not print ENV config values when they are passwords, fixes #3337
This commit is contained in:
parent
0b4552a8e7
commit
67dc761344
@ -174,6 +174,9 @@ func applyEnvVariableOverrides() {
|
||||
|
||||
if len(envValue) > 0 {
|
||||
key.SetValue(envValue)
|
||||
if strings.Contains(envKey, "PASSWORD") {
|
||||
envValue = "*********"
|
||||
}
|
||||
appliedEnvOverrides = append(appliedEnvOverrides, fmt.Sprintf("%s=%s", envKey, envValue))
|
||||
}
|
||||
}
|
||||
@ -188,6 +191,9 @@ func applyCommandLineDefaultProperties(props map[string]string) {
|
||||
value, exists := props[keyString]
|
||||
if exists {
|
||||
key.SetValue(value)
|
||||
if strings.Contains(keyString, "password") {
|
||||
value = "*********"
|
||||
}
|
||||
appliedCommandLineProperties = append(appliedCommandLineProperties, fmt.Sprintf("%s=%s", keyString, value))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user