-
Notifications
You must be signed in to change notification settings - Fork 118
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
Use cryptographically secure RNG for random_string, or don't recommend them for passwords? #35
Comments
I'm interested in this one too. |
Hi @danielcompton! Agreed that the documentation here is not sufficient, in retrospect. If we change nothing else then we should at least repeat explicitly on the Looking at the |
Another alternative would be to have an argument that enables the use of a crypto random number generator. In this case the defaults don't change, but the user can easily enable it, if he needs to. Same can be used for all other resources in this provider. |
That is indeed an option. Since this provider doesn't currently make any promises about what random number generator it is using (and in general probably never will, since that would be constraining to future development) my instinct is that we should feel free to just change this unilaterally and not make it an option at all (since the result will still be a random string as promised, after all) but if we were to find a reason why that weren't true then we could indeed make it optional. I'd shy away from making this a global option applying to all resources here. Having multiple implementations of each resource would add considerable complexity to this provider and make it harder to maintain and improve over time. |
I can't think of any reasons where a cryptographically secure random number generator would be an issue here, I can't imagine the performance cost would ever be an issue. For that reason it seems like the safest option would be to make the random backend a cryptographically secure RNG. This would make it harder to misuse Terraform and create passwords or other secret values unsafely. This feels like a similar issue to hashicorp/terraform-provider-aws#3989. |
@apparentlymart I may be missing something, but isn't edit: This resource in particular looks like it was covered in #37 |
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. |
Affected Resource(s)
Description
Reading index:
But on random_string, it shows a demo using it for generating a password, and the API for random_string seems to be geared around generating passwords.
Is
random_string
suitable for generating passwords? If so, it could be good to explicitly mention this on the resource docs, or alternatively, mention that this resource is not for generating passwords?The text was updated successfully, but these errors were encountered: