From 8c14f7823b833caa92b51d62131a56fa4b27ee1a Mon Sep 17 00:00:00 2001 From: Charles N Wyble Date: Thu, 26 Jun 2025 13:58:23 -0500 Subject: [PATCH] . --- Modules/Security/secharden-wazuh.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Modules/Security/secharden-wazuh.sh b/Modules/Security/secharden-wazuh.sh index 309a6ef..4bac839 100644 --- a/Modules/Security/secharden-wazuh.sh +++ b/Modules/Security/secharden-wazuh.sh @@ -1,5 +1,12 @@ #!/bin/bash +# We don't want to run this on the wazuh server, otherwise bad things happen... + +export TSYS_NSM_CHECK +TSYS_NSM_CHECK="$(hostname |grep -c tsys-nsm ||true)" + +if [ "$TSYS_NSM_CHECK" -eq 0 ]; then + curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && chmod 644 /usr/share/keyrings/wazuh.gpg echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" > /etc/apt/sources.list.d/wazuh.list apt-get update @@ -7,4 +14,6 @@ WAZUH_MANAGER="tsys-nsm.knel.net" apt-get -y install wazuh-agent systemctl daemon-reload systemctl enable wazuh-agent systemctl start wazuh-agent -echo "wazuh-agent hold" | dpkg --set-selections \ No newline at end of file +echo "wazuh-agent hold" | dpkg --set-selections + +fi \ No newline at end of file