-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement client-side mTLS support settings #697
base: main
Are you sure you want to change the base?
Conversation
Hello, The overall direction of your PR is correct. The issue with cert-manager is:
unfortunately there's no way to disable client cert request just for the HTTP01 challenges as this is configured per port (443) and as such, HTTP01 challenges are fundamentally incompatible with mTLS. You have to use a different cert-manager Issuer challenge type, such as DNS. Please disregard autocert message, it's coming from OCSP code that's historically running inside autocert module. There's no autocert running in Kubernetes. This runaway message is tracked in pomerium/pomerium#4245 |
Thank you for the super quick answer!
Wouldn't it be possible to disable the https redirect on port 80 for the ACME challenge routes? That way we circumvent the problem entirely. EDIT: Background info: Let's Encrypt verifies the challenges using plaintext requests but follows redirects. |
currently everything is configured on port 443, port 80 is only doing redirects. For the time being I recommend to switch to DNS challenges. |
You know, having thought a bit about this I think the entire approach might be wrong. mTLS is such a different beast from how Pomerium otherwise does things, that fully supporting it might end up ruining everything else. I'm thinking of just hosting node-oidc-provider and then connecting it to Pomerium. |
Hi @andsens, I believe you can set I should also mention that we're currently in the middle of rethinking Pomerium's mTLS support, so if you have any specific suggestions or feature requests please feel free to share them. I can't make any promises, but if you have any thoughts I'd be interested to hear them. |
I haven't been able to find a discussion or issue related to this, so I guess I'll just post my comments here :-) The advantage of implementing mTLS directly in Pomerium is that API integration for anything Pomerium is proxying is super easy. Just setup e.g. an openssl config, reference it with curl, and you're done. This gets quite a bit more advanced if there is a separate mTLS endpoint that needs to be authenticated against first. The disadvantage is that mixing mTLS into all of this can become super complicated. The requirements for it and configuration of it is just completely different from all the other authentication flows, which might mean having to account for it in every single feature that you implement (or worse, you forget to account for it). I see a solution that could circumvent both issues, but it's a little more complicated: A built-in, but separate, mTLS server that acts as an OIDC provider and can authenticate browser clients, and an authentication flow that supports The advantage of using a single OIDC endpoint for browser mTLS is that you can avoid presenting the user with PIN prompts (when e.g. using a HSM) for every pomerium protected site they visit. EDIT: Oh, and another advantage to this approach is that you don't have to figure out how to get mTLS working with HTTP3/QUIC |
Hi @andsens, delegating mTLS to a separate identity provider is definitely an interesting idea. I think one could even prototype this today without further changes to Pomerium itself: if this OIDC provider returned a custom claim in its ID token, you could write a Pomerium policy with a |
@kenjenkins That's actually exactly what I have done now! There are still some deps that require a little bit of documentation before publishing it. Basically the config for my "mTLS to OIDC bridge" looks like this:
So now I just configure pomerium with:
and annotate ingresses with e.g.:
Next up I might start adding custom claims so that you can e.g. grant access to an entire department by mapping the certificate "OU". |
See #696
This is far from done. I tested it and quickly ran into issues with cert-manager:
The autocert thing is a bit concering, I thought that was disabled in Kubernetes?
I also tried setting
ingress.pomerium.io/allow_any_authenticated_user: 'true'
on the acme solver ingress, but that gave the same errors. It would seem that the client cert requirement kicks in before the authentication check is performed?