Zabbix supports encrypted communications between Zabbix server, Zabbix proxy, Zabbix agent, zabbix_sender and zabbix_get utilities using Transport Layer Security (TLS) protocol v.1.2. Encryption is supported starting with Zabbix 3.0. Certificate-based and pre-shared key-based encryption is supported.
Encryption is optional and configurable for individual components (e.g. some proxies and agents can be configured to use certificate-based encryption with the server, while others can use pre-shared key-based encryption, and yet others continue with unencrypted communications as before).
Server (proxy) can use different encryption configurations for different hosts.
Zabbix daemon programs use one listening port for encrypted and unencrypted incoming connections. Adding an encryption does not require opening new ports on firewalls.
To support encryption Zabbix must be compiled and linked with one of four crypto libraries:
tls_*()LibreSSL-specific API functions are not used. Zabbix components compiled with LibreSSL will not be able to use PSK, only certificates can be used.
The library is selected by specifying an option to “configure” script:
--with-openssl[=DIR](also used for LibreSSL)
For example, to configure the sources for server and agent with OpenSSL you may use something like:
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-openssl
Different Zabbix components may be compiled with different crypto libraries (e.g. a server with OpenSSL, an agent with GnuTLS).
Connections in Zabbix can use:
There are two important parameters used to specify encryption for connections between Zabbix components:
TLSConnect specifies what encryption to use for outgoing connections and can take one of 3 values (
TLSConnect is used in configuration files for Zabbix proxy (in active mode, specifies only connections to server) and Zabbix agentd (for active checks). In Zabbix frontend the
TLSConnect equivalent is Connections to host field in Configuration→Hosts→<some host>→Encryption tab and Connections to proxy field in Administration→Proxies→<some proxy>→Encryption tab.
If the configured encryption type for connection fails, no other encryption types will be tried.
TLSAccept specifies what types of connections are allowed for incoming connections. Connection types are:
certificate. One or more values can be specified.
TLSAccept is used in configuration files for Zabbix proxy (in passive mode, specifies only connections from server) and Zabbix agentd (for passive checks). In Zabbix frontend the
TLSAccept equivalent is Connections from host field in Configuration→Hosts→<some host>→Encryption tab and Connections from proxy field in Administration→Proxies→<some proxy>→Encryption tab.
Normally you configure only one type of encryption for incoming encryptions. But you may want to switch encryption type, e.g. from unencrypted to certificate-based with minimum downtime and rollback possibility.
To achieve this you can set
TLSAccept=unencrypted,cert in agentd configuration file and restart Zabbix agent.
Then you can test connection with
zabbix_get to the agent using certificate. If it works, you can reconfigure encryption for that agent in Zabbix frontend in Configuration→Hosts→<some host>→Encryption tab by setting Connections to host to “Certificate”.
When server configuration cache gets updated (and proxy configuration is updated if the host is monitoring by proxy) then connections to that agent will be encrypted.
If everything works as expected you can set
TLSAccept=cert in agent configuration file and restart Zabbix agent.
Now the agent will be accepting only encrypted certificate-based connections. Unencrypted and PSK-based connections will be rejected.
In a similar way it works on server and proxy. If in Zabbix frontend in host configuration Connections from host is set to “Certificate” then only certificate-based encrypted connections will be accepted from agent (active checks) and
zabbix_sender (trapper items).
Most likely you will configure incoming and outgoing connections to use the same encryption type or no encryption at all. But technically it is possible to configure it asymmetrically, e.g. certificate-based encryption for incoming and PSK-based for outgoing connections.
For overview, encryption configuration for each host is displayed in Zabbix frontend Configuration→Hosts on the right side, in column AGENT ENCRYPTION. Configuration display examples:
|Example||Connections TO host||Allowed connections FROM host||Rejected connections FROM host|
|Unencrypted||Unencrypted||Encrypted certificate and PSK-based|
|Encrypted, certificate-based||Encrypted certificate-based||Unencrypted and PSK-based|
|Encrypted, PSK-based||Encrypted PSK-based||Unencrypted and certificate-based|
|Encrypted, PSK-based||Unencrypted and PSK-based encrypted||Certificate-based|
|Encrypted, certificate-based||Unencrypted, PSK or certificate-based encrypted||-|
Ciphersuites are configured internally during Zabbix startup and depend on crypto library, currently they are not user-configurable.
Configured ciphersuites by library type in order from higher to lower priority:
|Library||Certificate ciphersuites||PSK ciphersuites|
|mbed TLS (PolarSSL) 1.3.9||TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256|
Cipher suites using certificates:
|TLS client||mbed TLS (PolarSSL)||GnuTLS||OpenSSL 1.0.2|
|mbed TLS (PolarSSL)||TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256||TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256||TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256|
Cipher suites using PSK:
|TLS client||mbed TLS (PolarSSL)||GnuTLS||OpenSSL 1.0.2|
|mbed TLS (PolarSSL)||TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256||TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256||TLS-PSK-WITH-AES-128-CBC-SHA|