From df977926ba769fe4cc764042317ac0a123ed6e5a Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 12 Jun 2019 09:50:27 -0700 Subject: [PATCH] filter machine readable UI --- packer/ui.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packer/ui.go b/packer/ui.go index 0492ab314..4c0b0857a 100644 --- a/packer/ui.go +++ b/packer/ui.go @@ -336,6 +336,12 @@ func (u *MachineReadableUi) Machine(category string, args ...string) { args[i] = strings.Replace(v, ",", "%!(PACKER_COMMA)", -1) args[i] = strings.Replace(args[i], "\r", "\\r", -1) args[i] = strings.Replace(args[i], "\n", "\\n", -1) + // Use LogSecretFilter to scrub out sensitive variables + for s := range LogSecretFilter.s { + if s != "" { + args[i] = strings.Replace(args[i], s, "", -1) + } + } } argsString := strings.Join(args, ",")