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

Dynamic Mutual TLS #22094

Closed
wants to merge 2 commits into from
Closed

Dynamic Mutual TLS #22094

wants to merge 2 commits into from

Conversation

kdubb
Copy link
Contributor

@kdubb kdubb commented Dec 10, 2021

Overview

Currently TLS setup is static for most of Quarkus extensions. This becomes problematic when implementing dynamic short lived certificates. This is most often done when implementing mutual TLS aka mTLS.

Many service meshes provide mTLS support and most of them offer certificate rotation (i.e. they are short lived certificates). For our team's current use case, where we've been implementing zero trust, we are basically only using the service mesh for mTLS.

That is where this idea arises from. Quarkus has a Vault extension and Vault's PKI extension (which Quarkus also supports) is a Certificate Authority designed explicitly for short lived certificates. Wiring Vault's dynamic certificates into Quarkus solves mTLS for us without requiring a service mesh.

Proof-of-Concept

This PR provides the following changes to have a complete PoC for dynamic mTLS.

mutual-tls extension.

Adds a mutual-tls extension that adds MutualTLSProvider and MutualTLSProvderFinder, very similar to the CredentialsProvider exposed via the credentials extension. Versions of X509KeyManager and X509TrustManager that support dynamic certificates are provided as well.

TestMutualTLSProvider

In test-framework a test implementation of MutualTLSProvider has been added. It creates a "root" and "intermediate" CA and then issues an "identity" cert for each configured/referenced mTLS provider. I've located it it test-framework to underscore that this can be used be any pluigin to validate support for dynamic mTLS.

This could also be made into a simple server that you can request certs from; very simple and very insecure. This would allow multiple processes to test dynamic mTLS without requiring a real provider like Vault be configured.

VaultMutualTLSProvider

Vault has been moved out of core but a Vault implementation of MutualTLSProvider has been created based on the PKI secrets engine. Testing was originally done with this until TestMutualTLSProvider was created.

Supporting Extensions

For this proof-of-concept support for MutualTLSProvider has been hacked into vertx-http and resteasy-reactive/rest-client. Given both those extenions are built on Vertx, it shows Vertx based extensions should be relatively easy to add support to. Other extensions should be coverted before a final design is locked.

Ideas

Although I set out to solve the problem of dynamic mTLS. You can see that this is really just a TLS configuration provider and requirement that it be installed in such a way that dynamic certificates are supported. The final configuraiton only has the idea of an "identity" certificate chain and then a set of "trusted" CA certificates. This is really no more than a standard TLS configuration has.

Because the TLS configuration is centralized in the "provider" and referenced from extensions, this change might allow TLS configurations to be shared across extensions without repetition; just by creating a "file" based TLS provider.

### MutualTLSProvider

Adds a `mutual-tls` extension that adds `MutualTLSProvider` and `MutualTLSProvderFinder`, very similar. to the `CredentialsProvider` exposed via `credentials`. Some utilities for `KeyManager` and `TrustManager` are provided as well.

### TestMutualTLSProvider
In `test-framework` a test implementation of `MutualTLSProvider` has been added. It creates a "root" and "intermediate" CA and then issues an "identity" cert for each configured/referenced mTLS provider.

This could be made into a simple server that you can request certs from; very simple and very insecure. This would allow multiple processes to test mutual TLS without requiring a real provider like Vault be configured.

### VaultMutualTLSProvider
Vault has been moved out of core but a Vault implementation of `MutualTLSProvider` has been created based on the PKI secrets engine. Testing was originally done with this until `TestMutualTLSProvider` was created.

### Supporting Extensions
For this proof-of-concept support for `MutualTLSProvider` has been hacked into `vertx-http` and `resteasy-reactive/rest-client`. Given both those extenions are built on Vertx, it shows Vertx based extensions should be relatively easy to add support to. Other extensions should be coverted before a final design is locked.
@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/rest area/testing area/vertx labels Dec 10, 2021
@kdubb
Copy link
Contributor Author

kdubb commented Dec 14, 2021

@cescoffier I read your comment over here #22182 (comment) and figured you should have look at this. I think this extensions could exactly that, see the Ideas section above.

@kdubb
Copy link
Contributor Author

kdubb commented Dec 14, 2021

@sberyozkin Can you take some time to look at this?

@cescoffier
Copy link
Member

This looks very out of date. What should be do?

@kdubb kdubb closed this Nov 13, 2022
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Nov 13, 2022
@kdubb
Copy link
Contributor Author

kdubb commented Nov 13, 2022

If we were to support this I'll recreate the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/rest area/testing area/vertx triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants