-
Notifications
You must be signed in to change notification settings - Fork 374
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
helm_release metadata not cloaked when key contains "." character #737
Comments
@camlow325 we are also facing this issue and I found that line 879 from the file resource_release.go is the culprit. pathKeys := strings.Split(valuePath, ".")
sensitiveKey := pathKeys[len(pathKeys)-1]
parentPathKeys := pathKeys[:len(pathKeys)-1] When this line was introduced I think it was not considering field names with backslashes. Thus, it is matching any field names with dots but we only should be matching only the dots that are not prefixed with backslashes "". I considered using a regex split but Go regex implementation doesn't support the look backward matching. So maybe we can write a custom tokenization algorithm to solve this issue. I will make a PR with that and see what the maintainers say. |
@camlow325 Does #746 fix your issue? |
@pviniciusfm, your fix worked great for me. Thanks for doing this! |
Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you! |
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. |
Terraform, Provider, Kubernetes and Helm Versions
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
terraform apply
terraform destroy
Expected Behavior
Apply succeeds. In the
plan
output for the destroy, the value for thefoo.bar
key under themetadata
attribute is marked assensitive
:Actual Behavior
Apply succeeds. In the
plan
output for the destroy, the value for thefoo.bar
key under themetadata
attribute is shown in original plain text (not markedsensitive
):Important Factoids
The value is also shown in original plain text in Terraform 0.14.x and earlier in the
plan
output ahead of anapply
when the concise diff feature is disabled (TF_X_CONCISE_DIFF=0
).When the key does not have a "." character in it, (e.g., using
name = "foo.bar"
in the example above, the value is shown as"(sensitive value)"
, as expected. In our case, though we need to set a key with a "." in its name, due to how the underlying Helm chart has been designed. We use\\.
to escape the "." character, in order to avoid having it be misinterpreted as a delimiter for a YAML "sub-map".It doesn't appear that using the new sensitive function in Terraform 0.15 would help in this case since the sensitivity only applies to the
set_sensitive
block, not themetadata
attribute.References
Community Note
The text was updated successfully, but these errors were encountered: