Skip to content

Commit

Permalink
🛡️ security(VSecM): remove printAdditionalDetails from envInfo (#1071)
Browse files Browse the repository at this point in the history
printAdditionalDetails is able to print arbitrary information about all
environment variables. Giving too much info can be used as an aid to a
possible attack vector; especially if environment is misconfigured.

Signed-off-by: Volkan Özçelik <[email protected]>
  • Loading branch information
v0lkan authored Jul 14, 2024
1 parent 501a304 commit f85a253
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
14 changes: 0 additions & 14 deletions core/log/std/augment.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ package std

import (
"os"
"runtime"
"strings"

"github.com/vmware-tanzu/secrets-manager/core/constants/key"
"github.com/vmware-tanzu/secrets-manager/core/env"
"github.com/vmware-tanzu/secrets-manager/core/log/level"
)

func updateInfoWithExpectedEnvVars(
Expand All @@ -35,11 +29,3 @@ func updateInfoWithExpectedEnvVars(

return nf
}

func appendAdditionalDetails(info map[string]string) {
if env.LogLevel() >= int(level.Trace) {
info[key.EnvVars] = strings.Join(envVars(), ", ")
}

info[key.GoVersion] = runtime.Version()
}
2 changes: 0 additions & 2 deletions core/log/std/envinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ func PrintEnvironmentInfo(id *string, envVarsToExpect []string) {
WarnLn(id, "Environment variable '"+v+"' not found")
}

appendAdditionalDetails(info)

printFormattedInfo(id, info)
}

0 comments on commit f85a253

Please sign in to comment.