Skip to content

Commit

Permalink
Merge pull request #2580 from wazuh/merge-4.7.1-into-4.8.0
Browse files Browse the repository at this point in the history
Merge 4.7.1 into 4.8.0
  • Loading branch information
TomasTurina authored Nov 3, 2023
2 parents fc8ff97 + 7c07f31 commit b243c6f
Show file tree
Hide file tree
Showing 21 changed files with 148 additions and 73 deletions.
4 changes: 2 additions & 2 deletions aix/SPECS/wazuh-agent-aix.spec
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ rm -fr %{buildroot}
%changelog
* Fri Dec 15 2023 support <[email protected]> - 4.8.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html
* Tue Nov 14 2023 support <[email protected]> - 4.7.1
* Thu Dec 07 2023 support <[email protected]> - 4.7.1
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html
* Wed Nov 08 2023 support <[email protected]> - 4.7.0
* Tue Nov 21 2023 support <[email protected]> - 4.7.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-0.html
* Tue Oct 24 2023 support <[email protected]> - 4.6.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-6-0.html
Expand Down
2 changes: 1 addition & 1 deletion alpine/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ help() {
echo -e " [Optional] Use the SPECS files stored in the host instead of downloading them from GitHub."
echo -e ""
echo -e " --future"
echo -e " [Optional] Build test future package 99.99.0 Used for development purposes."
echo -e " [Optional] Build test future package {MAJOR}.30.0 Used for development purposes."
echo -e ""
echo -e " -h, --help"
echo -e " Show this help."
Expand Down
7 changes: 6 additions & 1 deletion alpine/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ fi
export version="$(cat wazuh*/src/VERSION | cut -d 'v' -f 2)"

if [ "${future}" = "yes" ]; then
export version="99.99.0"
old_version=$version
MAJOR=$(echo $version | cut -dv -f2 | cut -d. -f1)
export version="${MAJOR}.30.0"
sed -i "s/${old_version}/${version}/g" "/wazuh"*"/src/init/wazuh-server.sh"
sed -i "s/${old_version}/${version}/g" "/wazuh"*"/src/init/wazuh-client.sh"
sed -i "s/${old_version}/${version}/g" "/wazuh"*"/src/init/wazuh-local.sh"
fi


Expand Down
5 changes: 4 additions & 1 deletion arch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if [[ "${future}" == "yes" ]]; then
base_version=${wazuh_version}
MAJOR=$(echo ${base_version} | cut -dv -f2 | cut -d. -f1)
MINOR=$(echo ${base_version} | cut -d. -f2)
wazuh_version="99.99.0"
wazuh_version="${MAJOR}.30.0"
package_full_name=wazuh-${build_target}-${wazuh_version}

# PREPARE FUTURE SPECS AND SOURCES
Expand All @@ -70,6 +70,9 @@ if [[ "${future}" == "yes" ]]; then
sources_dir="${tmp_sources_dir}"
find "${sources_dir}" "${specs_path}" \( -name "*VERSION*" -o -name "*changelog*" \) -exec sed -i "s/${base_version}/${wazuh_version}/g" {} \;
sed -i "s/\$(VERSION)/${MAJOR}.${MINOR}/g" "${sources_dir}/src/Makefile"
sed -i "s/${base_version}/${wazuh_version}/g" "${sources_dir}/src/init/wazuh-server.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${sources_dir}/src/init/wazuh-client.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${sources_dir}/src/init/wazuh-local.sh"
fi

cd ${sources_dir} && tar -czf ${pacman_dir}/${package_full_name}.tar.gz .
Expand Down
2 changes: 1 addition & 1 deletion arch/generate_arch_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ help() {
echo " --sources <path> [Optional] Absolute path containing wazuh source code. This option will use local source code instead of downloading it from GitHub."
echo " --packages-branch <branch> [Required] Select Git branch or tag from wazuh-packages repository. e.g ${PACKAGES_BRANCH}"
echo " --dev [Optional] Use the SPECS files stored in the host instead of downloading them from GitHub."
echo " --future [Optional] Build test future package 99.99.0 Used for development purposes."
echo " --future [Optional] Build test future package {MAJOR}.30.0 Used for development purposes."
echo " -h, --help Show this help."
echo
exit $1
Expand Down
4 changes: 2 additions & 2 deletions debs/SPECS/wazuh-agent/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ wazuh-agent (4.7.1-RELEASE) stable; urgency=low

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

-- Wazuh, Inc <[email protected]> Tue, 14 Nov 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Thu, 07 Dec 2023 00:00:00 +0000

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

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

-- Wazuh, Inc <[email protected]> Wed, 08 Nov 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Tue, 21 Nov 2023 00:00:00 +0000

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

Expand Down
4 changes: 2 additions & 2 deletions debs/SPECS/wazuh-manager/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ wazuh-manager (4.7.1-RELEASE) stable; urgency=low

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

-- Wazuh, Inc <[email protected]> Tue, 14 Nov 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Thu, 07 Dec 2023 00:00:00 +0000

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

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

-- Wazuh, Inc <[email protected]> Wed, 08 Nov 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Tue, 21 Nov 2023 00:00:00 +0000

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

Expand Down
4 changes: 3 additions & 1 deletion debs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ if [[ "${future}" == "yes" ]]; then
# PREPARE FUTURE SPECS AND SOURCES
find "${build_dir}/${package_name}" "${specs_path}" \( -name "*VERSION*" -o -name "*changelog*" \) -exec sed -i "s/${base_version}/${wazuh_version}/g" {} \;
sed -i "s/\$(VERSION)/${MAJOR}.${MINOR}/g" "${build_dir}/${build_target}/${package_full_name}/src/Makefile"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${build_target}/${package_full_name}/src/init/wazuh-server.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${build_target}/${package_full_name}/src/init/wazuh-client.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${build_target}/${package_full_name}/src/init/wazuh-local.sh"
fi
cp -pr ${specs_path}/wazuh-${build_target}/debian ${sources_dir}/debian
cp -p ${package_files}/gen_permissions.sh ${sources_dir}
Expand Down Expand Up @@ -125,4 +128,3 @@ if [[ "${checksum}" == "yes" ]]; then
cd ${pkg_path} && sha512sum ${deb_file} > /var/local/checksum/${deb_file}.sha512
fi
mv ${pkg_path}/${deb_file} /var/local/wazuh

84 changes: 46 additions & 38 deletions macos/generate_wazuh_packages.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -x
# Program to build and package OSX wazuh-agent
# Wazuh package generator
# Copyright (C) 2015, Wazuh Inc.
Expand Down Expand Up @@ -31,7 +32,9 @@ KC_PASS="" # Password of the keychain.
NOTARIZE="no" # Notarize the package for macOS Catalina.
DEVELOPER_ID="" # Apple Developer ID.
ALTOOL_PASS="" # Temporary Application password for altool.
TEAM_ID="" # Team ID of the Apple Developer ID.
pkg_name=""
notarization_path=""

trap ctrl_c INT

Expand All @@ -54,44 +57,20 @@ function notarize_pkg() {
sleep_time="120"
build_timestamp="$(date +"%m%d%Y%H%M%S")"
if [ "${NOTARIZE}" = "yes" ]; then
if sudo xcrun altool --notarize-app --primary-bundle-id "com.wazuh.agent.${VERSION}.${REVISION}.${build_timestamp}" \
--username "${DEVELOPER_ID}" --password "${ALTOOL_PASS}" --file ${DESTINATION}/${pkg_name} > request_info.txt ; then
echo "The package ${DESTINATION}/${pkg_name} was successfully upload for notarization."
echo "Waiting ${sleep_time}s to get the results"
sleep ${sleep_time}

uuid="$(grep -i requestuuid request_info.txt | cut -d' ' -f 3)"

# Check notarization status
xcrun altool --notarization-info ${uuid} -u "${DEVELOPER_ID}" --password "${ALTOOL_PASS}" > request_result.txt
until ! grep -qi "in progress" request_result.txt ; do
echo "Package is not notarized yet. Waiting ${sleep_time}s"
sleep ${sleep_time}
xcrun altool --notarization-info ${uuid} -u "${DEVELOPER_ID}" --password "${ALTOOL_PASS}" > request_result.txt
done

echo "Notarization ticket:"
cat request_result.txt

if grep "Status: success" request_result.txt > /dev/null 2>&1 ; then
echo "Package is notarized and ready to go."
echo "Adding the ticket to the package."
if xcrun stapler staple -v ${DESTINATION}/${pkg_name} ; then
echo "Ticket added. Ready to release the package."
return 0
else
echo "Something went wrong while adding the package."
clean_and_exit 1
fi

if sudo xcrun notarytool submit ${1} --apple-id "${DEVELOPER_ID}" --team-id "${TEAM_ID}" --password "${ALTOOL_PASS}" --wait ; then
echo "Package is notarized and ready to go."
echo "Adding the ticket to the package."
if xcrun stapler staple -v "${1}" ; then
echo "Ticket added. Ready to release the package."
mkdir -p "${DESTINATION}" && cp "${1}" "${DESTINATION}/"
return 0
else

echo "The package couldn't be notarized."
echo "Check notarization ticket for more info."
echo "Something went wrong while adding the package."
clean_and_exit 1
fi

else
echo "Error while uploading the app to be notarized."
echo "Error notarizing the package."
clean_and_exit 1
fi
fi
Expand Down Expand Up @@ -153,7 +132,6 @@ function build_package() {
echo "The wazuh agent package for macOS has been successfully built."
pkg_name="wazuh-agent-${VERSION}-${REVISION}.${ARCH}.pkg"
sign_pkg
notarize_pkg
if [[ "${CHECKSUM}" == "yes" ]]; then
mkdir -p ${CHECKSUMDIR}
cd ${DESTINATION} && shasum -a512 "${pkg_name}" > "${CHECKSUMDIR}/${pkg_name}.sha512"
Expand Down Expand Up @@ -186,8 +164,10 @@ function help() {
echo " --keychain-password [Optional] Password of the keychain."
echo " --application-certificate [Optional] Apple Developer ID certificate name to sign Apps and binaries."
echo " --installer-certificate [Optional] Apple Developer ID certificate name to sign pkg."
echo " --notarize [Optional] Notarize the package for its distribution on macOS Catalina ."
echo " --notarize [Optional] Notarize the package for its distribution on macOS."
echo " --notarize-path <path> [Optional] Path of the package to be notarized."
echo " --developer-id [Optional] Your Apple Developer ID."
echo " --team-id [Optional] Your Apple Team ID."
echo " --altool-password [Optional] Temporary password to use altool from Xcode."
echo
exit "$1"
Expand Down Expand Up @@ -368,6 +348,14 @@ function main() {
NOTARIZE="yes"
shift 1
;;
"--notarize-path")
if [ -n "$2" ]; then
notarization_path="$2"
shift 2
else
help 1
fi
;;
"--developer-id")
if [ -n "$2" ]; then
DEVELOPER_ID="$2"
Expand All @@ -376,6 +364,14 @@ function main() {
help 1
fi
;;
"--team-id")
if [ -n "$2" ]; then
TEAM_ID="$2"
shift 2
else
help 1
fi
;;
"--altool-password")
if [ -n "$2" ]; then
ALTOOL_PASS="$2"
Expand Down Expand Up @@ -410,8 +406,20 @@ function main() {
AGENT_PKG_FILE="${CURRENT_PATH}/package_files/wazuh-agent-${ARCH}.pkgproj"
build_package
"${CURRENT_PATH}/uninstall.sh"
else
echo "The branch has not been specified. No package will be generated."
fi
if [ "${NOTARIZE}" = "yes" ]; then
if [ "${BUILD}" = "yes" ]; then
pkg_name="wazuh-agent-${VERSION}-${REVISION}.${ARCH}.pkg"
notarization_path="${DESTINATION}/${pkg_name}"
fi
if [ -z "${notarization_path}" ]; then
echo "The path of the package to be notarized has not been specified."
help 1
fi
notarize_pkg "${notarization_path}"
fi
if [ "${BUILD}" = "no" ] && [ "${NOTARIZE}" = "no" ]; then
echo "The branch has not been specified and notarization has not been selected."
help 1
fi

Expand Down
4 changes: 2 additions & 2 deletions rpms/SPECS/wazuh-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,9 @@ rm -fr %{buildroot}
%changelog
* Fri Dec 15 2023 support <[email protected]> - 4.8.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html
* Tue Nov 14 2023 support <[email protected]> - 4.7.1
* Thu Dec 07 2023 support <[email protected]> - 4.7.1
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html
* Wed Nov 08 2023 support <[email protected]> - 4.7.0
* Tue Nov 21 2023 support <[email protected]> - 4.7.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-0.html
* Tue Oct 24 2023 support <[email protected]> - 4.6.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-6-0.html
Expand Down
4 changes: 2 additions & 2 deletions rpms/SPECS/wazuh-manager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -850,9 +850,9 @@ rm -fr %{buildroot}
%changelog
* Fri Dec 15 2023 support <[email protected]> - 4.8.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html
* Tue Nov 14 2023 support <[email protected]> - 4.7.1
* Thu Dec 07 2023 support <[email protected]> - 4.7.1
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html
* Wed Nov 08 2023 support <[email protected]> - 4.7.0
* Tue Nov 21 2023 support <[email protected]> - 4.7.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-0.html
* Tue Oct 24 2023 support <[email protected]> - 4.6.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-6-0.html
Expand Down
7 changes: 4 additions & 3 deletions rpms/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ else
specs_path="/specs"
fi

if [[ "${future}" == "yes" ]]; then
if [[ "${future}" == "yes" ]]; then
# MODIFY VARIABLES
base_version=$wazuh_version
MAJOR=$(echo $base_version | cut -dv -f2 | cut -d. -f1)
Expand All @@ -88,7 +88,9 @@ if [[ "${future}" == "yes" ]]; then
mv "${build_dir}/${old_package_name}" "${build_dir}/${package_name}"
find "${build_dir}/${package_name}" "${specs_path}/" \( -name "*VERSION*" -o -name "*.spec" \) -exec sed -i "s/${base_version}/${wazuh_version}/g" {} \;
sed -i "s/\$(VERSION)/${MAJOR}.${MINOR}/g" "${build_dir}/${package_name}/src/Makefile"

sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${package_name}/src/init/wazuh-server.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${package_name}/src/init/wazuh-client.sh"
sed -i "s/${base_version}/${wazuh_version}/g" "${build_dir}/${package_name}/src/init/wazuh-local.sh"
fi

cp ${specs_path}/wazuh-${build_target}.spec ${rpm_build_dir}/SPECS/${package_name}.spec
Expand Down Expand Up @@ -129,4 +131,3 @@ if [[ "${src}" == "yes" ]]; then
fi

find ${extract_path} -maxdepth 3 -type f -name "${file_name}*" -exec mv {} /var/local/wazuh \;

4 changes: 2 additions & 2 deletions stack/dashboard/deb/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ wazuh-dashboard (4.7.1-RELEASE) stable; urgency=low

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

-- Wazuh, Inc <[email protected]> Tue, 14 Nov 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Thu, 07 Dec 2023 00:00:00 +0000

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

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

-- Wazuh, Inc <[email protected]> Wed, 08 Nov 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Tue, 21 Nov 2023 00:00:00 +0000

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

Expand Down
4 changes: 2 additions & 2 deletions stack/dashboard/rpm/wazuh-dashboard.spec
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ rm -fr %{buildroot}
%changelog
* Fri Dec 15 2023 support <[email protected]> - 4.8.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html
* Tue Nov 14 2023 support <[email protected]> - 4.7.1
* Thu Dec 07 2023 support <[email protected]> - 4.7.1
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html
* Wed Nov 08 2023 support <[email protected]> - 4.7.0
* Tue Nov 21 2023 support <[email protected]> - 4.7.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-0.html
* Tue Oct 24 2023 support <[email protected]> - 4.6.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-6-0.html
Expand Down
4 changes: 2 additions & 2 deletions stack/indexer/deb/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ wazuh-indexer (4.7.1-RELEASE) stable; urgency=low

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

-- Wazuh, Inc <[email protected]> Tue, 14 Nov 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Thu, 07 Dec 2023 00:00:00 +0000

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

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

-- Wazuh, Inc <[email protected]> Wed, 08 Nov 2023 00:00:00 +0000
-- Wazuh, Inc <[email protected]> Tue, 21 Nov 2023 00:00:00 +0000

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

Expand Down
4 changes: 2 additions & 2 deletions stack/indexer/rpm/wazuh-indexer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -692,9 +692,9 @@ rm -fr %{buildroot}
%changelog
* Fri Dec 15 2023 support <[email protected]> - 4.8.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html
* Tue Nov 14 2023 support <[email protected]> - 4.7.1
* Thu Dec 07 2023 support <[email protected]> - 4.7.1
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html
* Wed Nov 08 2023 support <[email protected]> - 4.7.0
* Tue Nov 21 2023 support <[email protected]> - 4.7.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-0.html
* Tue Oct 24 2023 support <[email protected]> - 4.6.0
- More info: https://documentation.wazuh.com/current/release-notes/release-4-6-0.html
Expand Down
Loading

0 comments on commit b243c6f

Please sign in to comment.