Skip to content

Commit

Permalink
Merge pull request #2746 from wazuh/merge-4.8.0-into-4.8.1
Browse files Browse the repository at this point in the history
Merge 4.8.0 into 4.8.1
  • Loading branch information
MarcelKemp authored Jan 5, 2024
2 parents c61cba1 + 31d64bb commit 57fb6c3
Show file tree
Hide file tree
Showing 16 changed files with 178 additions and 54 deletions.
2 changes: 1 addition & 1 deletion aix/SPECS/wazuh-agent-aix.spec
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ rm -fr %{buildroot}
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-1.html
* Wed Jan 31 2024 support <[email protected]> - 4.8.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html
* Sun Dec 17 2023 support <[email protected]> - 4.7.2
* Tue Jan 09 2024 support <[email protected]> - 4.7.2
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html
* Wed Dec 13 2023 support <[email protected]> - 4.7.1
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html
Expand Down
2 changes: 1 addition & 1 deletion debs/SPECS/wazuh-agent/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wazuh-agent (4.7.2-RELEASE) stable; urgency=low

* More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html

-- Wazuh, Inc <[email protected]> Sun, 17 Dec 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Tue, 09 Jan 2024 00:00:00 +0000

wazuh-agent (4.7.1-RELEASE) stable; urgency=low

Expand Down
2 changes: 1 addition & 1 deletion debs/SPECS/wazuh-manager/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wazuh-manager (4.7.2-RELEASE) stable; urgency=low

* More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html

-- Wazuh, Inc <[email protected]> Sun, 17 Dec 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Tue, 09 Jan 2024 00:00:00 +0000

wazuh-manager (4.7.1-RELEASE) stable; urgency=low

Expand Down
2 changes: 1 addition & 1 deletion rpms/SPECS/wazuh-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ rm -fr %{buildroot}
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-1.html
* Wed Jan 31 2024 support <[email protected]> - 4.8.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html
* Sun Dec 17 2023 support <[email protected]> - 4.7.2
* Tue Jan 09 2024 support <[email protected]> - 4.7.2
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html
* Wed Dec 13 2023 support <[email protected]> - 4.7.1
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html
Expand Down
2 changes: 1 addition & 1 deletion rpms/SPECS/wazuh-manager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ rm -fr %{buildroot}
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-1.html
* Wed Jan 31 2024 support <[email protected]> - 4.8.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html
* Sun Dec 17 2023 support <[email protected]> - 4.7.2
* Tue Jan 09 2024 support <[email protected]> - 4.7.2
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html
* Wed Dec 13 2023 support <[email protected]> - 4.7.1
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html
Expand Down
2 changes: 1 addition & 1 deletion stack/dashboard/deb/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wazuh-dashboard (4.7.2-RELEASE) stable; urgency=low

* More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html

-- Wazuh, Inc <[email protected]> Sun, 17 Dec 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Tue, 09 Jan 2024 00:00:00 +0000

wazuh-dashboard (4.7.1-RELEASE) stable; urgency=low

Expand Down
2 changes: 1 addition & 1 deletion stack/dashboard/rpm/wazuh-dashboard.spec
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ rm -fr %{buildroot}
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-1.html
* Wed Jan 31 2024 support <[email protected]> - 4.8.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html
* Sun Dec 17 2023 support <[email protected]> - 4.7.2
* Tue Jan 09 2024 support <[email protected]> - 4.7.2
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html
* Wed Dec 13 2023 support <[email protected]> - 4.7.1
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html
Expand Down
10 changes: 7 additions & 3 deletions stack/indexer/base/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ set -x
# License (version 2) as published by the FSF - Free Software
# Foundation.

set -e
set -ex

architecture="$1"
revision="$2"
future="$3"
reference="$4"
filebeat_module_reference="$3"
future="$4"
reference="$5"
opensearch_version="2.10.0"
base_dir=/opt/wazuh-indexer-base

Expand Down Expand Up @@ -64,6 +65,7 @@ mkdir -p ./etc/wazuh-indexer/
cp -r ./config/* ./etc/wazuh-indexer/
rm -rf ./config
cp -r /root/stack/indexer/base/files/etc/wazuh-indexer/* ./etc/wazuh-indexer/
curl -so ./etc/wazuh-indexer/wazuh-template.json "https://raw.githubusercontent.com/wazuh/wazuh/${filebeat_module_reference}/extensions/elasticsearch/7.x/wazuh-template.json"
cp -r /root/stack/indexer/base/files/etc/sysconfig ./etc/
cp -r /root/stack/indexer/base/files/etc/init.d ./etc/
cp -r /root/stack/indexer/base/files/usr ./
Expand All @@ -72,6 +74,8 @@ cp -r /root/stack/indexer/indexer-init.sh bin/
rm -rf ./plugins/opensearch-security/tools/install_demo_configuration.sh
cp /root/VERSION .



# -----------------------------------------------------------------------------

# Compile systemD module
Expand Down
29 changes: 22 additions & 7 deletions stack/indexer/base/generate_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ container_name="indexer_base_builder"
architecture="x64"
future="no"
revision="1"
filebeat_module_reference=""

# -----------------------------------------------------------------------------

Expand Down Expand Up @@ -48,11 +49,11 @@ build_base() {
# Build the RPM package with a Docker container
if [ "${reference}" ];then
docker run -t --rm -v ${outdir}/:/tmp/output:Z \
${container_name} ${architecture} ${revision} ${future} ${reference} || return 1
${container_name} ${architecture} ${revision} ${filebeat_module_reference} ${future} ${reference} || return 1
else
docker run -t --rm -v ${outdir}/:/tmp/output:Z \
-v ${current_path}/../../..:/root:Z \
${container_name} ${architecture} ${revision} ${future} || return 1
${container_name} ${architecture} ${revision} ${filebeat_module_reference} ${future} || return 1
fi

echo "Base file $(ls -Art ${outdir} | tail -n 1) added to ${outdir}."
Expand All @@ -66,11 +67,12 @@ help() {
echo
echo "Usage: $0 [OPTIONS]"
echo
echo " -s, --store <path> [Optional] Set the destination path of package. By default, an output folder will be created."
echo " --reference <ref> [Optional] wazuh-packages branch or tag"
echo " --future [Optional] Build test future package 99.99.0 Used for development purposes."
echo " -r, --revision <rev> [Optional] Package revision. By default ${revision}"
echo " -h, --help Show this help."
echo " -s, --store <path> [Optional] Set the destination path of package. By default, an output folder will be created."
echo " --reference <ref> [Optional] wazuh-packages branch or tag."
echo " -f, --filebeat-module-reference [Optional] wazuh/wazuh Filebeat template branch or tag."
echo " --future [Optional] Build test future package 99.99.0 Used for development purposes."
echo " -r, --revision <rev> [Optional] Package revision. By default ${revision}"
echo " -h, --help Show this help."
echo
exit "${1}"
}
Expand Down Expand Up @@ -100,6 +102,14 @@ main() {
help 1
fi
;;
"-f"|"--filebeat-module-reference")
if [ -n "${2}" ]; then
filebeat_module_reference="${2}"
shift 2
else
help 1
fi
;;
"--future")
future="yes"
shift 1
Expand All @@ -112,11 +122,16 @@ main() {
help 1
fi
;;

*)
help 1
esac
done

if [ -z "${filebeat_module_reference}" ]; then
filebeat_module_reference=$(cat ${current_path}/../../../VERSION)
fi

build_base || clean 1

clean 0
Expand Down
34 changes: 24 additions & 10 deletions stack/indexer/deb/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ deb_builder_dockerfile="${current_path}/docker"
future="no"
base_cmd=""
build_base="yes"
filebeat_module_reference=""

trap ctrl_c INT

Expand All @@ -40,7 +41,7 @@ build_deb() {

# Copy the necessary files
cp ${current_path}/builder.sh ${dockerfile_path}

if [ "${build_base}" == "yes" ];then
# Base generation
if [ "${future}" == "yes" ];then
Expand All @@ -49,7 +50,7 @@ build_deb() {
if [ "${reference}" ];then
base_cmd+="--reference ${reference}"
fi
../base/generate_base.sh -s ${outdir} -r ${revision} ${base_cmd}
../base/generate_base.sh -s ${outdir} -r ${revision} -f ${filebeat_module_reference} ${base_cmd}
else
if [ "${reference}" ];then
version=$(curl -sL https://raw.githubusercontent.com/wazuh/wazuh-packages/${reference}/VERSION | cat)
Expand Down Expand Up @@ -107,14 +108,15 @@ help() {
echo
echo "Usage: $0 [OPTIONS]"
echo
echo " -a, --architecture <arch> [Optional] Target architecture of the package [amd64]."
echo " -b, --build-base <yes/no> [Optional] Build a new base or use a existing one. By default, yes."
echo " -r, --revision <rev> [Optional] Package revision. By default: 1."
echo " -s, --store <path> [Optional] Set the destination path of package. By default, an output folder will be created."
echo " --reference <ref> [Optional] wazuh-packages branch to download SPECs, not used by default."
echo " --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one."
echo " --future [Optional] Build test future package 99.99.0 Used for development purposes."
echo " -h, --help Show this help."
echo " -a, --architecture <arch> [Optional] Target architecture of the package [amd64]."
echo " -b, --build-base <yes/no> [Optional] Build a new base or use a existing one. By default, yes."
echo " -r, --revision <rev> [Optional] Package revision. By default: 1."
echo " -s, --store <path> [Optional] Set the destination path of package. By default, an output folder will be created."
echo " --reference <ref> [Optional] wazuh-packages branch to download SPECs, not used by default."
echo " -f, --filebeat-module-reference [Optional] wazuh/wazuh Filebeat template branch or tag."
echo " --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one."
echo " --future [Optional] Build test future package 99.99.0 Used for development purposes."
echo " -h, --help Show this help."
echo
exit $1
}
Expand Down Expand Up @@ -159,6 +161,14 @@ main() {
help 1
fi
;;
"-f"|"--filebeat-module-reference")
if [ -n "${2}" ]; then
filebeat_module_reference="${2}"
shift 2
else
help 1
fi
;;
"--dont-build-docker")
build_docker="no"
shift 1
Expand All @@ -180,6 +190,10 @@ main() {
esac
done

if [ -z "${filebeat_module_reference}" ]; then
filebeat_module_reference=$(cat ${current_path}/../../../VERSION)
fi

build || clean 1

clean 0
Expand Down
2 changes: 1 addition & 1 deletion stack/indexer/deb/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wazuh-indexer (4.7.2-RELEASE) stable; urgency=low

* More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html

-- Wazuh, Inc <[email protected]> Sun, 17 Dec 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Tue, 09 Jan 2024 00:00:00 +0000

wazuh-indexer (4.7.1-RELEASE) stable; urgency=low

Expand Down
1 change: 1 addition & 0 deletions stack/indexer/deb/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ override_dh_fixperms:
chmod 660 $(TARGET_DIR)$(CONFIG_DIR)/jvm.options
chmod 750 $(TARGET_DIR)$(INSTALLATION_DIR)/modules/aggs-matrix-stats
chmod 660 $(TARGET_DIR)$(CONFIG_DIR)/opensearch.yml
chmod 660 $(TARGET_DIR)$(CONFIG_DIR)/wazuh-template.json
chmod 640 $(TARGET_DIR)$(CONFIG_DIR)/opensearch-security/roles_mapping.yml
chmod 640 $(TARGET_DIR)$(CONFIG_DIR)/opensearch-security/internal_users.yml
chmod 640 $(TARGET_DIR)$(CONFIG_DIR)/opensearch-security/roles.yml
Expand Down
Loading

0 comments on commit 57fb6c3

Please sign in to comment.