istio: End user JWT authentication is not working in istio-1.0 release build
Setting up end user JWT auth following the Istio 1.0 docs always results in Envoy returning 503 Service Unavailable
I’m aware of the documentation bug and created the Gateway and VirtualService resource to setup ingress routing. After exposing “httpbin” service I am able to reach it via ingressgateway without any token as expected:
curl $INGRESS_HOST/headers -s -o /dev/null -w "%{http_code}\n"
200
Creating the authentication policy with the SVC_ACCOUNT & JWKS set like this:
apiVersion: "authentication.istio.io/v1alpha1"
kind: "Policy"
metadata:
name: "example-3"
spec:
targets:
- name: httpbin
peers:
- mtls:
origins:
- jwt:
issuer: $SVC_ACCOUNT
jwksUri: $JWKS
principalBinding: USE_ORIGIN
EOF
always returns 503
even after adding the bearer token:
curl --header "Authorization: Bearer $TOKEN" $INGRESS_HOST/headers -s -o /dev/null -w "%{http_code}\n"
503
If I update the policy spec and remove the peers mtls
section like this:
apiVersion: "authentication.istio.io/v1alpha1"
kind: "Policy"
metadata:
name: "example-3"
spec:
targets:
- name: httpbin
origins:
- jwt:
issuer: $SVC_ACCOUNT
jwksUri: $JWKS
principalBinding: USE_ORIGIN
EOF
I always get 401
unauthorized even with a valid token:
curl --header "Authorization: Bearer $TOKEN" $INGRESS_HOST/headers -s -o /dev/null -w "%{http_code}\n"
401
Kubernetes version: “1.9.6”
Istio version: https://gcsweb.istio.io/gcs/istio-prerelease/daily-build/release-1.0-20180720-09-15/
Output of istioctl version
:
Version: release-1.0-20180720-09-15
GitRevision: 86dc1496ef02591ce2f6b2490b161841733e1ffc
mTLS is globally turned off as mentioned in the task docs
Might be related to the issue: https://github.com/istio/istio/issues/6668
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (12 by maintainers)
I am using the 1.0.0 release from dockerhub, and am having the same issue. There is somehow no mention of jwt in the envoy config dump. Is there a way to debug this at all? I have a very basic Policy set
Whats even weirder is that if I set a Policy on the ingress-gateway the filter are correctly set and everything asks for auth:
This error means pilot cannot fetch the public key set from the given JwksUri. If you use https, your server certificate must be signed by a CA that is verifiable. We use CA bundle that come with standard linux distro, so it should work all common PKI. In other words, self-signing certificate will not work.
Hope this helps.
Thanks.
Diem
On Wed, Sep 12, 2018 at 5:36 AM Farasath Ahamed notifications@github.com wrote:
–
Diem Vu | Software Engineer | diemvu@google.com | +1 408-215-8127