-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
istioctl JWT tokens to contact istiod #24905
Comments
@howardjohn suggests using a token rather than a cert. |
Are you trying to build a tool in istioctl for debugging? If so, I think we should define the right way to do it. It would be better that istiod generates the key/cert and writes it to some K8s resource, and RBAC on that resource is in place to protect it. Using K8s token also works with RBAC protection. The most important thing is Istiod should authenticate and authorize the caller. |
To get certificates that work with the latest master:
At this point, the certs should be good enough to use |
@irisdingbj Is there an example of how VMs get and use tokens? I would like istioctl to be as close to a sidecar as possible in implementation. |
@esnible as for as I know current VM doc is based on client cert. There are some discussions to make VM use token to bootstrap but I am not keeping close track of it. Back to token for istioctl, you can use the default token for a namespace directly or use TokenRequest from k8s to create one and use it. |
The token request:
gets a token. replace |
One note - the expiration time on that request is massive. If we are doing
this in istioctl or something, should likely be much smaller. Great for
testing though
…On Tue, Aug 18, 2020 at 4:25 PM Ed Snible ***@***.***> wrote:
The token request:
echo '{"kind":"TokenRequest","apiVersion":"authentication.k8s.io/v1","spec":{"audiences":["istio-ca"], "expirationSeconds":2592000}}' | kubectl create --raw /api/v1/namespaces/default/serviceaccounts/default/token -f - | jq -j '.status.token' > ./var/run/secrets/tokens/istio-token
gets a token. replace default and default with relevant NS and SA.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24905 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEYGXKW2TIOYFZ7QDKJQ53SBMEWDANCNFSM4OF3TZYA>
.
|
@howardjohn Understood about the expiration time. The example is 720 days. What do you think would be reasonable for Istio?
Question about how to use it. The ADSC functions seem to need both a JWT Token and a istio.io/istio/pkg/security.SecretManager. I see |
how kubectl works (at least with GKE) is it sticks the token in kubeconfig and it expires in 60 minutes. kubectl transparently refreshes it if its near expiration. For ADSC: Currently it uses the jwt token and exchanges it for a certificate, which it then sends. This is because we used to only support cert auth. Now XDS can read jwt directly, so you can just pass the jwt as part of the gRPC request. In grpcurl this is like |
@howardjohn It isn't working for me.
Istiod logs |
@esnible it works for me, are you sure you are using the latest code? it was merged a couple days ago |
For 1.8, it has been suggested we use JWT tokens.
Probably we need a way to keep multiple tokens around for users with >1 mesh. I propose we use |
Istioctl 1.8.x will still use --cert-dir but we will not work on improving the Makefile cert mining.
Instead, we will allow Istioctl to request and check JWT tokens from Kubernetes.
The tokens will be cached on the user's file system.
The text was updated successfully, but these errors were encountered: