-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Add sensitive attribute to variables #26183
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
862ddf7
Add a sensitive attribute
pselle 84d118e
Track sensitivity through evaluation
pselle 896d277
If the path is empty, we should not be marking the path
pselle 6c129a9
Unmark/remark in apply process to allow apply
pselle 7fef1db
Add sensitive variable configs test coverage
pselle bc55b6a
Use UnmarkDeepWithPaths and MarkWithPaths
pselle e9d9205
Modifications to eval_diff
pselle 5b0b1a1
Update object compatible check to unmark
pselle 3e8b125
Apply does not need remarking
pselle 61c78fd
Add case to compactValueStr not to expose sensitive vals in diagnostics
pselle b03d5df
Disallow sensitive values as for_each arguments
pselle 712f5a5
Update plannedNewVal itself
pselle 4089b77
Update vendored code
pselle 3723594
Point go module at master go-cty
pselle 843ed89
Don't save PathValueMarks on instance_object
pselle 02c1bdd
Create experiment for sensitive attribute
pselle e4e16cc
Rebase fix
pselle 4034cf9
Add basic plan test coverage
pselle 8d8389d
Add diff test with a sensitive change
pselle 20ee878
Updates and improvements to comments
pselle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
terraform { | ||
experiments = [sensitive_variables] # WARNING: Experimental feature "sensitive_variables" is active | ||
} | ||
|
||
variable "sensitive-value" { | ||
sensitive = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know anything about marks, so please excuse the question if it's nonsense:
Is there any risk that not checking for the specific sensitive marker here could cause problems in the future? Is there any chance that a provider could start using marks, and then someone using terraform 0.14 and that provider would run into a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's not a risk of that.
Value
s can't be encoded with marks, so a provider cannot send marked values, and that's also why we have to unmark/remark values sending them through providers.On the methods themselves,
IsMarked
is a very simple check, withHasMark
being the more specific one. https://github.com/zclconf/go-cty/blob/master/cty/marks.go#L90-L102 UsingHasMark
would require creating a type specific to the mark. Since there's only one (naive) mark presently ("sensitive"), this is avoiding that at the moment.