make sure we filter the ui as well as the logs
This commit is contained in:
parent
e4842b69b4
commit
a358b174a4
14
packer/ui.go
14
packer/ui.go
|
@ -247,6 +247,13 @@ func (rw *BasicUi) Message(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, "<sensitive>", -1)
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("ui: %s", message)
|
||||
_, err := fmt.Fprint(rw.Writer, message+"\n")
|
||||
if err != nil {
|
||||
|
@ -263,6 +270,13 @@ func (rw *BasicUi) Error(message string) {
|
|||
writer = rw.Writer
|
||||
}
|
||||
|
||||
// Use LogSecretFilter to scrub out sensitive variables
|
||||
for s := range LogSecretFilter.s {
|
||||
if s != "" {
|
||||
message = strings.Replace(message, s, "<sensitive>", -1)
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("ui error: %s", message)
|
||||
_, err := fmt.Fprint(writer, message+"\n")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue