-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Hide sensitive values when showing stored plan #27577
Comments
Hi @alisdair I'm not a contributor yet, but I wanted to look into this. I'm using this main.tf:
I tried terraform version 0.14.4 and 0.15.0-alpha20210107. Both give the same output where |
The issue is with sensitive values, not sensitive attributes. There are several uses of the term "sensitive" in Terraform which are related but not identical. Here's a configuration which reproduces the issue: variable "foo" {
default = "foo"
sensitive = true
}
resource "random_pet" "pet" {
prefix = var.foo
}
Note that while it may be interesting to look into, this particular enhancement isn't a great case for a first contribution. It will mean changing the plan file format and the JSON equivalent, which we have to be very careful about doing in order not to break backwards compatibility. |
@alisdair Thanks for the explanation and the example, now I see. And also confirm 😉 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Current Terraform Version
Use-cases
The CLI output of
terraform plan
hides sensitive values from the diff display, in order to prevent accidental display of sensitive information. At the moment, storing the plan in a file and later rendering it does not behave in the same way, and sensitive values are displayed:It would be useful to add support for sensitive value hiding for workflows which store a plan artifact for later use.
Similarly extending the JSON plan file format to include this information would allow building tools to display stored plans while still obscuring sensitive values.
Note that I do not consider this a security issue, as this is purely a UI issue—storing sensitive values in the plan file is expected.
Proposal
I think the underlying issue is that the plan file does not currently include information about sensitive values, so Terraform cannot hide sensitive values when reading a stored plan.
Proposals:
terraform show my.plan
terraform show
if necessary to hide those values, so thatterraform plan
andterraform show my.plan
show the same diff UIThe text was updated successfully, but these errors were encountered: