terraform/command/views
Martin Atkins 8f233cde4c cli: Diagnostics can include collections with sensitive elements
We previously had a shallow IsMarked call in compactValueStr's caller but
then a more-conservative deep ContainsMarked call inside compactValueStr
with a different resulting message. As well as causing an inconsistency
in messages, this was also a bit confusing because it made it seem like
a non-sensitive collection containing a sensitive element value was wholly
sensitive, making the debug information in the diagnostic messages not
trustworthy for debugging certain varieties of problem.

I originally considered just removing the redundant check in
compactValueStr here, but ultimately I decided to keep it as a sort of
defense in depth in case a future refactoring disconnects these two
checks. This should also serve as a prompt to someone making later changes
to compactValueStr to think about the implications of sensitive values
in there, which otherwise wouldn't be mentioned at all.

Disclosing information about a collection containing sensitive values is
safe here because compactValueStr only discloses information about the
value's type and element keys, and neither of those can be sensitive in
isolation. (Constructing a map with sensitive keys reduces to a sensitive
overall map.)
2021-04-19 11:58:49 -07:00
..
json cli: Diagnostics can include collections with sensitive elements 2021-04-19 11:58:49 -07:00
apply.go views: Fix missing source in diagnostic output 2021-02-26 16:43:03 -05:00
apply_test.go cli: Migrate apply to command views 2021-02-22 11:47:40 -05:00
hook_count.go cli: Migrate apply to command views 2021-02-22 11:47:40 -05:00
hook_count_test.go cli: Migrate apply to command views 2021-02-22 11:47:40 -05:00
hook_ui.go cli: Fix misapplied terminal colors on run logs 2021-02-16 15:05:22 -05:00
hook_ui_test.go cli: Fix misapplied terminal colors on run logs 2021-02-16 15:05:22 -05:00
operation.go Fix typo in plan no changes output message 2021-03-22 16:39:53 -04:00
operation_test.go backend/local: Replace CLI with view instance 2021-02-18 12:08:08 -05:00
output.go views: Fix missing source in diagnostic output 2021-02-26 16:43:03 -05:00
output_test.go views: Expand test coverage for views.Output 2021-02-16 08:48:31 -05:00
plan.go views: Fix missing source in diagnostic output 2021-02-26 16:43:03 -05:00
plan_test.go cli: Migrate plan to command views 2021-02-23 10:09:25 -05:00
refresh.go views: Fix missing source in diagnostic output 2021-02-26 16:43:03 -05:00
refresh_test.go cli: Migrate refresh to command views 2021-02-22 11:58:52 -05:00
show.go backend/local: Replace CLI with view instance 2021-02-18 12:08:08 -05:00
state_locker.go views: Fix missing source in diagnostic output 2021-02-26 16:43:03 -05:00
test.go command: Experimental "terraform test" command 2021-02-22 14:21:45 -08:00
test_test.go command: Experimental "terraform test" command 2021-02-22 14:21:45 -08:00
validate.go cli: Migrate validate command to views 2021-03-18 15:56:28 -04:00
validate_test.go cli: Migrate validate command to views 2021-03-18 15:56:28 -04:00
view.go views: Remove outdated comment 2021-02-25 09:34:32 -05:00