Skip to content

Support id token from external provider to access apiserver from proxy #103

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

Open
qiujian16 opened this issue Apr 26, 2022 · 2 comments
Open

Comments

@qiujian16
Copy link
Member

Consider we have an open id provider (e.g. github), we need a way to use the id token from the provider to access multiple managed clusters if they use the same id provider.

/cc @yue9944882 @xuezhaojun

@tpouyer
Copy link

tpouyer commented Apr 26, 2022

With IdPConfig we are able to configure Managed Cluster's OCP oauth config to connect to a central IDP server running on the hub cluster. The oauth config in OCP allows for browser based automatic login but does nothing for allowing the IDP issued token to be used when connecting to the Managed Cluster's kube api server. Effectively we are looking for a solution that would allow for a user to pass a bearer token populated with an IDP issued token on requests to a Managed Cluster's kube api server. On the Managed Cluster the reciever of the request would need to verify the authenticity of the bearer token with a pre-defined IDP server (configured on each Managed Cluster via either by custom config or utilizing the existing OCP oauth config). Once the bearer token has been verified and the user-info has been retrieved from the IDP server the reciever on the Managed cluster should lookup an existing user by the username provided by the IDP token in the OCP cluster. Once the user has been found the request should utilize user-impersonation to execute the request against the kube api server on the Managed Cluster and return the result to the user.

This is a good example of the functionality we are looking for:
https://www.jetstack.io/blog/kube-oidc-proxy/

Here is the existing code related to the article above:
https://github.com/jetstack/kube-oidc-proxy

@tpouyer
Copy link

tpouyer commented Apr 26, 2022

I'm not yet convinced that this work needs to be integrated into the reverse proxy service. If the reverse proxy service is capable of calling multiple service end-points on the managed cluster then it would make more sense to create a new proxy service that would run on the Managed Clusters that the reverse proxy could target. That way a user could either use the reverse proxy and target the kube-oidc-proxy service on the Managed Cluster or they could target the kube-oidc-proxy service on the managed cluster directly without going through the reverse proxy. My only concern about forcing all communications through the reverse proxy would be the performance hit. Obviously if there is a firewall between the hub and the Managed Cluster then it would be necessary to go through the reverse proxy, otherwise the user may elect to communicate directly with the managed cluster via the kube-oidc-proxy service.

xuezhaojun pushed a commit to xuezhaojun/cluster-proxy that referenced this issue Jul 1, 2024
Signed-off-by: red-hat-konflux <123456+red-hat-konflux[bot]@users.noreply.github.com>
Co-authored-by: red-hat-konflux <123456+red-hat-konflux[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants