Below you will find pages that utilize the taxonomy term “RequestAuthentication”
Posts
Istio 实战:认证--RequestAuthentication
根据官方文档:认证 章节的描述,Istio 提供两种认证机制(PeerAuthentication,RequestAuthentication),PeerAuthentication 解决工作负载间的问题,RequestAuthentication 解决用户端的问题。本文关注用 RequestAuthentication 来保护“裸”应用。以下是需要先从官网了解的相关知识:
认证 Request authentication 环境 istio 1.5.2
RequestAuthentication 先看看 manifest 长什么样子,下面是官网的一个样例,主要由两个字段构成 selector,jwtRules。
apiVersion: "security.istio.io/v1beta1" kind: "RequestAuthentication" metadata: name: "jwt-example" namespace: istio-system spec: selector: matchLabels: istio: ingressgateway jwtRules: - issuer: "testing@secure.istio.io" jwksUri: "https://raw.githubusercontent.com/istio/istio/master/security/tools/jwt/samples/jwks.json" Reference: Request authentication 描述了manifest 的完整定义。 Reference: JWTRule 描述了 jwtRules 的定义。 Selector selector 通过 label 机制选择适用该策略的目标工作负载。
您可以将JWT策略添加到入口网关(上面的样例就是)。 这通常用于为绑定到网关的所有服务而不是单个服务定义JWT策略。下面是官方文档的原文
You can also add a JWT policy to an ingress gateway (e.g., service istio-ingressgateway.istio-system.svc.cluster.local). This is often used to define a JWT policy for all services bound to the gateway, instead of for individual services.