From d776f4257415794e81262bfe0f041489a8c1cf3a Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Tue, 10 May 2022 19:37:02 +0300 Subject: [PATCH] Agent include directory restriction with *.conf files only --- Dockerfiles/agent/alpine/docker-entrypoint.sh | 2 +- Dockerfiles/agent/centos/docker-entrypoint.sh | 2 +- Dockerfiles/agent/ol/docker-entrypoint.sh | 2 +- Dockerfiles/agent/rhel/docker-entrypoint.sh | 2 +- Dockerfiles/agent/ubuntu/docker-entrypoint.sh | 2 +- Dockerfiles/agent/windows/docker-entrypoint.ps1 | 2 +- Dockerfiles/agent2/alpine/docker-entrypoint.sh | 2 +- Dockerfiles/agent2/centos/docker-entrypoint.sh | 2 +- Dockerfiles/agent2/ol/docker-entrypoint.sh | 2 +- Dockerfiles/agent2/rhel/docker-entrypoint.sh | 2 +- Dockerfiles/agent2/ubuntu/docker-entrypoint.sh | 2 +- Dockerfiles/agent2/windows/docker-entrypoint.ps1 | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfiles/agent/alpine/docker-entrypoint.sh b/Dockerfiles/agent/alpine/docker-entrypoint.sh index 242ffd44b..dd580b4f1 100755 --- a/Dockerfiles/agent/alpine/docker-entrypoint.sh +++ b/Dockerfiles/agent/alpine/docker-entrypoint.sh @@ -170,7 +170,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/" update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}" diff --git a/Dockerfiles/agent/centos/docker-entrypoint.sh b/Dockerfiles/agent/centos/docker-entrypoint.sh index 242ffd44b..dd580b4f1 100755 --- a/Dockerfiles/agent/centos/docker-entrypoint.sh +++ b/Dockerfiles/agent/centos/docker-entrypoint.sh @@ -170,7 +170,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/" update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}" diff --git a/Dockerfiles/agent/ol/docker-entrypoint.sh b/Dockerfiles/agent/ol/docker-entrypoint.sh index 242ffd44b..dd580b4f1 100755 --- a/Dockerfiles/agent/ol/docker-entrypoint.sh +++ b/Dockerfiles/agent/ol/docker-entrypoint.sh @@ -170,7 +170,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/" update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}" diff --git a/Dockerfiles/agent/rhel/docker-entrypoint.sh b/Dockerfiles/agent/rhel/docker-entrypoint.sh index 242ffd44b..dd580b4f1 100755 --- a/Dockerfiles/agent/rhel/docker-entrypoint.sh +++ b/Dockerfiles/agent/rhel/docker-entrypoint.sh @@ -170,7 +170,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/" update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}" diff --git a/Dockerfiles/agent/ubuntu/docker-entrypoint.sh b/Dockerfiles/agent/ubuntu/docker-entrypoint.sh index 242ffd44b..dd580b4f1 100755 --- a/Dockerfiles/agent/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/agent/ubuntu/docker-entrypoint.sh @@ -170,7 +170,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/" update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}" diff --git a/Dockerfiles/agent/windows/docker-entrypoint.ps1 b/Dockerfiles/agent/windows/docker-entrypoint.ps1 index 68c99f563..63e8a8e3d 100644 --- a/Dockerfiles/agent/windows/docker-entrypoint.ps1 +++ b/Dockerfiles/agent/windows/docker-entrypoint.ps1 @@ -182,7 +182,7 @@ function Prepare-Zbx-Agent-Config { # Please use include to enable Perfcounter feature # update_config_multiple_var $ZBX_AGENT_CONFIG "PerfCounter" $env:ZBX_PERFCOUNTER Update-Config-Var $ZbxAgentConfig "Timeout" "$env:ZBX_TIMEOUT" - Update-Config-Var $ZbxAgentConfig "Include" "$ZabbixConfigDir\zabbix_agentd.d\" + Update-Config-Var $ZbxAgentConfig "Include" "$ZabbixConfigDir\zabbix_agentd.d\*.conf" Update-Config-Var $ZbxAgentConfig "UnsafeUserParameters" "$env:ZBX_UNSAFEUSERPARAMETERS" Update-Config-Var $ZbxAgentConfig "TLSConnect" "$env:ZBX_TLSCONNECT" Update-Config-Var $ZbxAgentConfig "TLSAccept" "$env:ZBX_TLSACCEPT" diff --git a/Dockerfiles/agent2/alpine/docker-entrypoint.sh b/Dockerfiles/agent2/alpine/docker-entrypoint.sh index 314204280..28e6d6f62 100755 --- a/Dockerfiles/agent2/alpine/docker-entrypoint.sh +++ b/Dockerfiles/agent2/alpine/docker-entrypoint.sh @@ -180,7 +180,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}" update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}" diff --git a/Dockerfiles/agent2/centos/docker-entrypoint.sh b/Dockerfiles/agent2/centos/docker-entrypoint.sh index 314204280..28e6d6f62 100755 --- a/Dockerfiles/agent2/centos/docker-entrypoint.sh +++ b/Dockerfiles/agent2/centos/docker-entrypoint.sh @@ -180,7 +180,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}" update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}" diff --git a/Dockerfiles/agent2/ol/docker-entrypoint.sh b/Dockerfiles/agent2/ol/docker-entrypoint.sh index 314204280..28e6d6f62 100755 --- a/Dockerfiles/agent2/ol/docker-entrypoint.sh +++ b/Dockerfiles/agent2/ol/docker-entrypoint.sh @@ -180,7 +180,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}" update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}" diff --git a/Dockerfiles/agent2/rhel/docker-entrypoint.sh b/Dockerfiles/agent2/rhel/docker-entrypoint.sh index 314204280..28e6d6f62 100755 --- a/Dockerfiles/agent2/rhel/docker-entrypoint.sh +++ b/Dockerfiles/agent2/rhel/docker-entrypoint.sh @@ -180,7 +180,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}" update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}" diff --git a/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh b/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh index 314204280..28e6d6f62 100755 --- a/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh @@ -180,7 +180,7 @@ prepare_zbx_agent_config() { # Please use include to enable Alias feature # update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS} update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}" - update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/" + update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}" update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}" update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}" diff --git a/Dockerfiles/agent2/windows/docker-entrypoint.ps1 b/Dockerfiles/agent2/windows/docker-entrypoint.ps1 index 0e0474283..108fce68d 100644 --- a/Dockerfiles/agent2/windows/docker-entrypoint.ps1 +++ b/Dockerfiles/agent2/windows/docker-entrypoint.ps1 @@ -201,7 +201,7 @@ function Prepare-Zbx-Agent-Config { # Please use include to enable Perfcounter feature # update_config_multiple_var $ZBX_AGENT_CONFIG "PerfCounter" $env:ZBX_PERFCOUNTER Update-Config-Var $ZbxAgentConfig "Timeout" "$env:ZBX_TIMEOUT" - Update-Config-Var $ZbxAgentConfig "Include" "$ZabbixConfigDir\zabbix_agentd.d\" + Update-Config-Var $ZbxAgentConfig "Include" "$ZabbixConfigDir\zabbix_agentd.d\*.conf" Update-Config-Var $ZbxAgentConfig "UnsafeUserParameters" "$env:ZBX_UNSAFEUSERPARAMETERS" Update-Config-Var $ZbxAgentConfig "TLSConnect" "$env:ZBX_TLSCONNECT" Update-Config-Var $ZbxAgentConfig "TLSAccept" "$env:ZBX_TLSACCEPT"