MTLS(客户端)每kubernetes traefik Ingress路线

发布于 2025-02-11 17:53:15 字数 903 浏览 2 评论 0原文

我有多个使用Traefik 2.6工作入口路线的服务,

所有入口路由使用注释都按预期工作,并且在使用args应用args的配置时,我没有出现错误的错误,请在pod本身中签到pod,traefik正在运行,traefik正在运行有了正确的参数,并且dynamic.conf文件和cert.pem已正确安装。

#dynamic.yml
tls:
  options:
    default:
      clientAuth:
        caFiles:
          - /opt/traefik/cert.pem
        clientAuthType: RequireAndVerifyClientCert

上面的配置将TLS选项应用于所有入口路由。

在为服务应用以下入学注释时,客户端不会提示证书:

将配置更改为以下内容:

#dynamic.yml
tls:
  options:
    mtls:
      clientAuth:
        caFiles:
          - /opt/traefik/cert.pem
        clientAuthType: RequireAndVerifyClientCert
...
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
    traefik.ingress.kubernetes.io/tls.options: mtls
...

Ingress路由功能功能,但是,客户端可以在没有TLS的特定入口路由上查看网站而没有证书身份验证。选项“ mtls”。

I have multiple services with working ingress routes using traefik 2.6

All ingress routes work as expected using annotations and I get no errors showing when applying the configuration with args regarding file provider to "dynamic.yml" After checking in the pod itself, traefik is running with the correct arguments and that the dynamic.conf file and cert.pem are mounted correctly.

#dynamic.yml
tls:
  options:
    default:
      clientAuth:
        caFiles:
          - /opt/traefik/cert.pem
        clientAuthType: RequireAndVerifyClientCert

The configurations above applies the tls options to all ingress routes.

When applying the following ingress annotations for the service, clients do not get prompted for certs:

Changing the configuration to the following:

#dynamic.yml
tls:
  options:
    mtls:
      clientAuth:
        caFiles:
          - /opt/traefik/cert.pem
        clientAuthType: RequireAndVerifyClientCert
...
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
    traefik.ingress.kubernetes.io/tls.options: mtls
...

The ingress routes function, however, clients are able to view the site without certificate authentication on the specific ingress route with tls.option "mtls".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

翻了热茶 2025-02-18 17:53:15

Found the answer here:
https://doc.traefik.io/traefik/routing/providers/kubernetes-ingress/#annotations

traefik.ingress.kubernetes.io/router.tls.options: foobar@file
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文