From b8555748122b5a32add17ac71f33580892249186 Mon Sep 17 00:00:00 2001 From: Dwordcito Date: Wed, 2 Aug 2023 00:03:52 -0300 Subject: [PATCH 01/31] Add new libraries to the manager spec file. --- rpms/SPECS/wazuh-manager.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 7c303922ad..271dbd5f77 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -682,6 +682,11 @@ rm -fr %{buildroot} %attr(750, root, wazuh) %{_localstatedir}/lib/libstdc++.so.6 %attr(750, root, wazuh) %{_localstatedir}/lib/libgcc_s.so.1 %attr(750, root, wazuh) %{_localstatedir}/lib/libfimdb.so +%attr(750, root, wazuh) %{_localstatedir}/lib/libcontent_manager.so +%attr(750, root, wazuh) %{_localstatedir}/lib/libindexer_connector.so +%attr(750, root, wazuh) %{_localstatedir}/lib/librocksdb.so.8 +%attr(750, root, wazuh) %{_localstatedir}/lib/librouter.so +%attr(750, root, wazuh) %{_localstatedir}/lib/libvulnerability_scanner.so %{_localstatedir}/lib/libpython3.10.so.1.0 %dir %attr(770, wazuh, wazuh) %{_localstatedir}/logs %attr(660, wazuh, wazuh) %ghost %{_localstatedir}/logs/active-responses.log From aa9a9e48c63ef192d94fc0cab5d14f3aab98be09 Mon Sep 17 00:00:00 2001 From: MiguelazoDS Cazajous-Miguel Date: Mon, 9 Oct 2023 16:54:45 -0300 Subject: [PATCH 02/31] Adding flatccrt library to rpm SPECS --- rpms/SPECS/wazuh-manager.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 271dbd5f77..6cecf606e5 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -685,6 +685,7 @@ rm -fr %{buildroot} %attr(750, root, wazuh) %{_localstatedir}/lib/libcontent_manager.so %attr(750, root, wazuh) %{_localstatedir}/lib/libindexer_connector.so %attr(750, root, wazuh) %{_localstatedir}/lib/librocksdb.so.8 +%attr(750, root, wazuh) %{_localstatedir}/lib/libflatccrt.so %attr(750, root, wazuh) %{_localstatedir}/lib/librouter.so %attr(750, root, wazuh) %{_localstatedir}/lib/libvulnerability_scanner.so %{_localstatedir}/lib/libpython3.10.so.1.0 From ef656127a366146fae7b9ba99c90e56692556467 Mon Sep 17 00:00:00 2001 From: Dwordcito Date: Thu, 23 Nov 2023 13:55:21 -0300 Subject: [PATCH 03/31] Remove cpe helper installation --- rpms/SPECS/wazuh-manager.spec | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 6cecf606e5..6943a0f33f 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -95,9 +95,6 @@ install -m 0644 src/init/templates/wazuh-manager.service ${RPM_BUILD_ROOT}/usr/l # Clean the preinstalled configuration assesment files rm -f ${RPM_BUILD_ROOT}%{_localstatedir}/ruleset/sca/* -# Install Vulnerability Detector files -install -m 0440 src/wazuh_modules/vulnerability_detector/*.json ${RPM_BUILD_ROOT}%{_localstatedir}/queue/vulnerabilities/dictionaries - # Add configuration scripts mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/manager_installation_scripts/ cp gen_ossec.sh ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/manager_installation_scripts/ @@ -695,6 +692,7 @@ rm -fr %{buildroot} %attr(640, wazuh, wazuh) %ghost %{_localstatedir}/logs/integrations.log %attr(660, wazuh, wazuh) %ghost %{_localstatedir}/logs/ossec.log %attr(660, wazuh, wazuh) %ghost %{_localstatedir}/logs/ossec.json +%attr(0440, root, wazuh) %{_localstatedir}/queue/indexer/vd_states_template.json %dir %attr(750, wazuh, wazuh) %{_localstatedir}/logs/api %dir %attr(750, wazuh, wazuh) %{_localstatedir}/logs/archives %dir %attr(750, wazuh, wazuh) %{_localstatedir}/logs/alerts @@ -734,11 +732,10 @@ rm -fr %{buildroot} %dir %attr(770, wazuh, wazuh) %{_localstatedir}/queue/rids %dir %attr(770, wazuh, wazuh) %{_localstatedir}/queue/tasks %dir %attr(770, wazuh, wazuh) %{_localstatedir}/queue/sockets -%dir %attr(660, root, wazuh) %{_localstatedir}/queue/vulnerabilities -%dir %attr(440, root, wazuh) %{_localstatedir}/queue/vulnerabilities/dictionaries +%dir %attr(770, wazuh, wazuh) %{_localstatedir}/queue/vd +%dir %attr(770, wazuh, wazuh) %{_localstatedir}/queue/indexer +%dir %attr(770, wazuh, wazuh) %{_localstatedir}/queue/router %dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/logcollector -%attr(0440, root, wazuh) %{_localstatedir}/queue/vulnerabilities/dictionaries/cpe_helper.json -%attr(0440, root, wazuh) %ghost %{_localstatedir}/queue/vulnerabilities/dictionaries/msu.json.gz %dir %attr(750, root, wazuh) %{_localstatedir}/ruleset %dir %attr(750, root, wazuh) %{_localstatedir}/ruleset/sca %dir %attr(750, root, wazuh) %{_localstatedir}/ruleset/decoders From 6c8bd2bbcc129c9f5963c8edb97437379d17a404 Mon Sep 17 00:00:00 2001 From: Dwordcito Date: Thu, 7 Dec 2023 14:17:18 -0300 Subject: [PATCH 04/31] Remove libflatcc from specs files. --- rpms/SPECS/wazuh-manager.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 6943a0f33f..c87cbde26e 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -682,7 +682,6 @@ rm -fr %{buildroot} %attr(750, root, wazuh) %{_localstatedir}/lib/libcontent_manager.so %attr(750, root, wazuh) %{_localstatedir}/lib/libindexer_connector.so %attr(750, root, wazuh) %{_localstatedir}/lib/librocksdb.so.8 -%attr(750, root, wazuh) %{_localstatedir}/lib/libflatccrt.so %attr(750, root, wazuh) %{_localstatedir}/lib/librouter.so %attr(750, root, wazuh) %{_localstatedir}/lib/libvulnerability_scanner.so %{_localstatedir}/lib/libpython3.10.so.1.0 From be4f235bf792db849e79d17edafdc9e19676b43d Mon Sep 17 00:00:00 2001 From: Francisco Tuduri Date: Wed, 20 Dec 2023 12:13:35 -0300 Subject: [PATCH 05/31] Add indexer config to ossec.conf if missing --- rpms/SPECS/wazuh-manager.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index c87cbde26e..0ce7bec4d3 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -296,6 +296,10 @@ if [ $1 = 2 ]; then rm -rf %{_localstatedir}/queue/sockets cp -rp %{_localstatedir}/queue/ossec %{_localstatedir}/queue/sockets fi + + CONFIG_INDEXER_TEMPLATE="%{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/generic/wodle-indexer.manager.template" + . %{_localstatedir}/packages_files/manager_installation_scripts/src/init/update-indexer.sh + updateIndexerTemplate "%{_localstatedir}/etc/ossec.conf" $CONFIG_INDEXER_TEMPLATE fi # Fresh install code block From 7f9a95ce440bccea47271208c76a3e7e89a126a2 Mon Sep 17 00:00:00 2001 From: Francisco Tuduri Date: Wed, 20 Dec 2023 12:20:40 -0300 Subject: [PATCH 06/31] Revert "Add indexer config to ossec.conf if missing" This reverts commit be4f235bf792db849e79d17edafdc9e19676b43d. --- rpms/SPECS/wazuh-manager.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 0ce7bec4d3..c87cbde26e 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -296,10 +296,6 @@ if [ $1 = 2 ]; then rm -rf %{_localstatedir}/queue/sockets cp -rp %{_localstatedir}/queue/ossec %{_localstatedir}/queue/sockets fi - - CONFIG_INDEXER_TEMPLATE="%{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/generic/wodle-indexer.manager.template" - . %{_localstatedir}/packages_files/manager_installation_scripts/src/init/update-indexer.sh - updateIndexerTemplate "%{_localstatedir}/etc/ossec.conf" $CONFIG_INDEXER_TEMPLATE fi # Fresh install code block From 9ceb882bd361d5c85a5f5032e8b9f3d3ba677c29 Mon Sep 17 00:00:00 2001 From: Francisco Tuduri Date: Wed, 20 Dec 2023 12:22:30 -0300 Subject: [PATCH 07/31] Add indexer config to ossec.conf if missing, on upgrade --- rpms/SPECS/wazuh-manager.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 183cd103c8..dd7b65fb6c 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -286,6 +286,8 @@ fi %post echo "VERSION=\"$(%{_localstatedir}/bin/wazuh-control info -v)\"" > /etc/ossec-init.conf + +# Upgrade install code block if [ $1 = 2 ]; then if [ -d %{_localstatedir}/logs/ossec ]; then rm -rf %{_localstatedir}/logs/wazuh @@ -296,6 +298,11 @@ if [ $1 = 2 ]; then rm -rf %{_localstatedir}/queue/sockets cp -rp %{_localstatedir}/queue/ossec %{_localstatedir}/queue/sockets fi + + # Ensure that the 'Indexer' is configured + CONFIG_INDEXER_TEMPLATE="%{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/generic/wodle-indexer.manager.template" + . %{_localstatedir}/packages_files/manager_installation_scripts/src/init/update-indexer.sh + updateIndexerTemplate "%{_localstatedir}/etc/ossec.conf" $CONFIG_INDEXER_TEMPLATE fi # Fresh install code block From dded7ee98c5b94a220f6c5e869f78aa9dcaf3324 Mon Sep 17 00:00:00 2001 From: Tomas Sarquis Date: Tue, 12 Dec 2023 15:35:53 -0300 Subject: [PATCH 08/31] Update old VD config when installing Wazuh manager Co-authored-by: Kevin Cardenas --- debs/SPECS/wazuh-manager/debian/postinst | 48 +++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index ece01e5b0f..2ab5c9d2a6 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # postinst script for Wazuh # Wazuh, Inc 2015 set -e @@ -266,6 +266,52 @@ case "$1" in fi fi + # Function that checks if the old (< v4.8) VD configuration is present. + is_old_vulndet_config_present() + { + local OSSEC_CONFIGURATION_FILE="$1" + local VULNERABILITY_DETECTOR_PATTERN="" + + if ( grep -q "$VULNERABILITY_DETECTOR_PATTERN" "$OSSEC_CONFIGURATION_FILE" ); then + return 0 + fi + return 1 + } + + # Function that updates the old (< v4.8) VD configuration with the latest one. + update_vulndet_config() + { + local OSSEC_CONFIGURATION_FILE="$1" + local OSSEC_CONFIGURATION_FILE_TMP="$1.tmp" + + touch $OSSEC_CONFIGURATION_FILE_TMP + local OSSEC_CONFIGURATION_FILE_BEFORE_VD="$(sed -ne '//q;p' $OSSEC_CONFIGURATION_FILE)" + local OSSEC_CONFIGURATION_FILE_AFTER_VD="$(sed -e '1,/<\/vulnerability-detector>/d' $OSSEC_CONFIGURATION_FILE)" + + # Append current config preceding the old VD config. + echo "${OSSEC_CONFIGURATION_FILE_BEFORE_VD}" >> $OSSEC_CONFIGURATION_FILE_TMP + echo "" >> $OSSEC_CONFIGURATION_FILE_TMP + + # Append new VD config. + local VULNDET_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-vulnerability-detection.manager.template" + cat ${VULNDET_TEMPLATE_FILE} >> $OSSEC_CONFIGURATION_FILE_TMP + echo "" >> $OSSEC_CONFIGURATION_FILE_TMP + + # Append new Indexer config. + local INDEXER_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-indexer.manager.template" + cat ${INDEXER_TEMPLATE_FILE} >> $OSSEC_CONFIGURATION_FILE_TMP + + # Append current config succeeding the old VD config. + echo "$OSSEC_CONFIGURATION_FILE_AFTER_VD" >> $OSSEC_CONFIGURATION_FILE_TMP + + mv $OSSEC_CONFIGURATION_FILE_TMP $OSSEC_CONFIGURATION_FILE + } + + # Update VD configuration if necessary. + if is_old_vulndet_config_present "${DIR}/etc/ossec.conf"; then + update_vulndet_config "${DIR}/etc/ossec.conf" + fi + if [ ! -z "$2" ]; then if [ -f ${WAZUH_TMP_DIR}/wazuh.restart ] ; then if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1; then From d370b7beb7f93ab9bb8fad1c3e6c44e00beb6135 Mon Sep 17 00:00:00 2001 From: Tomas Sarquis Date: Tue, 12 Dec 2023 17:45:25 -0300 Subject: [PATCH 09/31] Improve script by doing it more general --- debs/SPECS/wazuh-manager/debian/postinst | 84 ++++++++++++++++-------- 1 file changed, 57 insertions(+), 27 deletions(-) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index 2ab5c9d2a6..3d3dc59200 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -266,50 +266,80 @@ case "$1" in fi fi - # Function that checks if the old (< v4.8) VD configuration is present. - is_old_vulndet_config_present() + # Function that checks if a config if present. + is_config_present() { - local OSSEC_CONFIGURATION_FILE="$1" - local VULNERABILITY_DETECTOR_PATTERN="" + local CONFIG_FILE="${DIR}/etc/ossec.conf" + local CONFIG_PATTERN="$1" - if ( grep -q "$VULNERABILITY_DETECTOR_PATTERN" "$OSSEC_CONFIGURATION_FILE" ); then + if ( grep -q "$CONFIG_PATTERN" "$CONFIG_FILE" ); then return 0 fi return 1 } - # Function that updates the old (< v4.8) VD configuration with the latest one. - update_vulndet_config() + # Function that adds a wodle config from a template file. + add_wodle_config() { - local OSSEC_CONFIGURATION_FILE="$1" - local OSSEC_CONFIGURATION_FILE_TMP="$1.tmp" + local CONFIG_FILE="${DIR}/etc/ossec.conf" + local CONFIG_FILE_TMP="${DIR}/etc/ossec.conf.tmp" + local WODLE_NAME="$1" - touch $OSSEC_CONFIGURATION_FILE_TMP - local OSSEC_CONFIGURATION_FILE_BEFORE_VD="$(sed -ne '//q;p' $OSSEC_CONFIGURATION_FILE)" - local OSSEC_CONFIGURATION_FILE_AFTER_VD="$(sed -e '1,/<\/vulnerability-detector>/d' $OSSEC_CONFIGURATION_FILE)" + touch $CONFIG_FILE_TMP + cat ${CONFIG_FILE} >> $CONFIG_FILE_TMP - # Append current config preceding the old VD config. - echo "${OSSEC_CONFIGURATION_FILE_BEFORE_VD}" >> $OSSEC_CONFIGURATION_FILE_TMP - echo "" >> $OSSEC_CONFIGURATION_FILE_TMP + # Remove trailing newlines and config closure ("") + printf "%s" "$(< ${CONFIG_FILE_TMP})" > $CONFIG_FILE_TMP + sed -i '$ d' $CONFIG_FILE_TMP + + # Append wodle config. + local WODLE_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-${WODLE_NAME}.manager.template" + cat ${WODLE_TEMPLATE_FILE} >> $CONFIG_FILE_TMP + echo "" >> $CONFIG_FILE_TMP + + # Close config. + echo "" >> $CONFIG_FILE_TMP + + mv $CONFIG_FILE_TMP $CONFIG_FILE + } + + # Function that removes a piece of config given two patterns. + remove_config() + { + local CONFIG_FILE="${DIR}/etc/ossec.conf" + local CONFIG_FILE_TMP="${DIR}/etc/ossec.conf.tmp" + local PATTERN_BEFORE="$1" + local PATTERN_AFTER="$2" - # Append new VD config. - local VULNDET_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-vulnerability-detection.manager.template" - cat ${VULNDET_TEMPLATE_FILE} >> $OSSEC_CONFIGURATION_FILE_TMP - echo "" >> $OSSEC_CONFIGURATION_FILE_TMP + touch $CONFIG_FILE_TMP + local CONFIG_BEFORE="$(sed -ne "$PATTERN_BEFORE" $CONFIG_FILE)" + local CONFIG_AFTER="$(sed -e "$PATTERN_AFTER" $CONFIG_FILE)" - # Append new Indexer config. - local INDEXER_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-indexer.manager.template" - cat ${INDEXER_TEMPLATE_FILE} >> $OSSEC_CONFIGURATION_FILE_TMP + # Append current config preceding the old VD config. + echo "${CONFIG_BEFORE}" >> $CONFIG_FILE_TMP # Append current config succeeding the old VD config. - echo "$OSSEC_CONFIGURATION_FILE_AFTER_VD" >> $OSSEC_CONFIGURATION_FILE_TMP + echo "$CONFIG_AFTER" >> $CONFIG_FILE_TMP - mv $OSSEC_CONFIGURATION_FILE_TMP $OSSEC_CONFIGURATION_FILE + mv $CONFIG_FILE_TMP $CONFIG_FILE } - # Update VD configuration if necessary. - if is_old_vulndet_config_present "${DIR}/etc/ossec.conf"; then - update_vulndet_config "${DIR}/etc/ossec.conf" + # Remove old VD config if present. + is_config_present "" + if [[ $? -eq 0 ]]; then + remove_config "//q;p" "1,/<\/vulnerability-detector>/d" + fi + + # Append new VD config if not present. + is_config_present "" + if [[ $? -eq 1 ]]; then + add_wodle_config "vulnerability-detection" + fi + + # Append new indexer config if not present. + is_config_present "" + if [[ $? -eq 1 ]]; then + add_wodle_config "indexer" fi if [ ! -z "$2" ]; then From 220b931402e70cc51d4bce333dd5e85a30788c19 Mon Sep 17 00:00:00 2001 From: Tomas Sarquis Date: Wed, 13 Dec 2023 09:11:37 -0300 Subject: [PATCH 10/31] Revert "Improve script by doing it more general" This reverts commit d0e09055a79651d60bb69d37738a9665f2f1ba6e. --- debs/SPECS/wazuh-manager/debian/postinst | 84 ++++++++---------------- 1 file changed, 27 insertions(+), 57 deletions(-) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index 3d3dc59200..2ab5c9d2a6 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -266,80 +266,50 @@ case "$1" in fi fi - # Function that checks if a config if present. - is_config_present() + # Function that checks if the old (< v4.8) VD configuration is present. + is_old_vulndet_config_present() { - local CONFIG_FILE="${DIR}/etc/ossec.conf" - local CONFIG_PATTERN="$1" + local OSSEC_CONFIGURATION_FILE="$1" + local VULNERABILITY_DETECTOR_PATTERN="" - if ( grep -q "$CONFIG_PATTERN" "$CONFIG_FILE" ); then + if ( grep -q "$VULNERABILITY_DETECTOR_PATTERN" "$OSSEC_CONFIGURATION_FILE" ); then return 0 fi return 1 } - # Function that adds a wodle config from a template file. - add_wodle_config() + # Function that updates the old (< v4.8) VD configuration with the latest one. + update_vulndet_config() { - local CONFIG_FILE="${DIR}/etc/ossec.conf" - local CONFIG_FILE_TMP="${DIR}/etc/ossec.conf.tmp" - local WODLE_NAME="$1" + local OSSEC_CONFIGURATION_FILE="$1" + local OSSEC_CONFIGURATION_FILE_TMP="$1.tmp" - touch $CONFIG_FILE_TMP - cat ${CONFIG_FILE} >> $CONFIG_FILE_TMP + touch $OSSEC_CONFIGURATION_FILE_TMP + local OSSEC_CONFIGURATION_FILE_BEFORE_VD="$(sed -ne '//q;p' $OSSEC_CONFIGURATION_FILE)" + local OSSEC_CONFIGURATION_FILE_AFTER_VD="$(sed -e '1,/<\/vulnerability-detector>/d' $OSSEC_CONFIGURATION_FILE)" - # Remove trailing newlines and config closure ("") - printf "%s" "$(< ${CONFIG_FILE_TMP})" > $CONFIG_FILE_TMP - sed -i '$ d' $CONFIG_FILE_TMP - - # Append wodle config. - local WODLE_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-${WODLE_NAME}.manager.template" - cat ${WODLE_TEMPLATE_FILE} >> $CONFIG_FILE_TMP - echo "" >> $CONFIG_FILE_TMP - - # Close config. - echo "" >> $CONFIG_FILE_TMP - - mv $CONFIG_FILE_TMP $CONFIG_FILE - } - - # Function that removes a piece of config given two patterns. - remove_config() - { - local CONFIG_FILE="${DIR}/etc/ossec.conf" - local CONFIG_FILE_TMP="${DIR}/etc/ossec.conf.tmp" - local PATTERN_BEFORE="$1" - local PATTERN_AFTER="$2" + # Append current config preceding the old VD config. + echo "${OSSEC_CONFIGURATION_FILE_BEFORE_VD}" >> $OSSEC_CONFIGURATION_FILE_TMP + echo "" >> $OSSEC_CONFIGURATION_FILE_TMP - touch $CONFIG_FILE_TMP - local CONFIG_BEFORE="$(sed -ne "$PATTERN_BEFORE" $CONFIG_FILE)" - local CONFIG_AFTER="$(sed -e "$PATTERN_AFTER" $CONFIG_FILE)" + # Append new VD config. + local VULNDET_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-vulnerability-detection.manager.template" + cat ${VULNDET_TEMPLATE_FILE} >> $OSSEC_CONFIGURATION_FILE_TMP + echo "" >> $OSSEC_CONFIGURATION_FILE_TMP - # Append current config preceding the old VD config. - echo "${CONFIG_BEFORE}" >> $CONFIG_FILE_TMP + # Append new Indexer config. + local INDEXER_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-indexer.manager.template" + cat ${INDEXER_TEMPLATE_FILE} >> $OSSEC_CONFIGURATION_FILE_TMP # Append current config succeeding the old VD config. - echo "$CONFIG_AFTER" >> $CONFIG_FILE_TMP + echo "$OSSEC_CONFIGURATION_FILE_AFTER_VD" >> $OSSEC_CONFIGURATION_FILE_TMP - mv $CONFIG_FILE_TMP $CONFIG_FILE + mv $OSSEC_CONFIGURATION_FILE_TMP $OSSEC_CONFIGURATION_FILE } - # Remove old VD config if present. - is_config_present "" - if [[ $? -eq 0 ]]; then - remove_config "//q;p" "1,/<\/vulnerability-detector>/d" - fi - - # Append new VD config if not present. - is_config_present "" - if [[ $? -eq 1 ]]; then - add_wodle_config "vulnerability-detection" - fi - - # Append new indexer config if not present. - is_config_present "" - if [[ $? -eq 1 ]]; then - add_wodle_config "indexer" + # Update VD configuration if necessary. + if is_old_vulndet_config_present "${DIR}/etc/ossec.conf"; then + update_vulndet_config "${DIR}/etc/ossec.conf" fi if [ ! -z "$2" ]; then From a35d4152e9f320baae311c1f416729e3bccf7c89 Mon Sep 17 00:00:00 2001 From: Tomas Sarquis Date: Wed, 13 Dec 2023 10:32:35 -0300 Subject: [PATCH 11/31] Rename variables to shorter names --- debs/SPECS/wazuh-manager/debian/postinst | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index 2ab5c9d2a6..af0447860e 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -269,10 +269,10 @@ case "$1" in # Function that checks if the old (< v4.8) VD configuration is present. is_old_vulndet_config_present() { - local OSSEC_CONFIGURATION_FILE="$1" + local CONFIG_FILE="$1" local VULNERABILITY_DETECTOR_PATTERN="" - if ( grep -q "$VULNERABILITY_DETECTOR_PATTERN" "$OSSEC_CONFIGURATION_FILE" ); then + if ( grep -q "$VULNERABILITY_DETECTOR_PATTERN" "$CONFIG_FILE" ); then return 0 fi return 1 @@ -281,30 +281,30 @@ case "$1" in # Function that updates the old (< v4.8) VD configuration with the latest one. update_vulndet_config() { - local OSSEC_CONFIGURATION_FILE="$1" - local OSSEC_CONFIGURATION_FILE_TMP="$1.tmp" + local CONFIG_FILE="$1" + local CONFIG_FILE_TMP="$1.tmp" - touch $OSSEC_CONFIGURATION_FILE_TMP - local OSSEC_CONFIGURATION_FILE_BEFORE_VD="$(sed -ne '//q;p' $OSSEC_CONFIGURATION_FILE)" - local OSSEC_CONFIGURATION_FILE_AFTER_VD="$(sed -e '1,/<\/vulnerability-detector>/d' $OSSEC_CONFIGURATION_FILE)" + touch $CONFIG_FILE_TMP + local CONFIG_BEFORE_VD="$(sed -ne '//q;p' $CONFIG_FILE)" + local CONFIG_AFTER_VD="$(sed -e '1,/<\/vulnerability-detector>/d' $CONFIG_FILE)" # Append current config preceding the old VD config. - echo "${OSSEC_CONFIGURATION_FILE_BEFORE_VD}" >> $OSSEC_CONFIGURATION_FILE_TMP - echo "" >> $OSSEC_CONFIGURATION_FILE_TMP + echo "${CONFIG_BEFORE_VD}" >> $CONFIG_FILE_TMP + echo "" >> $CONFIG_FILE_TMP # Append new VD config. local VULNDET_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-vulnerability-detection.manager.template" - cat ${VULNDET_TEMPLATE_FILE} >> $OSSEC_CONFIGURATION_FILE_TMP - echo "" >> $OSSEC_CONFIGURATION_FILE_TMP + cat ${VULNDET_TEMPLATE_FILE} >> $CONFIG_FILE_TMP + echo "" >> $CONFIG_FILE_TMP # Append new Indexer config. local INDEXER_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-indexer.manager.template" - cat ${INDEXER_TEMPLATE_FILE} >> $OSSEC_CONFIGURATION_FILE_TMP + cat ${INDEXER_TEMPLATE_FILE} >> $CONFIG_FILE_TMP # Append current config succeeding the old VD config. - echo "$OSSEC_CONFIGURATION_FILE_AFTER_VD" >> $OSSEC_CONFIGURATION_FILE_TMP + echo "$CONFIG_AFTER_VD" >> $CONFIG_FILE_TMP - mv $OSSEC_CONFIGURATION_FILE_TMP $OSSEC_CONFIGURATION_FILE + mv $CONFIG_FILE_TMP $CONFIG_FILE } # Update VD configuration if necessary. From 9b5dc85c474238529bd93509c355e66365bb1006 Mon Sep 17 00:00:00 2001 From: Tomas Sarquis Date: Mon, 18 Dec 2023 14:25:05 -0300 Subject: [PATCH 12/31] Reuse script --- debs/SPECS/wazuh-manager/debian/postinst | 54 +++--------------------- 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index af0447860e..1bee2d6889 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # postinst script for Wazuh # Wazuh, Inc 2015 set -e @@ -234,6 +234,12 @@ case "$1" in fi + # Upgrade old (< v4.8) VD configuration if present. + CONFIG_VD_TEMPLATE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-vulnerability-detection.manager.template" + CONFIG_INDEXER_TEMPLATE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-indexer.manager.template" + . ./src/init/replace_vulnerability_detector.sh + updateVulnerabilityDetector "${DIR}/etc/ossec.conf" $CONFIG_VD_TEMPLATE $CONFIG_INDEXER_TEMPLATE + # Restoring file permissions ${SCRIPTS_DIR}/restore-permissions.sh > /dev/null 2>&1 || true @@ -266,52 +272,6 @@ case "$1" in fi fi - # Function that checks if the old (< v4.8) VD configuration is present. - is_old_vulndet_config_present() - { - local CONFIG_FILE="$1" - local VULNERABILITY_DETECTOR_PATTERN="" - - if ( grep -q "$VULNERABILITY_DETECTOR_PATTERN" "$CONFIG_FILE" ); then - return 0 - fi - return 1 - } - - # Function that updates the old (< v4.8) VD configuration with the latest one. - update_vulndet_config() - { - local CONFIG_FILE="$1" - local CONFIG_FILE_TMP="$1.tmp" - - touch $CONFIG_FILE_TMP - local CONFIG_BEFORE_VD="$(sed -ne '//q;p' $CONFIG_FILE)" - local CONFIG_AFTER_VD="$(sed -e '1,/<\/vulnerability-detector>/d' $CONFIG_FILE)" - - # Append current config preceding the old VD config. - echo "${CONFIG_BEFORE_VD}" >> $CONFIG_FILE_TMP - echo "" >> $CONFIG_FILE_TMP - - # Append new VD config. - local VULNDET_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-vulnerability-detection.manager.template" - cat ${VULNDET_TEMPLATE_FILE} >> $CONFIG_FILE_TMP - echo "" >> $CONFIG_FILE_TMP - - # Append new Indexer config. - local INDEXER_TEMPLATE_FILE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-indexer.manager.template" - cat ${INDEXER_TEMPLATE_FILE} >> $CONFIG_FILE_TMP - - # Append current config succeeding the old VD config. - echo "$CONFIG_AFTER_VD" >> $CONFIG_FILE_TMP - - mv $CONFIG_FILE_TMP $CONFIG_FILE - } - - # Update VD configuration if necessary. - if is_old_vulndet_config_present "${DIR}/etc/ossec.conf"; then - update_vulndet_config "${DIR}/etc/ossec.conf" - fi - if [ ! -z "$2" ]; then if [ -f ${WAZUH_TMP_DIR}/wazuh.restart ] ; then if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1; then From e01f47d067b5673ddafa9b8650a580ab3be00543 Mon Sep 17 00:00:00 2001 From: Tomas Sarquis Date: Mon, 18 Dec 2023 15:18:15 -0300 Subject: [PATCH 13/31] Fix path --- debs/SPECS/wazuh-manager/debian/postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index 1bee2d6889..2eedbc68cd 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -237,7 +237,7 @@ case "$1" in # Upgrade old (< v4.8) VD configuration if present. CONFIG_VD_TEMPLATE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-vulnerability-detection.manager.template" CONFIG_INDEXER_TEMPLATE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-indexer.manager.template" - . ./src/init/replace_vulnerability_detector.sh + . ${SCRIPTS_DIR}/src/init/replace_vulnerability_detector.sh updateVulnerabilityDetector "${DIR}/etc/ossec.conf" $CONFIG_VD_TEMPLATE $CONFIG_INDEXER_TEMPLATE # Restoring file permissions From 40548b19b461794f8e9d2835e26e18c771cb6a17 Mon Sep 17 00:00:00 2001 From: Francisco Tuduri Date: Wed, 20 Dec 2023 17:14:19 -0300 Subject: [PATCH 14/31] Add indexer config to ossec.conf if missing, on upgrade Co-authored-by: Tomas --- debs/SPECS/wazuh-manager/debian/postinst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index 2eedbc68cd..b983b5e81f 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -234,11 +234,10 @@ case "$1" in fi - # Upgrade old (< v4.8) VD configuration if present. - CONFIG_VD_TEMPLATE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-vulnerability-detection.manager.template" + # Ensure that the 'Indexer' is configured CONFIG_INDEXER_TEMPLATE="${SCRIPTS_DIR}/etc/templates/config/generic/wodle-indexer.manager.template" - . ${SCRIPTS_DIR}/src/init/replace_vulnerability_detector.sh - updateVulnerabilityDetector "${DIR}/etc/ossec.conf" $CONFIG_VD_TEMPLATE $CONFIG_INDEXER_TEMPLATE + . ${SCRIPTS_DIR}/src/init/update-indexer.sh + updateIndexerTemplate "${DIR}/etc/ossec.conf" $CONFIG_INDEXER_TEMPLATE # Restoring file permissions ${SCRIPTS_DIR}/restore-permissions.sh > /dev/null 2>&1 || true From 1622614cd8bcdf18dc6f0b82eec9426109d2f352 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Mon, 18 Dec 2023 03:16:20 -0500 Subject: [PATCH 15/31] Add flag --download-content to generate_debian_package.sh --- debs/generate_debian_package.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debs/generate_debian_package.sh b/debs/generate_debian_package.sh index 4f14917329..3524481c7a 100755 --- a/debs/generate_debian_package.sh +++ b/debs/generate_debian_package.sh @@ -15,6 +15,7 @@ REVISION="1" TARGET="" JOBS="2" DEBUG="no" +DOWNLOAD_CONTENT="no" BUILD_DOCKER="yes" DOCKER_TAG="latest" INSTALLATION_PATH="/var/ossec" @@ -84,7 +85,7 @@ build_deb() { ${CONTAINER_NAME}:${DOCKER_TAG} ${TARGET} ${BRANCH} ${ARCHITECTURE} \ ${REVISION} ${JOBS} ${INSTALLATION_PATH} ${DEBUG} \ ${CHECKSUM} ${PACKAGES_BRANCH} ${USE_LOCAL_SPECS} \ - ${USE_LOCAL_SOURCE_CODE} ${FUTURE}|| return 1 + ${USE_LOCAL_SOURCE_CODE} ${FUTURE} {DOWNLOAD_CONTENT}|| return 1 echo "Package $(ls -Art ${OUTDIR} | tail -n 1) added to ${OUTDIR}." @@ -162,6 +163,7 @@ help() { echo " -p, --path [Optional] Installation path for the package. By default: /var/ossec." echo " -d, --debug [Optional] Build the binaries with debug symbols. By default: no." echo " -c, --checksum [Optional] Generate checksum on the desired path (by default, if no path is specified it will be generated on the same directory than the package)." + echo " --download-content [Optional] Download content and add it to the package." echo " --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one." echo " --tag [Optional] Tag to use with the docker image." echo " --sources [Optional] Absolute path containing wazuh source code. This option will use local source code instead of downloading it from GitHub." @@ -245,6 +247,10 @@ main() { shift 1 fi ;; + "--download-content") + DOWNLOAD_CONTENT="yes" + shift 1 + ;; "--dont-build-docker") BUILD_DOCKER="no" shift 1 From 838881e68367164d83b83615543d166e2d68e6b2 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Mon, 18 Dec 2023 03:16:49 -0500 Subject: [PATCH 16/31] Add var download_content to build.sh --- debs/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debs/build.sh b/debs/build.sh index 7896c49081..8a0524befe 100755 --- a/debs/build.sh +++ b/debs/build.sh @@ -23,6 +23,7 @@ wazuh_packages_branch=$9 use_local_specs=${10} local_source_code=${11} future=${12} +download_content=${13} if [ -z "${package_release}" ]; then package_release="1" @@ -87,6 +88,7 @@ cd ${build_dir}/${build_target} && tar -czf ${package_full_name}.orig.tar.gz "${ sed -i "s:RELEASE:${package_release}:g" ${sources_dir}/debian/changelog sed -i "s:export JOBS=.*:export JOBS=${jobs}:g" ${sources_dir}/debian/rules sed -i "s:export DEBUG_ENABLED=.*:export DEBUG_ENABLED=${debug}:g" ${sources_dir}/debian/rules +sed -i "s:export DOWNLOAD_CONTENT_ENABLED=.*:export DOWNLOAD_CONTENT_ENABLED=${download_content}:g" ${sources_dir}/debian/rules sed -i "s#export PATH=.*#export PATH=/usr/local/gcc-5.5.0/bin:${PATH}#g" ${sources_dir}/debian/rules sed -i "s#export LD_LIBRARY_PATH=.*#export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}#g" ${sources_dir}/debian/rules sed -i "s:export INSTALLATION_DIR=.*:export INSTALLATION_DIR=${dir_path}:g" ${sources_dir}/debian/rules From c55ec47e797943895d5b3d215e2eb197358ba6f0 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Mon, 18 Dec 2023 03:17:06 -0500 Subject: [PATCH 17/31] Add var DOWNLOAD_CONTENT_ENABLED to rules --- debs/SPECS/wazuh-manager/debian/rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debs/SPECS/wazuh-manager/debian/rules b/debs/SPECS/wazuh-manager/debian/rules index 6c4e7da8af..e7fb3dbae8 100644 --- a/debs/SPECS/wazuh-manager/debian/rules +++ b/debs/SPECS/wazuh-manager/debian/rules @@ -26,6 +26,7 @@ export JOBS="5" export DEBUG_ENABLED="no" export PATH="${PATH}" export LD_LIBRARY_PATH="" +export DOWNLOAD_CONTENT_ENABLED="no" %: dh $@ @@ -64,6 +65,7 @@ override_dh_install: USER_GENERATE_AUTHD_CERT="y" \ USER_AUTO_START="n" \ USER_CREATE_SSL_CERT="n" \ + DOWNLOAD_CONTENT="$(DOWNLOAD_CONTENT_ENABLED)" \ ./install.sh # Copying init.d script From 34c902d489241304e2bbd80e8c35f20ab33b2999 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Mon, 18 Dec 2023 03:17:48 -0500 Subject: [PATCH 18/31] Add decompress to postinst --- debs/SPECS/wazuh-manager/debian/postinst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index b983b5e81f..bc41db4a0f 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -71,6 +71,10 @@ case "$1" in chown ${USER}:${GROUP} ${DIR}/queue/db/global.db* fi + if [ -f "${DIR}/vd.tar.xz" ]; then + tar -xf ${DIR}/vd.tar.xz -C ${DIR} + fi + # Delete uncompatible DBs versions if [ ! -z $2 ]; then From 6339a603831e6b9731c072870cc2303f97d00db0 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Mon, 18 Dec 2023 16:56:38 -0500 Subject: [PATCH 19/31] Fix var DOWNLOAD_CONTENT --- debs/generate_debian_package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debs/generate_debian_package.sh b/debs/generate_debian_package.sh index 3524481c7a..ddccc84138 100755 --- a/debs/generate_debian_package.sh +++ b/debs/generate_debian_package.sh @@ -85,7 +85,7 @@ build_deb() { ${CONTAINER_NAME}:${DOCKER_TAG} ${TARGET} ${BRANCH} ${ARCHITECTURE} \ ${REVISION} ${JOBS} ${INSTALLATION_PATH} ${DEBUG} \ ${CHECKSUM} ${PACKAGES_BRANCH} ${USE_LOCAL_SPECS} \ - ${USE_LOCAL_SOURCE_CODE} ${FUTURE} {DOWNLOAD_CONTENT}|| return 1 + ${USE_LOCAL_SOURCE_CODE} ${FUTURE} ${DOWNLOAD_CONTENT}|| return 1 echo "Package $(ls -Art ${OUTDIR} | tail -n 1) added to ${OUTDIR}." From 63993b4c9014ee8e1d1f0583befa2b708164d86e Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Mon, 18 Dec 2023 16:57:08 -0500 Subject: [PATCH 20/31] Change owner queue/vd --- debs/SPECS/wazuh-manager/debian/postinst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index bc41db4a0f..93e2379d6d 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -73,6 +73,9 @@ case "$1" in if [ -f "${DIR}/vd.tar.xz" ]; then tar -xf ${DIR}/vd.tar.xz -C ${DIR} + chown ${USER}:${GROUP} ${DIR}/queue/vd + chown ${USER}:${GROUP} ${DIR}/queue/vd-updater + rm -rf ${DIR}/vd.tar.xz fi # Delete uncompatible DBs versions From 586ce0756e05319ac1f8f6d0ce98f12fb66fd188 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Tue, 19 Dec 2023 13:56:33 -0500 Subject: [PATCH 21/31] Add --download-content option to generate_rpm_package.sh --- rpms/generate_rpm_package.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpms/generate_rpm_package.sh b/rpms/generate_rpm_package.sh index b2c3ee8f36..70afe2f5b5 100755 --- a/rpms/generate_rpm_package.sh +++ b/rpms/generate_rpm_package.sh @@ -18,6 +18,7 @@ REVISION="1" TARGET="" JOBS="2" DEBUG="no" +DOWNLOAD_CONTENT="no" BUILD_DOCKER="yes" DOCKER_TAG="latest" USER_PATH="no" @@ -110,7 +111,7 @@ build_rpm() { ${CONTAINER_NAME}:${DOCKER_TAG} ${TARGET} ${BRANCH} ${ARCHITECTURE} \ ${JOBS} ${REVISION} ${INSTALLATION_PATH} ${DEBUG} \ ${CHECKSUM} ${PACKAGES_BRANCH} ${USE_LOCAL_SPECS} ${SRC} \ - ${LEGACY} ${USE_LOCAL_SOURCE_CODE} ${FUTURE}|| return 1 + ${LEGACY} ${USE_LOCAL_SOURCE_CODE} ${FUTURE} ${DOWNLOAD_CONTENT}|| return 1 echo "Package $(ls -Art ${OUTDIR} | tail -n 1) added to ${OUTDIR}." @@ -209,6 +210,7 @@ help() { echo " -p, --path [Optional] Installation path for the package. By default: /var/ossec." echo " -d, --debug [Optional] Build the binaries with debug symbols and create debuginfo packages. By default: no." echo " -c, --checksum [Optional] Generate checksum on the desired path (by default, if no path is specified it will be generated on the same directory than the package)." + echo " --download-content [Optional] Download content and add it to the package." echo " --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one." echo " --tag [Optional] Tag to use with the docker image." echo " --sources [Optional] Absolute path containing wazuh source code. This option will use local source code instead of downloading it from GitHub." @@ -287,6 +289,10 @@ main() { DEBUG="yes" shift 1 ;; + "--download-content") + DOWNLOAD_CONTENT="yes" + shift 1 + ;; "--dont-build-docker") BUILD_DOCKER="no" shift 1 From 5ac62972a767c032ad332e202c704edc3bf16697 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Tue, 19 Dec 2023 13:56:50 -0500 Subject: [PATCH 22/31] Add --define _download_content_enabled in build.sh --- rpms/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpms/build.sh b/rpms/build.sh index 05d1224fda..da4ddbc126 100755 --- a/rpms/build.sh +++ b/rpms/build.sh @@ -24,6 +24,7 @@ src=${11} legacy=${12} local_source_code=${13} future=${14} +download_content=${15} wazuh_version="" rpmbuild="rpmbuild" @@ -125,6 +126,7 @@ fi $linux $rpmbuild --define "_sysconfdir /etc" --define "_topdir ${rpm_build_dir}" \ --define "_threads ${threads}" --define "_release ${package_release}" \ --define "_localstatedir ${directory_base}" --define "_debugenabled ${debug}" \ + --define "_download_content_enabled ${download_content}" \ --target ${architecture_target} -ba ${rpm_build_dir}/SPECS/${package_name}.spec if [[ "${checksum}" == "yes" ]]; then From f27da257ad5401d1bca3ce9b3c825ecdc7bad880 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Tue, 19 Dec 2023 13:57:27 -0500 Subject: [PATCH 23/31] Add download content in install.sh call --- rpms/SPECS/wazuh-manager.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index dd7b65fb6c..9a8d1844a1 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -78,6 +78,7 @@ echo 'USER_CA_STORE="/path/to/my_cert.pem"' >> ./etc/preloaded-vars.conf echo 'USER_GENERATE_AUTHD_CERT="y"' >> ./etc/preloaded-vars.conf echo 'USER_AUTO_START="n"' >> ./etc/preloaded-vars.conf echo 'USER_CREATE_SSL_CERT="n"' >> ./etc/preloaded-vars.conf +echo 'DOWNLOAD_CONTENT="%{_download_content_enabled}"' >> ./etc/preloaded-vars.conf ./install.sh # Create directories @@ -305,6 +306,13 @@ if [ $1 = 2 ]; then updateIndexerTemplate "%{_localstatedir}/etc/ossec.conf" $CONFIG_INDEXER_TEMPLATE fi +if [ -f "%{_localstatedir}/vd.tar.xz" ]; then + tar -xf %{_localstatedir}/vd.tar.xz -C %{_localstatedir} + chown wazuh:wazuh %{_localstatedir}/queue/vd + chown wazuh:wazuh %{_localstatedir}/queue/vd-updater + rm -rf tar -xf %{_localstatedir}/vd.tar.xz +fi + # Fresh install code block if [ $1 = 1 ]; then @@ -725,6 +733,7 @@ rm -fr %{buildroot} %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/centos/* %dir %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/rhel %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/rhel/* +%attr(750, wazuh, wazuh) %{_localstatedir}/vd.tar.xz %dir %attr(750, root, wazuh) %{_localstatedir}/queue %attr(600, root, wazuh) %ghost %{_localstatedir}/queue/agents-timestamp %dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/agentless From 1adb3618c7073f675a659b1d5cdc617c0fe02949 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Thu, 21 Dec 2023 09:05:05 -0500 Subject: [PATCH 24/31] Rename vd.tar.xz to vd_1.0.0_vd_4.8.0.tar.xz --- debs/SPECS/wazuh-manager/debian/postinst | 7 ++++--- rpms/SPECS/wazuh-manager.spec | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index 93e2379d6d..0863da1afb 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -15,6 +15,7 @@ case "$1" in OSMYSHELL="/sbin/nologin" SCRIPTS_DIR="${WAZUH_GLOBAL_TMP_DIR}/manager_installation_scripts" SCA_BASE_DIR="${SCRIPTS_DIR}/sca" + VD_FILENAME='vd_1.0.0_vd_4.8.0.tar.xz' if [ -d /run/systemd/system ]; then rm -f /etc/init.d/wazuh-manager @@ -71,11 +72,11 @@ case "$1" in chown ${USER}:${GROUP} ${DIR}/queue/db/global.db* fi - if [ -f "${DIR}/vd.tar.xz" ]; then - tar -xf ${DIR}/vd.tar.xz -C ${DIR} + if [ -f "${DIR}/${VD_FILENAME}" ]; then + tar -xf ${DIR}/${VD_FILENAME} -C ${DIR} chown ${USER}:${GROUP} ${DIR}/queue/vd chown ${USER}:${GROUP} ${DIR}/queue/vd-updater - rm -rf ${DIR}/vd.tar.xz + rm -rf ${DIR}/${VD_FILENAME} fi # Delete uncompatible DBs versions diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 9a8d1844a1..ec85c0b032 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -306,11 +306,12 @@ if [ $1 = 2 ]; then updateIndexerTemplate "%{_localstatedir}/etc/ossec.conf" $CONFIG_INDEXER_TEMPLATE fi -if [ -f "%{_localstatedir}/vd.tar.xz" ]; then - tar -xf %{_localstatedir}/vd.tar.xz -C %{_localstatedir} +VD_FILENAME='vd_1.0.0_vd_4.8.0.tar.xz' +if [ -f "%{_localstatedir}/${VD_FILENAME}" ]; then + tar -xf %{_localstatedir}/${VD_FILENAME} -C %{_localstatedir} chown wazuh:wazuh %{_localstatedir}/queue/vd chown wazuh:wazuh %{_localstatedir}/queue/vd-updater - rm -rf tar -xf %{_localstatedir}/vd.tar.xz + rm -rf tar -xf %{_localstatedir}/${VD_FILENAME} fi # Fresh install code block From e152a5e9f921f618d68976b6b1799455c430305e Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Wed, 27 Dec 2023 15:19:28 -0500 Subject: [PATCH 25/31] Update folder name vd_updater --- debs/SPECS/wazuh-manager/debian/postinst | 2 +- rpms/SPECS/wazuh-manager.spec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index 0863da1afb..fcb507b51a 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -75,7 +75,7 @@ case "$1" in if [ -f "${DIR}/${VD_FILENAME}" ]; then tar -xf ${DIR}/${VD_FILENAME} -C ${DIR} chown ${USER}:${GROUP} ${DIR}/queue/vd - chown ${USER}:${GROUP} ${DIR}/queue/vd-updater + chown ${USER}:${GROUP} ${DIR}/queue/vd_updater rm -rf ${DIR}/${VD_FILENAME} fi diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index ec85c0b032..e53bcf47a9 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -310,7 +310,7 @@ VD_FILENAME='vd_1.0.0_vd_4.8.0.tar.xz' if [ -f "%{_localstatedir}/${VD_FILENAME}" ]; then tar -xf %{_localstatedir}/${VD_FILENAME} -C %{_localstatedir} chown wazuh:wazuh %{_localstatedir}/queue/vd - chown wazuh:wazuh %{_localstatedir}/queue/vd-updater + chown wazuh:wazuh %{_localstatedir}/queue/vd_updater rm -rf tar -xf %{_localstatedir}/${VD_FILENAME} fi @@ -734,7 +734,7 @@ rm -fr %{buildroot} %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/centos/* %dir %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/rhel %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/rhel/* -%attr(750, wazuh, wazuh) %{_localstatedir}/vd.tar.xz +%attr(750, wazuh, wazuh) %{_localstatedir}/${VD_FILENAME} %dir %attr(750, root, wazuh) %{_localstatedir}/queue %attr(600, root, wazuh) %ghost %{_localstatedir}/queue/agents-timestamp %dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/agentless From b05c2a4da7ce20ea5d09ae88ed4fae2e9d044c0f Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Thu, 28 Dec 2023 12:44:07 -0500 Subject: [PATCH 26/31] Update _vdfilename --- rpms/SPECS/wazuh-manager.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index e53bcf47a9..e387fd4a3f 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -306,12 +306,12 @@ if [ $1 = 2 ]; then updateIndexerTemplate "%{_localstatedir}/etc/ossec.conf" $CONFIG_INDEXER_TEMPLATE fi -VD_FILENAME='vd_1.0.0_vd_4.8.0.tar.xz' -if [ -f "%{_localstatedir}/${VD_FILENAME}" ]; then - tar -xf %{_localstatedir}/${VD_FILENAME} -C %{_localstatedir} +%define _vdfilename vd_1.0.0_vd_4.8.0.tar.xz +if [ -f "%{_localstatedir}/%{_vdfilename}" ]; then + tar -xf %{_localstatedir}/%{_vdfilename} -C %{_localstatedir} chown wazuh:wazuh %{_localstatedir}/queue/vd chown wazuh:wazuh %{_localstatedir}/queue/vd_updater - rm -rf tar -xf %{_localstatedir}/${VD_FILENAME} + rm -rf tar -xf %{_localstatedir}/%{_vdfilename} fi # Fresh install code block @@ -734,7 +734,7 @@ rm -fr %{buildroot} %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/centos/* %dir %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/rhel %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/manager_installation_scripts/etc/templates/config/rhel/* -%attr(750, wazuh, wazuh) %{_localstatedir}/${VD_FILENAME} +%attr(750, wazuh, wazuh) %{_localstatedir}/%{_vdfilename} %dir %attr(750, root, wazuh) %{_localstatedir}/queue %attr(600, root, wazuh) %ghost %{_localstatedir}/queue/agents-timestamp %dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/agentless From b4069cf45f98cd403e03454602ebb42497407a48 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Thu, 28 Dec 2023 12:55:24 -0500 Subject: [PATCH 27/31] Fix rm command --- rpms/SPECS/wazuh-manager.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index e387fd4a3f..90dc27919a 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -311,7 +311,7 @@ if [ -f "%{_localstatedir}/%{_vdfilename}" ]; then tar -xf %{_localstatedir}/%{_vdfilename} -C %{_localstatedir} chown wazuh:wazuh %{_localstatedir}/queue/vd chown wazuh:wazuh %{_localstatedir}/queue/vd_updater - rm -rf tar -xf %{_localstatedir}/%{_vdfilename} + rm -rf %{_localstatedir}/%{_vdfilename} fi # Fresh install code block From 3ee5b418a18d4b8e4e8f4c3c41b44fb314f71a38 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Thu, 4 Jan 2024 10:50:28 -0500 Subject: [PATCH 28/31] Add xz dependency in RPM --- rpms/SPECS/wazuh-manager.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 90dc27919a..9fcfeca226 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -22,7 +22,7 @@ Conflicts: ossec-hids ossec-hids-agent wazuh-agent wazuh-local Obsoletes: wazuh-api < 4.0.0 AutoReqProv: no -Requires: coreutils +Requires: coreutils xz BuildRequires: coreutils glibc-devel automake autoconf libtool policycoreutils-python curl perl ExclusiveOS: linux From 51ade356156257d440f06d77dbf8fbb585785a95 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Thu, 4 Jan 2024 10:50:38 -0500 Subject: [PATCH 29/31] Add xz dependency in DEB --- debs/SPECS/wazuh-manager/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debs/SPECS/wazuh-manager/debian/control b/debs/SPECS/wazuh-manager/debian/control index bbdeb2a7c6..907ba3812b 100644 --- a/debs/SPECS/wazuh-manager/debian/control +++ b/debs/SPECS/wazuh-manager/debian/control @@ -8,7 +8,7 @@ Homepage: http://www.wazuh.com Package: wazuh-manager Architecture: any -Depends: ${shlibs:Depends}, libc6 (>= 2.7), lsb-release, debconf, adduser +Depends: ${shlibs:Depends}, libc6 (>= 2.7), lsb-release, debconf, adduser, xz-utils Suggests: expect Conflicts: ossec-hids-agent, wazuh-agent, ossec-hids, wazuh-api Replaces: wazuh-api From 401a0a98d78b3c383846ca2d01a865a7e631fa01 Mon Sep 17 00:00:00 2001 From: Diego Fernando Rodriguez Date: Fri, 5 Jan 2024 12:14:28 -0500 Subject: [PATCH 30/31] Remove flag --download-content Always download content, it's mandatory --- debs/SPECS/wazuh-manager/debian/rules | 3 +-- debs/build.sh | 2 -- debs/generate_debian_package.sh | 8 +------- rpms/SPECS/wazuh-manager.spec | 2 +- rpms/build.sh | 2 -- rpms/generate_rpm_package.sh | 8 +------- 6 files changed, 4 insertions(+), 21 deletions(-) diff --git a/debs/SPECS/wazuh-manager/debian/rules b/debs/SPECS/wazuh-manager/debian/rules index e7fb3dbae8..baa42c17d0 100644 --- a/debs/SPECS/wazuh-manager/debian/rules +++ b/debs/SPECS/wazuh-manager/debian/rules @@ -26,7 +26,6 @@ export JOBS="5" export DEBUG_ENABLED="no" export PATH="${PATH}" export LD_LIBRARY_PATH="" -export DOWNLOAD_CONTENT_ENABLED="no" %: dh $@ @@ -65,7 +64,7 @@ override_dh_install: USER_GENERATE_AUTHD_CERT="y" \ USER_AUTO_START="n" \ USER_CREATE_SSL_CERT="n" \ - DOWNLOAD_CONTENT="$(DOWNLOAD_CONTENT_ENABLED)" \ + DOWNLOAD_CONTENT="yes" \ ./install.sh # Copying init.d script diff --git a/debs/build.sh b/debs/build.sh index 8a0524befe..7896c49081 100755 --- a/debs/build.sh +++ b/debs/build.sh @@ -23,7 +23,6 @@ wazuh_packages_branch=$9 use_local_specs=${10} local_source_code=${11} future=${12} -download_content=${13} if [ -z "${package_release}" ]; then package_release="1" @@ -88,7 +87,6 @@ cd ${build_dir}/${build_target} && tar -czf ${package_full_name}.orig.tar.gz "${ sed -i "s:RELEASE:${package_release}:g" ${sources_dir}/debian/changelog sed -i "s:export JOBS=.*:export JOBS=${jobs}:g" ${sources_dir}/debian/rules sed -i "s:export DEBUG_ENABLED=.*:export DEBUG_ENABLED=${debug}:g" ${sources_dir}/debian/rules -sed -i "s:export DOWNLOAD_CONTENT_ENABLED=.*:export DOWNLOAD_CONTENT_ENABLED=${download_content}:g" ${sources_dir}/debian/rules sed -i "s#export PATH=.*#export PATH=/usr/local/gcc-5.5.0/bin:${PATH}#g" ${sources_dir}/debian/rules sed -i "s#export LD_LIBRARY_PATH=.*#export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}#g" ${sources_dir}/debian/rules sed -i "s:export INSTALLATION_DIR=.*:export INSTALLATION_DIR=${dir_path}:g" ${sources_dir}/debian/rules diff --git a/debs/generate_debian_package.sh b/debs/generate_debian_package.sh index ddccc84138..4f14917329 100755 --- a/debs/generate_debian_package.sh +++ b/debs/generate_debian_package.sh @@ -15,7 +15,6 @@ REVISION="1" TARGET="" JOBS="2" DEBUG="no" -DOWNLOAD_CONTENT="no" BUILD_DOCKER="yes" DOCKER_TAG="latest" INSTALLATION_PATH="/var/ossec" @@ -85,7 +84,7 @@ build_deb() { ${CONTAINER_NAME}:${DOCKER_TAG} ${TARGET} ${BRANCH} ${ARCHITECTURE} \ ${REVISION} ${JOBS} ${INSTALLATION_PATH} ${DEBUG} \ ${CHECKSUM} ${PACKAGES_BRANCH} ${USE_LOCAL_SPECS} \ - ${USE_LOCAL_SOURCE_CODE} ${FUTURE} ${DOWNLOAD_CONTENT}|| return 1 + ${USE_LOCAL_SOURCE_CODE} ${FUTURE}|| return 1 echo "Package $(ls -Art ${OUTDIR} | tail -n 1) added to ${OUTDIR}." @@ -163,7 +162,6 @@ help() { echo " -p, --path [Optional] Installation path for the package. By default: /var/ossec." echo " -d, --debug [Optional] Build the binaries with debug symbols. By default: no." echo " -c, --checksum [Optional] Generate checksum on the desired path (by default, if no path is specified it will be generated on the same directory than the package)." - echo " --download-content [Optional] Download content and add it to the package." echo " --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one." echo " --tag [Optional] Tag to use with the docker image." echo " --sources [Optional] Absolute path containing wazuh source code. This option will use local source code instead of downloading it from GitHub." @@ -247,10 +245,6 @@ main() { shift 1 fi ;; - "--download-content") - DOWNLOAD_CONTENT="yes" - shift 1 - ;; "--dont-build-docker") BUILD_DOCKER="no" shift 1 diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 90dc27919a..486012a61c 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -78,7 +78,7 @@ echo 'USER_CA_STORE="/path/to/my_cert.pem"' >> ./etc/preloaded-vars.conf echo 'USER_GENERATE_AUTHD_CERT="y"' >> ./etc/preloaded-vars.conf echo 'USER_AUTO_START="n"' >> ./etc/preloaded-vars.conf echo 'USER_CREATE_SSL_CERT="n"' >> ./etc/preloaded-vars.conf -echo 'DOWNLOAD_CONTENT="%{_download_content_enabled}"' >> ./etc/preloaded-vars.conf +echo 'DOWNLOAD_CONTENT="yes"' >> ./etc/preloaded-vars.conf ./install.sh # Create directories diff --git a/rpms/build.sh b/rpms/build.sh index da4ddbc126..05d1224fda 100755 --- a/rpms/build.sh +++ b/rpms/build.sh @@ -24,7 +24,6 @@ src=${11} legacy=${12} local_source_code=${13} future=${14} -download_content=${15} wazuh_version="" rpmbuild="rpmbuild" @@ -126,7 +125,6 @@ fi $linux $rpmbuild --define "_sysconfdir /etc" --define "_topdir ${rpm_build_dir}" \ --define "_threads ${threads}" --define "_release ${package_release}" \ --define "_localstatedir ${directory_base}" --define "_debugenabled ${debug}" \ - --define "_download_content_enabled ${download_content}" \ --target ${architecture_target} -ba ${rpm_build_dir}/SPECS/${package_name}.spec if [[ "${checksum}" == "yes" ]]; then diff --git a/rpms/generate_rpm_package.sh b/rpms/generate_rpm_package.sh index 70afe2f5b5..b2c3ee8f36 100755 --- a/rpms/generate_rpm_package.sh +++ b/rpms/generate_rpm_package.sh @@ -18,7 +18,6 @@ REVISION="1" TARGET="" JOBS="2" DEBUG="no" -DOWNLOAD_CONTENT="no" BUILD_DOCKER="yes" DOCKER_TAG="latest" USER_PATH="no" @@ -111,7 +110,7 @@ build_rpm() { ${CONTAINER_NAME}:${DOCKER_TAG} ${TARGET} ${BRANCH} ${ARCHITECTURE} \ ${JOBS} ${REVISION} ${INSTALLATION_PATH} ${DEBUG} \ ${CHECKSUM} ${PACKAGES_BRANCH} ${USE_LOCAL_SPECS} ${SRC} \ - ${LEGACY} ${USE_LOCAL_SOURCE_CODE} ${FUTURE} ${DOWNLOAD_CONTENT}|| return 1 + ${LEGACY} ${USE_LOCAL_SOURCE_CODE} ${FUTURE}|| return 1 echo "Package $(ls -Art ${OUTDIR} | tail -n 1) added to ${OUTDIR}." @@ -210,7 +209,6 @@ help() { echo " -p, --path [Optional] Installation path for the package. By default: /var/ossec." echo " -d, --debug [Optional] Build the binaries with debug symbols and create debuginfo packages. By default: no." echo " -c, --checksum [Optional] Generate checksum on the desired path (by default, if no path is specified it will be generated on the same directory than the package)." - echo " --download-content [Optional] Download content and add it to the package." echo " --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one." echo " --tag [Optional] Tag to use with the docker image." echo " --sources [Optional] Absolute path containing wazuh source code. This option will use local source code instead of downloading it from GitHub." @@ -289,10 +287,6 @@ main() { DEBUG="yes" shift 1 ;; - "--download-content") - DOWNLOAD_CONTENT="yes" - shift 1 - ;; "--dont-build-docker") BUILD_DOCKER="no" shift 1 From e5be5560407579f374fb41400127e7d187ca1588 Mon Sep 17 00:00:00 2001 From: Marcel Kemp Date: Tue, 9 Jan 2024 14:22:37 +0100 Subject: [PATCH 31/31] Update release date for 4.8.0 --- aix/SPECS/wazuh-agent-aix.spec | 2 +- debs/SPECS/wazuh-agent/debian/changelog | 2 +- debs/SPECS/wazuh-agent/debian/copyright | 2 +- debs/SPECS/wazuh-manager/debian/changelog | 2 +- debs/SPECS/wazuh-manager/debian/copyright | 2 +- rpms/SPECS/wazuh-agent.spec | 2 +- rpms/SPECS/wazuh-manager.spec | 2 +- solaris/solaris10/pkginfo | 2 +- stack/dashboard/deb/debian/changelog | 2 +- stack/dashboard/deb/debian/copyright | 2 +- stack/dashboard/rpm/wazuh-dashboard.spec | 2 +- stack/indexer/deb/debian/changelog | 2 +- stack/indexer/deb/debian/copyright | 2 +- stack/indexer/rpm/wazuh-indexer.spec | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/aix/SPECS/wazuh-agent-aix.spec b/aix/SPECS/wazuh-agent-aix.spec index b28a0aaf6f..cf3c4cab09 100644 --- a/aix/SPECS/wazuh-agent-aix.spec +++ b/aix/SPECS/wazuh-agent-aix.spec @@ -290,7 +290,7 @@ rm -fr %{buildroot} %attr(750, root, wazuh) %{_localstatedir}/wodles/* %changelog -* Wed Jan 31 2024 support - 4.8.0 +* Wed Feb 21 2024 support - 4.8.0 - More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html * Tue Jan 09 2024 support - 4.7.2 - More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html diff --git a/debs/SPECS/wazuh-agent/debian/changelog b/debs/SPECS/wazuh-agent/debian/changelog index a51996d722..38023a3fe6 100644 --- a/debs/SPECS/wazuh-agent/debian/changelog +++ b/debs/SPECS/wazuh-agent/debian/changelog @@ -2,7 +2,7 @@ wazuh-agent (4.8.0-RELEASE) stable; urgency=low * More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html - -- Wazuh, Inc Wed, 31 Jan 2024 00:00:00 +0000 + -- Wazuh, Inc Wed, 21 Feb 2024 00:00:00 +0000 wazuh-agent (4.7.2-RELEASE) stable; urgency=low diff --git a/debs/SPECS/wazuh-agent/debian/copyright b/debs/SPECS/wazuh-agent/debian/copyright index 7e98828b81..dd95ec27f6 100644 --- a/debs/SPECS/wazuh-agent/debian/copyright +++ b/debs/SPECS/wazuh-agent/debian/copyright @@ -1,6 +1,6 @@ This work was packaged for Debian by: - Wazuh, Inc on Wed, 31 Jan 2024 00:00:00 +0000 + Wazuh, Inc on Wed, 21 Feb 2024 00:00:00 +0000 It was downloaded from: diff --git a/debs/SPECS/wazuh-manager/debian/changelog b/debs/SPECS/wazuh-manager/debian/changelog index d709c01378..7cf4aa8f8e 100644 --- a/debs/SPECS/wazuh-manager/debian/changelog +++ b/debs/SPECS/wazuh-manager/debian/changelog @@ -2,7 +2,7 @@ wazuh-manager (4.8.0-RELEASE) stable; urgency=low * More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html - -- Wazuh, Inc Wed, 31 Jan 2024 00:00:00 +0000 + -- Wazuh, Inc Wed, 21 Feb 2024 00:00:00 +0000 wazuh-manager (4.7.2-RELEASE) stable; urgency=low diff --git a/debs/SPECS/wazuh-manager/debian/copyright b/debs/SPECS/wazuh-manager/debian/copyright index 7e98828b81..dd95ec27f6 100644 --- a/debs/SPECS/wazuh-manager/debian/copyright +++ b/debs/SPECS/wazuh-manager/debian/copyright @@ -1,6 +1,6 @@ This work was packaged for Debian by: - Wazuh, Inc on Wed, 31 Jan 2024 00:00:00 +0000 + Wazuh, Inc on Wed, 21 Feb 2024 00:00:00 +0000 It was downloaded from: diff --git a/rpms/SPECS/wazuh-agent.spec b/rpms/SPECS/wazuh-agent.spec index 0bf5885b1b..9c7903c31c 100644 --- a/rpms/SPECS/wazuh-agent.spec +++ b/rpms/SPECS/wazuh-agent.spec @@ -625,7 +625,7 @@ rm -fr %{buildroot} %attr(750, root, wazuh) %{_localstatedir}/wodles/gcloud/* %changelog -* Wed Jan 31 2024 support - 4.8.0 +* Wed Feb 21 2024 support - 4.8.0 - More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html * Tue Jan 09 2024 support - 4.7.2 - More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index b9ac2bfceb..272b6229fe 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -872,7 +872,7 @@ rm -fr %{buildroot} %attr(750, root, wazuh) %{_localstatedir}/wodles/gcloud/* %changelog -* Wed Jan 31 2024 support - 4.8.0 +* Wed Feb 21 2024 support - 4.8.0 - More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html * Tue Jan 09 2024 support - 4.7.2 - More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html diff --git a/solaris/solaris10/pkginfo b/solaris/solaris10/pkginfo index 6ecf2e19e5..4764c3e403 100644 --- a/solaris/solaris10/pkginfo +++ b/solaris/solaris10/pkginfo @@ -5,7 +5,7 @@ ARCH="i386" CLASSES="none" CATEGORY="system" VENDOR="Wazuh, Inc " -PSTAMP="31Jan2024" +PSTAMP="21Feb2024" EMAIL="info@wazuh.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/stack/dashboard/deb/debian/changelog b/stack/dashboard/deb/debian/changelog index 80223f3564..b75f24fbcf 100644 --- a/stack/dashboard/deb/debian/changelog +++ b/stack/dashboard/deb/debian/changelog @@ -2,7 +2,7 @@ wazuh-dashboard (4.8.0-RELEASE) stable; urgency=low * More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html - -- Wazuh, Inc Wed, 31 Jan 2024 00:00:00 +0000 + -- Wazuh, Inc Wed, 21 Feb 2024 00:00:00 +0000 wazuh-dashboard (4.7.2-RELEASE) stable; urgency=low diff --git a/stack/dashboard/deb/debian/copyright b/stack/dashboard/deb/debian/copyright index 551c75ab1e..aec9810019 100644 --- a/stack/dashboard/deb/debian/copyright +++ b/stack/dashboard/deb/debian/copyright @@ -1,6 +1,6 @@ This work was packaged for Debian by: - Wazuh, Inc on Wed, 31 Jan 2024 00:00:00 +0000 + Wazuh, Inc on Wed, 21 Feb 2024 00:00:00 +0000 It was downloaded from: diff --git a/stack/dashboard/rpm/wazuh-dashboard.spec b/stack/dashboard/rpm/wazuh-dashboard.spec index 10df53058a..5ec48d039c 100644 --- a/stack/dashboard/rpm/wazuh-dashboard.spec +++ b/stack/dashboard/rpm/wazuh-dashboard.spec @@ -335,7 +335,7 @@ rm -fr %{buildroot} %config(noreplace) %attr(640, %{USER}, %{GROUP}) "%{CONFIG_DIR}/opensearch_dashboards.yml" %changelog -* Wed Jan 31 2024 support - 4.8.0 +* Wed Feb 21 2024 support - 4.8.0 - More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html * Tue Jan 09 2024 support - 4.7.2 - More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html diff --git a/stack/indexer/deb/debian/changelog b/stack/indexer/deb/debian/changelog index 2f2fcfd6f8..4cab2d6335 100644 --- a/stack/indexer/deb/debian/changelog +++ b/stack/indexer/deb/debian/changelog @@ -2,7 +2,7 @@ wazuh-indexer (4.8.0-RELEASE) stable; urgency=low * More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html - -- Wazuh, Inc Wed, 31 Jan 2024 00:00:00 +0000 + -- Wazuh, Inc Wed, 21 Feb 2024 00:00:00 +0000 wazuh-indexer (4.7.2-RELEASE) stable; urgency=low diff --git a/stack/indexer/deb/debian/copyright b/stack/indexer/deb/debian/copyright index 551c75ab1e..aec9810019 100644 --- a/stack/indexer/deb/debian/copyright +++ b/stack/indexer/deb/debian/copyright @@ -1,6 +1,6 @@ This work was packaged for Debian by: - Wazuh, Inc on Wed, 31 Jan 2024 00:00:00 +0000 + Wazuh, Inc on Wed, 21 Feb 2024 00:00:00 +0000 It was downloaded from: diff --git a/stack/indexer/rpm/wazuh-indexer.spec b/stack/indexer/rpm/wazuh-indexer.spec index 2eb898e414..3ff12e4738 100755 --- a/stack/indexer/rpm/wazuh-indexer.spec +++ b/stack/indexer/rpm/wazuh-indexer.spec @@ -686,7 +686,7 @@ rm -fr %{buildroot} %changelog -* Wed Jan 31 2024 support - 4.8.0 +* Wed Feb 21 2024 support - 4.8.0 - More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html * Tue Jan 09 2024 support - 4.7.2 - More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html