简体   繁体   English

Kubernetes/Ingress/TLS - 使用 URL 中的 IP 地址阻止访问

[英]Kubernetes/Ingress/TLS - block access with IP Address in URL

A pod is accessible via nginx-ingress and https://FQDN.可以通过 nginx-ingress 和 https://FQDN 访问 pod。 That works well with the configured public certificates.这适用于配置的公共证书。 But if someone uses https://IP_ADDRESS - he will get a certificate error because of the default "Kubernetes Fake Certificate".但是如果有人使用 https://IP_ADDRESS - 他会因为默认的“Kubernetes Fake Certificate”而收到证书错误。 Is it possible to block access completely using the IP_ADDRESS url?是否可以使用 IP_ADDRESS url 完全阻止访问?

I think you would first need the TLS handshake to complete, before Nginx could deny the access.我认为您首先需要完成 TLS 握手,然后 Nginx 才能拒绝访问。

On the other hand, HAproxy may be able to close the connection while checking the ServerName.另一方面,HAproxy 可能能够在检查 ServerName 时关闭连接。 Say setting some ACL in your https frontend, routing applications to their backends.假设在您的 https 前端设置一些 ACL,将应用程序路由到它们的后端。 Though I'm not sure this would be doable unless mounting a custom HAproxy configuration template into your ingress controller.虽然我不确定这是否可行,除非将自定义 HAproxy 配置模板安装到您的入口 controller 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM