Skip to content

Commit

Permalink
refactor: change auth credential script logging to debug (#3191)
Browse files Browse the repository at this point in the history
If a customer's script cmdPath contains credentials, do not log the exec.LookPath error since the cmdPath credentials may be logged too
  • Loading branch information
cgrinds authored Oct 3, 2024
1 parent fb4e56a commit 53a6dc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ func (c *Credentials) execScript(cmdPath string, kind string, timeout string, e
response := ScriptResponse{}
lookPath, err := exec.LookPath(cmdPath)
if err != nil {
return response, fmt.Errorf("script lookup failed kind=%s err=%w", kind, err)
c.logger.Debug("Failed to find script", slog.Any("err", err), slog.String("script", cmdPath), slog.String("kind", kind))
// Don't return the error, err, since it may contain credentials
return response, fmt.Errorf("script lookup failed kind=%s", kind)
}
if timeout == "" {
timeout = defaultTimeout
Expand Down

0 comments on commit 53a6dc5

Please sign in to comment.