istio - 在 Istio 中为“set_current_client_cert_details”配置 EnvoyFilter
问题描述
我有一个场景,我在 Istio Ingress Gateway 处终止 TLS 流量并将其转发到相应的服务。还设置了 mTls 和 ISTIO_MUTUAL。我需要验证在集群中调用我们的 Ingress-Gateway 时发送的客户端证书,并且我计划在需要将整个证书转发到我的服务代码的代码中进行验证。
我尝试如下配置 EnvoyFilter:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: xfcc-forward
namespace: xfcc
spec:
workloadSelector:
labels:
istio: ingressgateway
configPatches:
- applyTo: HTTP_FILTER
match:
context: GATEWAY
listener:
filterChain:
sni: "*"
patch:
operation: MERGE
value:
set_current_client_cert_details:
cert: true
申请时失败,我想可能是因为我没有正确配置它。有人可以帮助我为我的场景正确配置 EF。
解决方案
我想我得到了使用这个的配置:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: xfcc-forward
namespace: xfcc
spec:
configPatches:
- applyTo: NETWORK_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: "envoy.http_connection_manager"
patch:
operation: MERGE
value:
typed_config:
"@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager"
forward_client_cert_details: ALWAYS_FORWARD_ONLY
set_current_client_cert_details:
subject: true
cert: true
chain: true
我可以看到带有证书值的 XFCC 标头,但证书是 Citadel 为 mTls 传递的证书,而不是客户端在标头中发送的证书,我仍在查看。
推荐阅读
- python - 如何将 postgres 日期时间列更改为默认为 datetime.utcnow
- python - 设置图像在主窗口中的位置,QPixmap
- sass - SCSS 检查 CSS 自定义 var 属性
- reactjs - 在标题属性中连接 React 中的多重道具
- javascript - 如何在不重新创建 React 中的整个列表的情况下更新项目
- node.js - 如何使用 https.request 执行获取请求?
- typescript - 如何合并两个接口类型与合并的重叠属性类型?
- java - Java switch case 中断方法
- javascript - 在 Eclipse JEE 中启用 javascript 内容辅助
- symfony - 为什么 codecoverage 要我覆盖定义变量?