From 61c78fd3b9247362fae7d40f4acdeed0bb6a548f Mon Sep 17 00:00:00 2001 From: Pam Selle <204372+pselle@users.noreply.github.com> Date: Fri, 4 Sep 2020 13:18:30 -0400 Subject: [PATCH] Add case to compactValueStr not to expose sensitive vals in diagnostics --- command/format/diagnostic.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command/format/diagnostic.go b/command/format/diagnostic.go index 6ceb308945..38626e30bf 100644 --- a/command/format/diagnostic.go +++ b/command/format/diagnostic.go @@ -302,6 +302,10 @@ func compactValueStr(val cty.Value) string { // helpful but concise messages in diagnostics. It is not comprehensive // nor intended to be used for other purposes. + if val.ContainsMarked() { + return "(sensitive value)" + } + ty := val.Type() switch { case val.IsNull():