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
Feature Request: add provider argument use_child_token
to control child token creation
#722
Comments
use_child_token
to control child token creationuse_child_token
to control child token creation
@rokrokss hi! Let's move our conversation over to here because it has steps to reproduce what you're going for in the linked PR. So, when I use a Terraform config like this:
I receive a valid periodic token in Terraform state. If I log in with it and test it and renew it, it's valid.
Note that I can renew it indefinitely unless I fail to renew it within the 60 seconds I've configured. |
@tyrannosaurus-becks I had the similar setup and mine was gone in 20 minutes. Can you try with some longer periodic token and try renewing after 18 minutes, it gives no error and shows it gets renewed but was gone in 2 minutes. |
https://github.com/terraform-providers/terraform-provider-vault/blob/master/vault/provider.go#L726 |
Ah, I see! Thanks for linking to that. So the child token created there has a default max TTL of 20 minutes, driven by this field. Hm, I'm reluctant to stop using child tokens or to support periodic ones for the security reasons described here. Basically, tokens can be written out to Terraform state, and thus viewed, logged, or leaked. Having the tokens be limited in life reduces the risk of them being leaked. I'm concerned that if we add support for periodic, never-ending tokens, we're creating a way for folks to shoot themselves in the foot security-wise. Is your use case achievable by simply extending the max TTL? |
Not, really. The created tokens need to have infinite max TTL, but I made it with cli. In my opinion I think we need an open way to bypass obscured child token creation. I think people can expect that tokens might be in tfstates but not the child token problem because it is hard to see with logs. |
#775 was merged - please see PR for details. When an upcoming release includes that change, you will be able to configure the vault provider to skip creation of the child token for situations like these where you do not want a limited TTL on the token used by Terraform.
|
Terraform Version
v0.12.24
Affected Resource(s)
vault_token
Expected Behavior
User can choose whether to use child token or use the injected token itself.
Actual Behavior
One cannot use the injected token itself.
Since the usage of child token is default and cannot be refused,
vault_token
resources created with terraform will be revoked in 20minutes(default ofmax_lease_ttl_seconds
.)There are periodic service tokens which are meant to have possibility to live no max TTL.
For the developers using terraform to create vault resources, they might not be aware of the child token because the create
vault_token
resources won't show that their parent has a short TTL. I've been struggling while dealing with periodic tokens disappearing in 20 minutes without a notion.Steps to Create Periodic Tokens
References
The text was updated successfully, but these errors were encountered: