-
Notifications
You must be signed in to change notification settings - Fork 323
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
[EKS] [request]: Provide correct jwks_uri from the Kubernetes API #2234
Comments
EDIT: ok, it seems like EKS does not actually serve all of its JWKS keys under At least you can automatically get the issuer URL from the cluster's
Alternatively, you can retrieve them with kubectl get --raw /openid/v1/jwks
# OUTPUT: {"keys":[...]} You can even set up a proxy based around kubectl proxy \
--address=0.0.0.0 \
--port=8080 \
--accept-hosts=.* \
--accept-paths=^/openid/v1/jwks$ \
--reject-methods=^(POST|PUT|PATCH|DELETE|HEAD|OPTIONS|CONNECT|TRACE)$ Now, there is still one big problem which is that if you are correctly validating a JWT to spec, the For example, retrieving the issuer with kubectl get --raw /.well-known/openid-configuration | jq -r '.issuer'
# OUTPUT: https://oidc.eks.<REGION_NAME>.amazonaws.com/id/<CLUSTER_ID> |
Tell us about your request
I am looking into using Kubernetes ServiceAccounts for inter-service authentication between different services in a Kubernetes cluster using service account token projection. To do this services will need to fetch openid-configuration to validate the signed JWTs
Which service(s) is this request for?
EKS
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
We are deploying our applications both to AWS and On-prem. If possible we would like to have as similar configurations as possible, where using Kubernetes has helped us a lot.
The problem I see is that while I can call the default Kubernetes endpoint:
https://kubernetes.default.svc/.well-known/openid-configuration
, thejwks_uri
parameter is set to an internal hostname, ex:https://ip-172-16-45-221.eu-west-1.compute.internal:443/openid/v1/jwks
. This is not a part of our VPC so I assume that it is the internal IP address of the instance running the api-server for EKS, so naturally I can not connect to it.The actual URI for the keys in EKS would be:
https://oidc.eks.eu-west-1.amazonaws.com/id/<cluster-id>/keys
which works.Are you currently working around this issue?
Calling
https://oidc.eks.eu-west-1.amazonaws.com/id/<cluster-id>/.well-known/openid-configuration
works as expected, but it would be convenient if we could always rely onhttps://kubernetes.default.svc/.well-known/openid-configuration
working within a clusterThe text was updated successfully, but these errors were encountered: