Skip to content

Commit c1c7c9c

Browse files
authored
don't log secrets even with debug logging enabled (#71)
1 parent a38c356 commit c1c7c9c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

secret/vault/vault.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (v *VaultSecrets) GetSecretsForTarget(name string) (map[string]string, erro
8787
}
8888

8989
zap.L().Debug("found secrets in vault",
90-
zap.Any("secret", secret))
90+
zap.Strings("secret", keys(env)))
9191

9292
return env, nil
9393
}
@@ -152,6 +152,13 @@ func kvToMap(version int, data map[string]interface{}) (env map[string]string, e
152152
return
153153
}
154154

155+
func keys(m map[string]string) (k []string) {
156+
for x := range m {
157+
k = append(k, x)
158+
}
159+
return
160+
}
161+
155162
// because Vault has no way to know if a kv engine is v1 or v2, we have to check
156163
// for the /config path and if it doesn't exist, attempt to LIST the path, if
157164
// that succeeds, it's a v1, if it doesn't succeed, it *might still* be a v1 but

0 commit comments

Comments
 (0)