Replies: 4 comments
-
Hi @isihu, thanks for asking your question here. When you configure a JWTAuthenticator, you are configuring it for use by the This level of detail is usually abstracted by the Pinniped CLI, which will take care of calling the If you could share a little more about the bigger picture of what you are trying to accomplish, then we might be able to provide more specific help. What was your original problem that caused you to start debugging at this level of detail? What you saw in the logs about token reviews is something else. The impersonation proxy will automatically perform token reviews sometimes as part of doing its job. It is not related to WebhookAuthenticators. |
Beta Was this translation helpful? Give feedback.
-
Hi @cfryanr, thanks for your detailed response. Our situationWe are currently operating a multi-tenant Kubernetes Cluster on AWS. Now we want to add an AKS multitenant cluster and hoped that we can authenticate people in the same way. But for some reason, Azure decided to disable the feature that is literally already implemented in the API Server🥲 . They said that they were going to implement it though which was 2 years ago.
Our testsWhen trying it out first on AWS, it worked just as we expected. We were able to send a request to the service of the impersonation proxy with the JWT in the Auth Header and we got a response. We could also change the behavior by changing the RoleBindings. That's why I dug so deep in AKS. It simply worked on AWS. After your response I tested it out on AWS again. And sending requests to the Concierge worked only when the OIDC provider was configured in the API Server. I didn't even have to configure JWTAuthenticators or WebhookAuthenticators. As stated in my original question, that does make me guess that the Concierge authenticates request by using the TokenReview API of the API Server in some cases. That would also match the behavior of the TokenReview API which only validates a TokenReview with a JWT if the API server trusts the issuer. Our expectations from PinnipedI thought that the Authenticators are
So basically, we expected the functionality of the Pinniped CLI to be server-side. How to proceedThere probably isn't a way to configure JWT Authenticators in the way I imagined, is there? Other than that, I'm not sure how to proceed but I hope I could give you a more precise understanding of what we are trying to accomplish. |
Beta Was this translation helpful? Give feedback.
-
Thanks for explaining your use case in detail.
While this statement from the Pinniped docs is conceptually true, and the Pinniped code for JWTAuthenticator actually uses the same Golang code from Kubernetes to implement this behavior, it is unfortunately not literally exactly the same, in the ways that I mentioned above. The Pinniped CLI will hide most of the differences to allow the end user's experience to be fairly seamless, but there are some key differences under the hood.
At that point, the impersonation proxy is just passing through your bearer token, and isn't really adding any value. If you can configure the OIDC settings on the API server directly, then you don't really need the Concierge on that cluster.
No, there isn't. Not at this time.
That could be possible. It could basically do what the Pinniped CLI does, but do it in a server. However, that server would then be holding everyone's mTLS client credentials, presumably in some sort of session storage. It would take some work to write that code, get it correct from a security point of view, and protect those credentials. Alternatively, you could have your end users install the Pinniped CLI. That seems like a much simpler solution. :) As the cluster owner, you can use the Pinniped CLI to generate kubeconfigs for your end users. Those kubeconfigs have no particular identity or credentials in them, so every end user can use the same kubeconfig for a cluster, which makes them easy to distribute. It's easy for end users to install the Pinniped CLI, e.g. I'll also make a quick plug for the Pinniped Supervisor, in case you had not considered it yet. By using a Pinniped Supervisor (you only need one), you could improve the user experience of your end users (e.g. login once per day and then access all clusters of all types for the rest of the day, support for logging in from jump hosts that have no web browser, etc.) and improve security (e.g. short-lived cluster-specific tokens, user's group memberships are updated frequently, user's permission to continue their sessions are checked frequently, kubeconfigs never contain credentials, etc.). On your AWS clusters, you could simply configure the API server to trust JWTs issued by the Pinniped Supervisor. On your AKS clusters, you could use the Concierge with a JWTAuthenticator configured to trust JWTs issued by the Pinniped Supervisor. Your users would need the Pinniped CLI, which would help make everything seamless and appear to work the same across all these cluster types. And the Supervisor always gets user authentication and identities from an external provider of your choice (OIDC, LDAP, AD, or GitHub). |
Beta Was this translation helpful? Give feedback.
-
Ahh, of course. That's why it worked 😄
For now, I'll just try to replicate the behavior on Azure with as little effort as possible. But when there's time for a redesign, maybe to streamline authentication to both cloud providers, Pinniped seems like a very good choice. Thanks for all the information! |
Beta Was this translation helpful? Give feedback.
-
Hi everybody,
I'm trying to deploy the Concierge by itself on AKS.
I have deployed a JWTAuthenticator.
According to the status, it is valid:
I'm sending requests to the Concierge via
curl
putting my JWT in the Authorization header.It returns
I have raised the log level to
all
and found these 2 entries stating that a request to the TokenReview API fails:I could recreate the error from the TokenReview API via
kubectl create -o yaml -f tokenreview.yaml
using this as thetokenreview.yaml
:Following the docs, it seems like the Concierge is trying to authenticate the requests via Webhook even though no WebhookAuthenticator is required. Maybe the Kubernetes API Server is used as a default WebhookAuthenticator?
Why doesn't it try to authenticate the JWT via the JWTAuthenticator configured? Do I have to put the JWT somewhere else?
Kind regards
Beta Was this translation helpful? Give feedback.
All reactions