我的用例如下:我希望在172.28.0.3:389中拦截对LDAP的调用,并使用TLS转发到172.28.0.3:636。
我遵循了egress tls originate的步骤,它工作得很好。现在我正在尝试使用网关,不幸的是,我在设置端口时遇到了问题。我基本上已经复制并粘贴了documentation的设置,并将协议从HTTP和HTTPS修改为TCP,将端口80和443分别修改为389和636:
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: cnn
spec:
hosts:
- ldap.host
addresses:
- 172.28.0.3
ports:
- number: 389
name: tcp
protocol: TCP
- number: 636
name: tcp-secure
protocol: TCP
resolution: STATIC
endpoints:
- address: 172.28.0.3
------
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: istio-egressgateway
spec:
selector:
istio: egressgateway
servers:
- port:
number: 389 # I am not sure about this
name: tpc-port-for-tls-origination
protocol: tcp
hosts:
- ldap.host
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: egressgateway-for-cnn
spec:
host: istio-egressgateway.istio-system.svc.cluster.local
subsets:
- name: cnn
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: direct-cnn-through-egress-gateway
spec:
hosts:
- ldap.host
gateways:
- istio-egressgateway
- mesh
tcp: # I AM NOT SURE ABOUT THIS PART
- match:
- gateways:
- mesh
port: 389
route:
- destination:
host: istio-egressgateway.istio-system.svc.cluster.local
subset: cnn
port:
number: 389
weight: 100
- match:
- gateways:
- istio-egressgateway
port: 389
route:
- destination:
host: ldap.host
port:
number: 636
weight: 100
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: originate-tls-for-edition-cnn-com
spec:
host: ldap.host
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
portLevelSettings:
- port:
number: 636
tls:
mode: SIMPLE # initiates HTTPS for connections to edition.cnn.com我感觉问题出在VirtualService上,然而我已经尝试了很多方法,但都没有成功,任何可能是问题的提示都将不胜感激。
发布于 2021-05-17 17:48:48
看看这篇文章和上一篇文章:看起来你对支持custom authentication集成的外部LDAP提供者很感兴趣。例如,您可以使用keycloak、Auth0、Google Auth。
本文档显示了一个外部身份验证,它可以是integrated with istio身份验证。请注意,文档可能已过期(2018年2月2日)。
在这里你可以找到similar problem
据我所知,
不能在istio中工作。这里的变通方法是keycloak或LDAP你可以用istio集成它们,但它只是为了认证,它不会像auth0本身那样工作,至少据我所知是这样。
您还可以使用JSON Web Token (JWT)验证进行身份验证。Istio负责验证传入用户请求中的JWT令牌的任务。因此,如果您实现了Istio JWT身份验证特性,那么您的应用程序代码就不需要关心JWT令牌验证了。Istio会帮你做到这一点。不是JWT令牌生成。Istio不会为您生成令牌。您必须有一个生成令牌的身份验证微服务。Here是关于如何使用JWT对终端用户进行身份验证的。
https://stackoverflow.com/questions/67538247
复制相似问题