Browse Source

fix(api): redact device encryption passwords in support bundle config (#10359)

* fix(api): redact device encryption passwords in support bundle config

Signed-off-by: Tommy van der Vorst <[email protected]>

* Update lib/api/support_bundle.go

Signed-off-by: Jakob Borg <[email protected]>

---------

Signed-off-by: Tommy van der Vorst <[email protected]>
Signed-off-by: Jakob Borg <[email protected]>
Co-authored-by: Jakob Borg <[email protected]>
Tommy van der Vorst 1 month ago
parent
commit
9e262d84de
1 changed files with 9 additions and 0 deletions
  1. 9 0
      lib/api/support_bundle.go

+ 9 - 0
lib/api/support_bundle.go

@@ -23,6 +23,15 @@ func getRedactedConfig(s *service) config.Configuration {
 	if rawConf.GUI.User != "" {
 		rawConf.GUI.User = "REDACTED"
 	}
+
+	for folderIdx, folderCfg := range rawConf.Folders {
+		for deviceIdx, deviceCfg := range folderCfg.Devices {
+			if deviceCfg.EncryptionPassword != "" {
+				rawConf.Folders[folderIdx].Devices[deviceIdx].EncryptionPassword = "REDACTED"
+			}
+		}
+	}
+
 	return rawConf
 }