Skip to content

Commit

Permalink
don't log secrets even with debug logging enabled (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
Southclaws authored Jul 15, 2020
1 parent a38c356 commit c1c7c9c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion secret/vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (v *VaultSecrets) GetSecretsForTarget(name string) (map[string]string, erro
}

zap.L().Debug("found secrets in vault",
zap.Any("secret", secret))
zap.Strings("secret", keys(env)))

return env, nil
}
Expand Down Expand Up @@ -152,6 +152,13 @@ func kvToMap(version int, data map[string]interface{}) (env map[string]string, e
return
}

func keys(m map[string]string) (k []string) {
for x := range m {
k = append(k, x)
}
return
}

// because Vault has no way to know if a kv engine is v1 or v2, we have to check
// for the /config path and if it doesn't exist, attempt to LIST the path, if
// that succeeds, it's a v1, if it doesn't succeed, it *might still* be a v1 but
Expand Down

0 comments on commit c1c7c9c

Please sign in to comment.