Skip to content
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

TLS utility provider #2778

Merged
merged 1 commit into from
Oct 29, 2015
Merged

TLS utility provider #2778

merged 1 commit into from
Oct 29, 2015

Conversation

apparentlymart
Copy link
Contributor

The TLS provider has general utility resources for TLS provisioning.

In this first implementation it contains only logical resources to aid in the creation of private keys (for testing/development only), self-signed certificates and certificate requests. These can then be used with other providers to create TLS-enabled resources.

  • tls_private_key resource
  • tls_self_signed_cert resource
  • tls_cert_request resource
  • Tests
  • Docs

This provider could also be a reasonable home for an implementation of the new LetsEncrypt ACME protocol once it stabilizes, allowing "real" CA-issued certificates to be created too. However, I won't add that at least until LetsEncrypt has released a first stable version of its own client in Python.

@apparentlymart apparentlymart changed the title tls_self_signed_cert resource type. TLS utility provider Jul 18, 2015
@phinze
Copy link
Contributor

phinze commented Jul 29, 2015

Wow. This is great work, @apparentlymart. Wow.

Will get one of us to circle back for a more detailed review, but on first pass this looks darn near perfect.

Thank you!

@apparentlymart
Copy link
Contributor Author

Over in #3599 I wrote a little about how this might be extended to work with Let's Encrypt and ACME, though I'd still like to merge this logical-only patch first and then we can build on it in separate changesets to add the ACME support.

@phinze Is this looking ready to merge to you? If possible I'd like to get this merged before Let's Encrypt becomes generally available, so these building blocks are available for me or someone else to work on additional resources for issuing "real" certificates using the ACME protocol.

As of this commit this provider has only logical resources that allow
the creation of private keys, self-signed certs and certificate requests.
These can be useful when creating other resources that use TLS
certificates, such as AWS Elastic Load Balancers.

Later it could grow to include support for real certificate provision from
CAs using the LetsEncrypt ACME protocol, once it is stable.
@phinze
Copy link
Contributor

phinze commented Oct 29, 2015

This thing is beautiful. Landing it! ✈️

phinze added a commit that referenced this pull request Oct 29, 2015
@phinze phinze merged commit 32ae193 into hashicorp:master Oct 29, 2015
@silas
Copy link
Contributor

silas commented Nov 9, 2015

Curious if there was a reason for not implementing tls_signed_cert as part of this PR? Being able to create a CA and creating/signing a bunch of certs would be useful for spinning up dev clusters (consul, kubernetes, etc...).

If not would you consider accepting a PR?

@apparentlymart
Copy link
Contributor Author

@silas I was planning to implement the ACME protocol to get signed certs from registrars (some design notes in #3599) and so this set of stuff was basically intended as the building blocks for that, plus the self-signed cert just because it was easy once I'd done the other parts and handy for quick development environment stuff.

If I'm understanding correctly, what you want to do is take a CA cert and its associated private key and use those in conjunction with a CSR to produce a cert that is signed by that CA cert.

In which case, a resource for that seems reasonable and a logical extension building on the existing tls_private_key, tls_self_signed_cert and tls_cert_request resources to produce an ad-hoc, low-security PKI for development environments. I think it'd be great as long as its documentation carries all of the appropriate disclaimers and warnings. 😀

The only thing I'm kinda concerned about is making sure we have things named nicely so it's easy for users to understand the three different cases and how they differ:

  • Certificates from an upstream CA (via ACME): tls_certificate
  • Self-signed certificates: tls_self_signed_cert
  • Certificates from a local CA managed within Terraform: tls_locally_signed_cert ???

I think the ACME-issued certs deserve to get the most straightforward and "primary-sounding" name tls_certificate because that's the resource people ought to be using by default for production systems. That leaves the other two cases needing extra adjectives to explain how they are different. "Locally-signed" was the best discriminator I could come up with for the "signed by a local CA" case, but perhaps we can do better!

@silas
Copy link
Contributor

silas commented Nov 10, 2015

@apparentlymart Yup, you understood me correctly, and I agree on all points.

tls_locally_signed_cert sounds fine to me (couldn't come up with anything better).

@silas
Copy link
Contributor

silas commented Nov 15, 2015

@apparentlymart I'd love any feedback you might have on #3930

@ghost
Copy link

ghost commented Apr 30, 2020

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.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants