Create optional provider config setting for using or disabling the child token - #775
Conversation
|
@tstraley Thankyou so much for the contribution! looks like the only thing holding this back is for you to sign the CLA as mentioned above by @hashicorp-cla. Don't want to be a bother, but me and my team could really use this once its merged upstream. |
|
After further investigation it appears that @tstraley has been largely inactive on github for 6+ months, with the only blocker being that they have not accepted the hashicorp CLA. |
|
@nikolaishields - thanks for the bumps, this had fallen way off my radar. I am now seeking approval from my employer's license review board before I can accept the hashicorp CLA and get this moved on. |
|
Can I please get reviews from the maintainers of this project? I believe this is ready for merge (long overdue). Thanks :) |
|
@catsby @tomhjp @tvoran @jasonodonnell - is this something any of you could look at? |
|
I think this could resolve several other feature requests, what do you think @tyrannosaurus-becks ? |
|
As for the security concern, in many use cases an encrypted Terraform backend could mitigate a lot of the risk. |
|
Hi @matttrach , I'm no longer involved with this project and have moved on from HashiCorp. |
|
We will miss you @tyrannosaurus-becks ! |
|
@tstraley Many Thanks for your contribution on this. With the remote disk encrypted backend becoming the norm, this has become a much awaited feature. Maintainers(@catsby @tomhjp @tvoran @jasonodonnell ), any updates on the ETA? |
|
Can this be merged and released please? |
|
Or is there a way to merge this change locally and replace the hashicorp provider? |
|
@jasonodonnell can this be approved please? It's just a small change on 3 files. |
|
Hi @rmgpinto, we're still discussing the security implications of this change internally and haven't reached a decision yet. This PR is high quality and it looks good from a code perspective, but the exposure of Vault tokens via Terraform state files and logs are definitely concerning (even when the defaults are security focused). All that said this is on our immediate radar and we'll make a decision very soon. Thanks for your patience on this! |
|
Thanks for the quick feedback! |
|
@jasonodonnell, could you provide some insight as to what the security implications are for this particular PR? |
|
@jasonodonnell giving this a bump. I want to call out that all of the security considerations are well documented and this isn't something that users would use unless they need it and understand those risks. Having the option available has been a major request for many years now, and I'm not hearing any reason this should be held up further. Please let me know if you'd like me to resolve the new merge conflicts and re-push so this can finally land. |
|
@tstraley thank you for this. Just commenting here for an update, so I could just |
|
@tstraley we are taking another look at this PR. Would you mind rebasing it off of main? Thanks, Ben |
Adds setting and documentation for create_intermediate_child_token provider configuration item. This defaults to true and is strongly discouraged to disable. When disabled, it allows users to use the vault terraform provider without the provided token creating ephermeral child token.
Adds tests for the `create_intermediate_child_token` vault provider config setting. Also refactors a couple test helper functions to avoid duplicate code in common testing patterns.
2a704f1 to
e73ac1b
Compare
|
@benashz - just rebased, resolved conflicts, and pushed updated version up. Please have a look and let me know if you'd like any changes. Happy 🦃 |
benashz
left a comment
There was a problem hiding this comment.
This is looking pretty good so far. I have provided some initial feedback.
Thanks,
Ben
Per pull request review from @benashz This name change includes a flip in the logic: if skipping the creation of the child token is true, we do not create it and assign it, if false we follow the default behavior of using the child token. Tests and documentation were updated to match.
benashz
left a comment
There was a problem hiding this comment.
Looking good! Just a few minor suggestions.
c060b9b to
650ef8c
Compare
|
@benashz just giving this a gentle bump for re-review. |
benashz
left a comment
There was a problem hiding this comment.
So we just need to address the documentation comment, then +1.
Thank you for your contribution to HashiCorp!
|
Thanks again @tstraley for all the effort on this PR. It's much appreciated! |
Based on review of 7 highly-commented PRs (hashicorp#1815, hashicorp#1821, hashicorp#902, hashicorp#2128, hashicorp#1877, hashicorp#2548, hashicorp#775) on hashicorp/terraform-provider-vault: - Use d.Get() instead of d.GetOk() for boolean field validation per SDKv2 best practice (d.GetOk returns (false,false) for booleans set to false, a known limitation flagged in PRs hashicorp#1815 and hashicorp#2128) - Add grace_period validation when dual_account_mode is enabled (must be > 0; catches misconfiguration at provider level before Vault API) - Add standby field test assertions (standby_username, standby_dn, standby_password) to dual-account data source acceptance test per PR hashicorp#2128 reviewer feedback: 'make assertions about what we expect' - Clarify grace_period docs: required when dual_account_mode is true, must be >= 5s and < rotation_period - Fix data source docs section header consistency Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This adds a new (often requested) vault provider configuration setting which can allow users to disable the creation of the intermediate child token (strongly discouraged, but made available for the cases that need it).
(Open to changing the name of this config item, or related env var, but I like to be verbose with settings that typically shouldn't be adjusted without reading the documentation).
Community Note
Closes #29
Closes #722
Relates #550
Relates #368
Relates #192
Relates to the following as well:
hashicorp/terraform#16457
hashicorp/terraform#14839
https://groups.google.com/forum/#!topic/terraform-tool/wtlLrKVQlAo
Release note for CHANGELOG:
Output from acceptance testing: