Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin2host: Send marked values over the wire #239

Merged
merged 1 commit into from
Mar 25, 2023

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Mar 12, 2023

See also #235

For similar reasons as #235, values marked sensitive were not sent to plugins. In particular, there is a technical difficulty that marked values cannot simply be serialized.
https://github.com/terraform-linters/tflint/blob/v0.45.0/plugin/server.go#L128-L137
https://github.com/zclconf/go-cty/blob/v1.13.0/cty/msgpack/marshal.go#L46-L48
https://github.com/zclconf/go-cty/blob/v1.13.0/docs/marks.md#marks-under-serialization

This PR serializes sensitive values in a proprietary way so that they can be sent to plugins. Below are compatibility notes:

  • Before TFLint v0.46
    • Both server-side and client-side are checked for errors. However, the added error is never returned as the error is always returned on the server side only.
  • TFLint v0.46
    • An error is returned on the client side only. However, for cty.DynamicPseudoType it now returns the marked value instead of an error.

Be aware that the TFLint v0.46 + SDK v0.15 can unintentionally expose sensitive values to plugins. To avoid this, the server should return sensitive values only for SDK 0.16+.

@wata727 wata727 force-pushed the proto_for_marked_value branch from bf0d594 to 978dd8d Compare March 18, 2023 13:57
@wata727 wata727 force-pushed the proto_for_marked_value branch from 978dd8d to 18f94f9 Compare March 19, 2023 07:50
@wata727 wata727 marked this pull request as ready for review March 19, 2023 07:51
@wata727 wata727 merged commit f5d1807 into master Mar 25, 2023
@wata727 wata727 deleted the proto_for_marked_value branch March 25, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant