From 85b277c7c6dbb14458f1dff0e4ab7adcf31a167b Mon Sep 17 00:00:00 2001 From: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com> Date: Tue, 16 Aug 2022 17:52:20 +0200 Subject: [PATCH] fix: register base64 encoded secret (#3973) fixes #3908 --- pkg/config/vault.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/config/vault.go b/pkg/config/vault.go index ca5992578..f847adb0c 100644 --- a/pkg/config/vault.go +++ b/pkg/config/vault.go @@ -283,6 +283,8 @@ func populateCredentialsAsEnvs(config *StepConfig, secret map[string]string, key envVariable := vaultCredentialEnvPrefix + convertEnvVar(secretKey) log.Entry().Debugf("Exposing general purpose credential '%v' as '%v'", key, envVariable) os.Setenv(envVariable, secretValue) + + log.RegisterSecret(piperutils.EncodeString(secretValue)) envVariable = vaultCredentialEnvPrefix + convertEnvVar(secretKey) + "_BASE64" log.Entry().Debugf("Exposing general purpose base64 encoded credential '%v' as '%v'", key, envVariable) os.Setenv(envVariable, piperutils.EncodeString(secretValue)) @@ -301,6 +303,8 @@ func populateCredentialsAsEnvs(config *StepConfig, secret map[string]string, key envVariable := vaultCredentialEnvPrefixDefault + convertEnvVar(secretKey) log.Entry().Debugf("Exposing general purpose credential '%v' as '%v'", key, envVariable) os.Setenv(envVariable, secretValue) + + log.RegisterSecret(piperutils.EncodeString(secretValue)) envVariable = vaultCredentialEnvPrefixDefault + convertEnvVar(secretKey) + "_BASE64" log.Entry().Debugf("Exposing general purpose base64 encoded credential '%v' as '%v'", key, envVariable) os.Setenv(envVariable, piperutils.EncodeString(secretValue))