[ZBXNEXT-5839] Add SNI support to TLS protocol between Agent, Proxy and Server Created: 2020 Mar 23 Updated: 2024 Apr 10 Resolved: 2022 Mar 25 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Agent (G) |
Affects Version/s: | 4.4.7 |
Fix Version/s: | 6.0.1rc1, 6.2.0alpha1, 6.2 (plan) |
Type: | New Feature Request | Priority: | Medium |
Reporter: | Adrien GRUNEISEN | Assignee: | Jurijs Klopovskis |
Resolution: | Fixed | Votes: | 5 |
Labels: | SNI, TLS | ||
Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
Environment: |
TLS based Encryption with SNI |
Attachments: |
![]() |
||||||||||
Issue Links: |
|
||||||||||
Sub-Tasks: |
|
||||||||||
Team: | |||||||||||
Sprint: | Sprint 84 (Jan 2022), Sprint 85 (Feb 2022), Sprint 86 (Mar 2022) | ||||||||||
Story Points: | 1 |
Description |
I'm currently testing the zabbix-server & zabbix-proxy docker images (https://github.com/zabbix/zabbix-docker) on top of a kubernetes cluster. I'm using traefik (https://docs.traefik.io/routing/providers/kubernetes-crd/) as kubernetes ingress controller to manage the incoming connections from the external zabbix agents (deployed on the servers i'm monitoring / all configured in active mode) and the zabbix proxies running inside the kubernetes cluster (TLS activated between agents and proxies) I've two solutions at traefik level to allow those incoming communications between the agents and the proxies: 1/ 1st solution --> not my prefered one but it is working:
This is working but not convenient at all ... each time a new proxy has to be deployed inside the cluster, a new entrypoint/port has to be opened at traefik level
2/ 2nd solution --> my prefered one but currently not working
This would be so great ... only one entrypoint/port at traefik level and the routing to the different proxies in kubernetes will be managed using SNI (servername) zabbix-agent looks currently not SNI compliant. I did those two basic tests to demonstrate this: From one monitored server: 1/ openssl s_client -connect myproxyX.mydomain.corp:10051 -cert mytls.crt -key mytls.key -CAfile myca.crt --> KO, connection blocked at traefik level ... SNI missing in the request to route the traffic to the correct proxy (myproxyX in this example) 2/ openssl s_client -servername myproxyX.mydomain.corp -connect myproxyX.mydomain.corp:10051 -cert mytls.crt -key mytls.key -CAfile myca.crt --> OK, connection sent to the correct proxy using the SNI in the request.
So questions :
|
Comments |
Comment by Adrien GRUNEISEN [ 2020 Mar 31 ] |
Hi Zabbix support team, I hope my ticket was clear enough to let you understand this feature request? Don't hesitate to sollicitate me if you need additional information, extract of configuration files or whatever... i will be very happy to answer. This topic is not urgent at all, i can live with solution 1/ for a while ... Regards, Adrien |
Comment by Cyril Onfroy [ 2020 Apr 16 ] |
Hi All,
I have the exact same need (not sure wich Ingress Controller to use yet, probably using Envoy instead of Traefik). I wonder if it is possible to do this by playing with certificates. |
Comment by Adrien GRUNEISEN [ 2020 Apr 23 ] |
Hi, In my setup, TLS is already activated between the agents (on the servers) and the proxies (hosted on k8s) TLS configuration at Traefik IngressRouteTCP level is set to "passtrough: true" (no certificate at Traefik level) Please find below an example of Traefik IngressRouteTCP configuration:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: proxy-2s59
namespace: zabbix-2s59
spec:
entryPoints:
- px-2s59
routes:
# - match: HostSNI(`proxy-2s59.{{project_wildcard_dns}}`)
- match: HostSNI(`*`)
services:
- name: proxy-2s59
port: 10051
tls:
passthrough: true
Currently, as the zabbix agent is not providing any SNI, traefik is not able to determine to which service the traffic should be forwarded. SNI (Server Name Indication) is an extension of TLS (https://en.wikipedia.org/wiki/Server_Name_Indication). The client (in our case: the zabbix agent / configured in active) should indicates to which hostname it is attempting to connect at the start of the handshaking process. If zabbix agent would be able to specify an SNI, we would be able to replace HostSNI(`*`) with the multiple entrypoints per proxy by HostSNI(`myproxyX.mydomain.myorg`) with only one single entrypoint at traefik level.
|
Comment by Adrien GRUNEISEN [ 2020 Jun 11 ] |
Hi Zabbix support team, Do you need additional information? Thank you |
Comment by Adrien GRUNEISEN [ 2020 Sep 07 ] |
Up Don't hesitate to sollicate me if needed. |
Comment by Michael Veksler [ 2020 Sep 07 ] |
What reason of using so difficult configuration ? |
Comment by Adrien GRUNEISEN [ 2020 Sep 07 ] |
Zabbix is providing docker images of their components (console, server, proxy, agent) ... deploying them on top of a container orchestrator like kubernetes is just awesome in term of flexibility, HA, capacity, upgrades, downgrades, etc etc... Accessing an application hosted on kubernetes though treafik using HostSNI is something very common ... nothing difficult here. Please find attached my infrastruture diagram (2s59-acp-tooling.pdf) ... I'm using Zabbix hosted on Kubernetes for the monitoring of several Openshift clusters If needed, we could do a google meet together to better explain the setup and answer your questions ...? |
Comment by dimir [ 2020 Sep 07 ] |
dotneft promised to take a look at this one. |
Comment by Adrien GRUNEISEN [ 2020 Sep 07 ] |
Great, thank you |
Comment by Alexey Pustovalov [ 2020 Sep 08 ] |
Hello Adrien, I'm thinking it is not image issue. Zabbix agent and other components do not support SNI. Actually images do not have any additional modifications and just expose specified ports. Did you test regular agent / proxy? Same behaviour? Kind regards, |
Comment by Adrien GRUNEISEN [ 2020 Sep 08 ] |
Hi Alexey, Yes, you are fully right, this is not an image issue. This is a new feature request for a better zabbix integration when deployed on kubernetes (this feature is not needed when installing zabbix on traditional servers from packages ... so no issue with regular agent/proxy). Deploying zabbix on k8s is certainly not yet very common (but it will become I have a doubt and I have the filling that my request is not fully understood (certainly because you are not very familiar with kubernetes and reverse proxy usage like traefik ... that i can fully understand ... no issue) Should i explain a bit more ?
|
Comment by Edgar Akhmetshin [ 2020 Sep 08 ] |
Looks like this feature should be added to TLS support between Server, Proxy, Agent components, so systems like k8s can route traffic using SNI extension. This issue is not about Docker container itself. TLS SNI (rfc4366 |
Comment by Adrien GRUNEISEN [ 2020 Sep 09 ] |
@Edgar: exactly |
Comment by Adrien GRUNEISEN [ 2020 Sep 28 ] |
Hello Will you finally add SNI capability to TLS support between Server, Proxy, Agent components ? Or should I consider my workaround (dedicated entrypoint/port at traefik level using HostSNI(`*`)) as a definitive solution This topic is not urgent for me ... but I just want to know if this new feature request is validated or not ? Thank you |
Comment by Adrien GRUNEISEN [ 2021 Jan 07 ] |
Hi UP Thank you |
Comment by Daniel Buschke [ 2022 Jan 06 ] |
+1 using SNI would make container setups (and all other setups using proxies in front of zabbix server) much easier edit: and it's not only for compontent agents but also proxy |
Comment by Adrien GRUNEISEN [ 2022 Jan 10 ] |
I'm very happy to see that the status of the ticket has evolved ... I was still waiting for this new feature Don't hesitate to solicitate me if I can support.
|
Comment by Jurijs Klopovskis [ 2022 Feb 17 ] |
Available in:
This is for Zabbix components written in C. Changes for agent2 are implemented separately: Documentation updated: |
Comment by Adrien GRUNEISEN [ 2022 Mar 24 ] |
FYI, I've just tested TLS SNI feature on Zabbix 6.0.2 and it is working like a charm I'm now able to declare one single entrypoint at Traefik level for all incoming connection from agents (one entrypoint "zabbix-proxy" using the default port 10051) and use "HostSNI" at Traefik IngressRouteTCP definition to route the incoming connection from agents to the corresponding proxy. For example:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: proxy-2s59-val
namespace: zabbix-2s59-val
spec:
entryPoints:
- zabbix-proxy
routes:
- match: HostSNI(`proxy-2s59-val.2s59-v.eu.airbus.corp`)
services:
- name: proxy-2s59-val
port: 10051
tls:
passthrough: true
|
Comment by Alexei Vladishev [ 2022 Apr 08 ] |
adrien.gruneisen , thanks for your feedback! Right, we have back-ported it to 6.0.x to make it available in LTS release. No need to wait Zabbix 6.2, use it now! |