From 1e5866bd2a3f8a95b43c50eee42efd4e3089f4c1 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Tue, 11 Jun 2019 14:04:36 -0700 Subject: [PATCH] apply logSecretFilter to output from ui.Say --- packer/ui.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packer/ui.go b/packer/ui.go index 2ee866d2b..0492ab314 100644 --- a/packer/ui.go +++ b/packer/ui.go @@ -236,6 +236,13 @@ func (rw *BasicUi) Say(message string) { rw.l.Lock() defer rw.l.Unlock() + // Use LogSecretFilter to scrub out sensitive variables + for s := range LogSecretFilter.s { + if s != "" { + message = strings.Replace(message, s, "", -1) + } + } + log.Printf("ui: %s", message) _, err := fmt.Fprint(rw.Writer, message+"\n") if err != nil {