net-mgmt/zabbix-agent: Add PSK encryption (#1618)

This commit is contained in:
Michael
2019-12-16 22:07:20 +01:00
committed by Frank Wall
parent a2d302c5d5
commit 3afc374afb
6 changed files with 54 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PLUGIN_NAME= zabbix-agent
PLUGIN_VERSION= 1.6
PLUGIN_VERSION= 1.7
PLUGIN_COMMENT= Zabbix monitoring agent
PLUGIN_DEPENDS= zabbix4-agent
PLUGIN_MAINTAINER= opnsense@moov.de
@@ -132,5 +132,26 @@
<type>checkbox</type>
<help><![CDATA[Enable logging of executed shell commands as warnings. Make sure to set the Debug Level accordingly.]]></help>
</field>
<field>
<id>zabbixagent.settings.features.encryption</id>
<label>PSK based encryption</label>
<type>checkbox</type>
<help>Enable PSK based encryption for communicating with the Zabbix server</help>
<advanced>true</advanced>
</field>
<field>
<id>zabbixagent.settings.features.encryptionidentity</id>
<label>PSK Identity</label>
<type>text</type>
<help>>The PSK identity configured must match on agent and server</help>
<advanced>true</advanced>
</field>
<field>
<id>zabbixagent.settings.features.encryptionpsk</id>
<label>PSK</label>
<type>text</type>
<help>The PSK configured on the Zabbix server</help>
<advanced>true</advanced>
</field>
</tab>
</form>
@@ -1,6 +1,6 @@
<model>
<mount>//OPNsense/ZabbixAgent</mount>
<version>1.2.2</version>
<version>1.2.3</version>
<description>Zabbix monitoring agent</description>
<items>
<!-- local settings that should NOT be synced to another node -->
@@ -132,6 +132,20 @@
<default>0</default>
<Required>Y</Required>
</logRemoteCommands>
<encryption type="BooleanField">
<default>0</default>
<Required>Y</Required>
</encryption>
<encryptionidentity type="TextField">
<default></default>
<Required>N</Required>
<mask>/^.{1,128}$/</mask>
<ValidationMessage>Should be a string between 1 and 128 characters.</ValidationMessage>
</encryptionidentity>
<encryptionpsk type="TextField">
<default></default>
<Required>N</Required>
</encryptionpsk>
</features>
</settings>
<userparameters>
@@ -1,3 +1,4 @@
zabbix_agentd.conf:/usr/local/etc/zabbix_agentd.conf
rc.conf.d:/etc/rc.conf.d/zabbix_agentd
sudo_rules:/usr/local/etc/sudoers.d/opnsense_zabbix_agent
zabbix_agent.psk:/usr/local/etc/zabbix_agent.psk
@@ -0,0 +1,5 @@
{% if helpers.exists('OPNsense.ZabbixAgent.settings.features.encryption') and OPNsense.ZabbixAgent.settings.features.encryption != '' %}
{% if helpers.exists('OPNsense.ZabbixAgent.settings.features.encryptionpsk') and OPNsense.ZabbixAgent.settings.features.encryptionpsk != '' %}
{{ OPNsense.ZabbixAgent.settings.features.encryptionpsk }}
{% endif %}
{% endif %}
@@ -38,6 +38,17 @@ BufferSend={{OPNsense.ZabbixAgent.settings.tuning.bufferSend}}
BufferSize={{OPNsense.ZabbixAgent.settings.tuning.bufferSize}}
MaxLinesPerSecond={{OPNsense.ZabbixAgent.settings.tuning.maxLinesPerSecond}}
{% if OPNsense.ZabbixAgent.settings.features.encryption == '1' %}
{% if OPNsense.ZabbixAgent.settings.features.encryptionidentity != '' %}
{% if OPNsense.ZabbixAgent.settings.features.encryptionpsk != '' %}
TLSAccept=psk
TLSConnect=psk
TLSPSKFile=/usr/local/etc/zabbix_agent.psk
TLSPSKIdentity={{ OPNsense.ZabbixAgent.settings.features.encryptionidentity }}
{% endif %}
{% endif %}
{% endif %}
############ ADVANCED PARAMETERS #################
{% if helpers.exists('OPNsense.ZabbixAgent.aliases') %}