redact credentials within hooks

go-retryablehttp does not redact credentials, so we still log them
when we use it

https://github.com/hashicorp/go-retryablehttp/pull/133
This commit is contained in:
Nicola Murino
2021-05-12 22:44:17 +02:00
parent fa45c9c138
commit 0540b8780e
7 changed files with 56 additions and 34 deletions

View File

@@ -145,7 +145,9 @@ func (s *Service) startServices() {
if sftpdConf.ShouldBind() {
go func() {
logger.Debug(logSender, "", "initializing SFTP server with config %+v", sftpdConf)
redactedConf := sftpdConf
redactedConf.KeyboardInteractiveHook = utils.GetRedactedURL(sftpdConf.KeyboardInteractiveHook)
logger.Debug(logSender, "", "initializing SFTP server with config %+v", redactedConf)
if err := sftpdConf.Initialize(s.ConfigDir); err != nil {
logger.Error(logSender, "", "could not start SFTP server: %v", err)
logger.ErrorToConsole("could not start SFTP server: %v", err)