Zabbix如何实现Server和Agent的通信加密

简介:

一、加密介绍

1、总览

    Zabbix版本从3.0之后,开始支持Zabbix server, Zabbix proxy, Zabbix agent, zabbix_sender and zabbix_get之间的通信加密,加密方式有预共享密钥(PSK)和证书加密。

    加密配置是可选项,一些proxies和agents可以使用证书认证加密通信,另外一些可以使用PSK加密通信,而剩余的可以不使用加密进行通信。

    关于porxy的配置设备,我这里就不在介绍了,大家可以去看官方文档。

    但是并不是所有的通信都进行了加密,下面的几点就是没有覆盖到。

  • Private keys are stored in plain text in files readable by Zabbix components during startup.

  • Pre-shared keys are entered in Zabbix frontend and stored in Zabbix database in plain text.

  • Built-in encryption does not protect communications:

    • between web server running Zabbix frontend and user web browser,

    • between Zabbix frontend and Zabbix server,

    • between Zabbix server (proxy) and Zabbix database.

  • Currently each encrypted connection opens with a full TLS handshake, no session caching and tickets are implemented.

  • Adding encryption increases time of checks and actions, depending on network latency.
    For example, if packet delay is 100ms then opening a TCP connection and sending unencrypted request takes around 200ms.
    With encryption about 1000 ms are added for establishing TLS connection.
    Timeouts may need to be increased, otherwise some items and actions running remote scripts on agents may work with unencrypted connections but fail with timeout with encrypted.

  • Encryption is not supported by network discovery. Zabbix agent checks performed by network discovery will be unencrypted and if Zabbix agent is configured to reject unencrypted connections such checks will not succeed.

2、编译支持加密功能

    要想支持加密功能,我们必须在编译安装的时候把加密库编译进Zabbix里面。

    编译的时候加上 --with-openssl

1
2
3
4
5
6
7
8
9
. /configure  \
--prefix= /usr/local/zabbix  \
--sysconfdir= /etc/zabbix  \
-- enable -server \
-- enable -agent \
--with-mysql \
--with-net-snmp \
--with-libcurl \
--with-openssl

二、使用预共享密钥(PSK)

1、生成psk

1
2
# openssl rand -hex 32
af8ced32dfe8714e548694e2d29e1a14ba6fa13f216cb35c19d0feb1084b0429

2、配置agent

    创建一个文件/etc/zabbix/zabbix_agentd.conf.d/zabbix_agentd.psk,存入刚刚生成的psk。

    编辑/etc/zabbix/zabbix_agentd.conf,添加如下内容。

1
2
3
4
TLSConnect=psk
TLSAccept=psk
TLSPSKFile= /etc/zabbix/zabbix_agentd .conf.d /zabbix_agentd .psk
TLSPSKIdentity=PSK 001

    然后重启agent,在server上面测试看看加密连接。

1
zabbix_get -s 127.0.0.1 -k  "system.cpu.load[all,avg1]"  --tls-connect=psk --tls-psk-identity= "PSK 001"  --tls-psk- file = /etc/zabbix/zabbix_agentd .conf.d /zabbix_agentd .psk

    测试下来没有什么问题,那我们就配置WEB页面。

wKioL1lV8W-g-I_WAABTQ7x2uKs835.jpg

    等待一段时间,就生效了哦。

wKiom1lV8pfDZ86ZAABiuIaGWbo751.jpg


三、使用证书通信加密

待完成……







     本文转自 wzlinux 51CTO博客,原文链接:http://blog.51cto.com/wzlinux/1943419,如需转载请自行联系原作者


相关文章
|
4月前
|
监控 Unix Windows
Zabbix【部署 04】 Windows系统安装配置agent及agent2
Zabbix【部署 04】 Windows系统安装配置agent及agent2
147 0
|
6月前
|
小程序 安全 网络安全
申请免费 SSL 证书为您的小程序加密通信
申请免费 SSL 证书为您的小程序加密通信
137 0
|
7月前
|
监控 安全 Shell
Zabbix Server trapper 命令注入漏洞 (CVE-2017-2824)
Zabbix Server trapper 命令注入漏洞,攻击者可通过特定Payload获取服务器执行权限。
107 1
|
3月前
|
JSON 安全 Go
加密通信秘籍:网络安全不容忽视
加密通信秘籍:网络安全不容忽视
27 0
|
3月前
|
算法 安全 网络安全
HTTPS加密原理解析:保障通信安全的密码学算法
HTTPS加密原理解析:保障通信安全的密码学算法
54 0
|
8月前
|
存储 数据采集 缓存
【运维知识进阶篇】Zabbix5.0稳定版详解9(Zabbix优化:高并发对MySQL进行拆分、Zabbix-agent主动上报模式、使用proxy代理模式、系统自带监控项优化、进程优化、缓存优化)
【运维知识进阶篇】Zabbix5.0稳定版详解9(Zabbix优化:高并发对MySQL进行拆分、Zabbix-agent主动上报模式、使用proxy代理模式、系统自带监控项优化、进程优化、缓存优化)
227 0
|
4月前
|
监控 Java 数据库
Zabbix【部署 05】 Docker部署Zabbix Server Agent Agent2 Web interface及 Java-Gate-Way(详细启动脚本及踩坑记录)不定时更新
Zabbix【部署 05】 Docker部署Zabbix Server Agent Agent2 Web interface及 Java-Gate-Way(详细启动脚本及踩坑记录)不定时更新
129 0
|
4月前
|
监控 Docker 容器
Zabbix【部署 03】zabbix-agent2安装配置使用(zabbix-agent2监控docker实例分享)
Zabbix【部署 03】zabbix-agent2安装配置使用(zabbix-agent2监控docker实例分享)
237 0
|
4月前
|
监控 数据库连接 数据安全/隐私保护
安装Zabbix Server
安装Zabbix Server
54 1
|
5月前
|
安全 数据安全/隐私保护
使用openssl 模拟ca进行证书的申请和颁发,并使用证书部署网站的安全连接访问,即https的加密通信
使用openssl 模拟ca进行证书的申请和颁发,并使用证书部署网站的安全连接访问,即https的加密通信
46 0

推荐镜像

更多