您能帮我理解 RequestAuthentication 吗?
当我应用简单的 RequestAuthentication 并重新启动 Pod 时,envoy sidecar 的就绪状态为 false,并且日志抛出warn Envoy proxy is NOT ready: config not received from Pilot (is Pilot running?): cds updates: 1 successful, 0 rejected; lds updates: 0 successful, 1 rejected
一旦我删除 RequestAuthentication 并重新创建 pod - 工作正常
伊斯蒂奥 1.8.3
apiVersion: 'security.istio.io/v1beta1'
kind: RequestAuthentication
metadata:
name: jwt-validator
spec:
selector:
matchLabels:
role: api
jwtRules:
- issuer: "https://mykeycloak.com/auth/realms/myrealm"
当代理处于 LDS 陈旧状态时
istiod 中显示以下日志
2021-04-10T17:30:53.326877Z warn ads ADS:LDS: ACK ERROR sidecar~10.238.2.69~PODNAME.NS~NS.svc.cluster.local-60 Internal:Error adding/updating listener(s) vi ││ rtualInbound: Issuer 'MY_JWT_ISSUER_URL' in jwt_authn config has invalid local jwks: Jwks RSA [n] or [e] field is missing or has a parse error
Resolved
这里的颁发者不仅仅是 JWT 中匹配的字符串,而是必须可以从 istiod 访问的真实 URL,并且具有有效的 SSL 证书
我放置这个答案是为了更好的可见性。
正如 @Yegor Lopatin 在编辑中提到的,该问题是通过修复发行人解决的:
这里的颁发者不仅仅是 JWT 中匹配的字符串,而是必须可以从 istiod 访问的真实 URL,并且具有有效的 SSL 证书
发行者必须是有效且可访问的链接。我以为这只是一个字符串,你在阅读 JWT 时与它进行比较
e.g.
jwtRules:
- issuer: "[email protected] /cdn-cgi/l/email-protection"
jwksUri: "https://raw.githubusercontent.com/istio/istio/release-1.5/security/tools/jwt/samples/jwks.json"
当您使用 istio 设置 JWT 时,您可以参考以下教程:
- https://www.istiobyexample.dev/jwt https://www.istiobyexample.dev/jwt
- https://istio.io/latest/docs/tasks/security/authorization/authz-jwt/ https://istio.io/latest/docs/tasks/security/authorization/authz-jwt/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)