gpt4 book ai didi

security - 如何在AWS EKS中使用istio Mesh启用自动mTLS?

转载 作者:行者123 更新时间:2023-12-02 11:41:58 36 4
gpt4 key购买 nike

我最近开始在AWS EKS集群中学习和实现istio。为了为入口网关配置TLS,我遵循了this guide,它只是要求您将AWS ACM ARN ID添加到istio-ingressgateway作为注释。因此,我既不必使用证书来创建secret,也不必使用envoyproxy的SDS。
此设置在网关处终止TLS,但我也想在网状网上启用mTLS以保护服务-服务通信。通过遵循their documentation,我创建了以下策略以在 namespace 内强制执行mTLS:

apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: xyz-mtls-policy
namespace: xyz-dev
spec:
mtls:
mode: STRICT
但是即使应用了此功能,我仍然看到一个服务能够使用 http调用另一个服务。
所以我的问题是:如何使用ACM证书在我的命名空间中实现mTLS?

最佳答案

如果从网格内部调用,我会说它工作正常,请查看herehere
Istio中的相互TLS

Istio offers mutual TLS as a solution for service-to-service authentication.

Istio uses the sidecar pattern, meaning that each application container has a sidecar Envoy proxy container running beside it in the same pod.

  • When a service receives or sends network traffic, the traffic alwaysgoes through the Envoy proxies first.

  • When mTLS is enabled between two services, the client side and server side Envoy proxies verify each other’s identities before sending requests.

  • If the verification is successful, then the client-side proxy encrypts the traffic, and sends it to the server-side proxy.

  • The server-side proxy decrypts the traffic and forwards it locally to the actual destination service.


enter image description here

I am on istio 1.6.8, think it enables mTLS by default.


是的,自istio 1.5版本开始默认启用。有与此相关的 docs

Automatic mutual TLS is now enabled by default. Traffic between sidecars is automatically configured as mutual TLS. You can disable this explicitly if you worry about the encryption overhead by adding the option -- set values.global.mtls.auto=false during install. For more details, refer to automatic mutual TLS.



Is there any clear process to prove that it is indeed using mTLS?


我会说有3种方法
  • 用 pod 测试

  • 您可以将其从严格更改为允许,并从网格外部调用它,它应该可以工作。然后将其更改为strict,然后再次调用它,将不起作用。无论哪种方式,您都应该能够从网格内部的Pod中调用它。
  • Kiali

  • 如果要以可视方式查看它,则启用mtls时kiali应当具有挂锁之类的内容,其中有 github issue
    enter image description here
    enter image description here
  • 普罗米修斯

  • 它已经在banzaicloud中提到,并且您在注释中提到,您可以检查“连接安全策略”度量标准标签。如果请求实际上已加密,则Istio将此标签设置为common_tls。

    让我知道是否还有其他问题。

    关于security - 如何在AWS EKS中使用istio Mesh启用自动mTLS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64107791/

    36 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com