-
Notifications
You must be signed in to change notification settings - Fork 5
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
[GCP] Extract tls_private_key
resource from hashicorp/tls
provider into an insecure module
#222
base: main
Are you sure you want to change the base?
Conversation
I like that the bit that we know for sure is insecure is carved out. However, the private key is still passed as an argument, and I don't know for sure how safe this is, and I wouldn't be surprised if there were ways to extract the key from debug logs, or by printing it. Until we have a battle and tested production I think we'd still want to have warnings that mention that the secretmanager module is not safe? What do you think? |
Gotcha, I understand your concern. Enforcing the write-only attributes (i.e. Would that address your concern? |
I did not know about this! It looks promising indeed, and it seems to be supported by AWS as well. I had an alternative idea in mind, which would not depend on Terraform. It's not a full design, and would certainly requite a bit more work. Throughout the lifecycle of a log, we need to perform these operations:
We could write a simple go binary that achieves 1, 2 using GCP Go APIs. A user would be set up in advance, with the right permissions to launch this binary, and run it once only. That would make 1. and 2. more transparent I think (a few lines of Go), and means that all key access happens through Go APIs (like 3.). I like that the key provisioning system would have a low number of dependencies, that it would be easier to read the code that generates it, and easy to track where the key lives (only in memory and Secrets Manager). This means that Terraform would never touch keys, and that the users allowed to deploy Terraform wouldn't have access to it either. Depending on the access that the user has, we could even make sure that key generation can only happen on compute ressources that run on GCP, not on someone's laptop for instance. The only thing we'd need in terraform would be a way to identify the key, through a name or an id for instance, which could be hardcoded for every log. It comes with the downside that one piece of infrastructure (keys) would be created without Terraform, but I think that's an ok compromise. Note that the binary that generates this key could still be launch via terraform to make the deployment process smooth! |
In the meantime, if the write_only feature makes the setup a bit better, sure thing! Would it be compatible with this PR, or would we have to go back to using a single module, specifically because of the write_only bit? We could scope this to the private key only, right? |
6b54908
to
806cfeb
Compare
Does this forbid the use of opentofu? |
It should be ready now. Please try again to see if it works in OpenTufu. |
There is a new warning message after bumping the GCP provider to the latest version. We can also move the public key to the write-only attribute, and then grab the secret value from
|
Towards #110, #219.
The staging log arche2025h1 would be affected by the auto deployment. A manual deployment is required. It's probably a good chance to run the Manual Deployment playbook.