Skip to content

Commit

Permalink
Merge branch '4.8.0' into merge-4.8.0-into-master
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasTurina committed Nov 3, 2023
2 parents 43039b5 + b243c6f commit 240e514
Show file tree
Hide file tree
Showing 34 changed files with 453 additions and 1,039 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/password-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
name: scripts
- name: Install wazuh
run: |
sudo bash wazuh-install.sh -a
sudo bash wazuh-install.sh -a -v
- name: Uncompress wazuh install files
run: sudo tar -xvf wazuh-install-files.tar
- name: Run script
Expand All @@ -49,7 +49,7 @@ jobs:
name: scripts
- name: Install wazuh
run: |
sudo bash wazuh-install.sh -a
sudo bash wazuh-install.sh -a -v
- name: Uncompress wazuh install files
run: sudo tar -xvf wazuh-install-files.tar
- name: Run script
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ ova/Config_files/filebeat.yml
.java
stack/dashboard/base/output
stack/indexer/base/output
stack/indexer/rpm/output
stack/indexer/deb/output
.cache
.m2
wpk/versions
solaris/packer/builds/
solaris/packer/packer-solaris11_3-virtualbox/
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ The following table shows the references for the versions of each component.
| 4.3.x | 1.2.4 |
| 4.4.0 | 2.4.1 |
| 4.4.1 - 4.5.x | 2.6.0 |
| 4.6.0 - current | 2.8.0 |
| 4.6.x - 4.7.x | 2.8.0 |
| 4.8.x - current | 2.10.0 |

## Contribute

Expand Down
4 changes: 2 additions & 2 deletions aix/SPECS/wazuh-agent-aix.spec
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ rm -fr %{buildroot}
- More info: https://documentation.wazuh.com/current/release-notes/release-4-9-0.html
* 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 @@ -14,13 +14,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 @@ -14,13 +14,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
2 changes: 2 additions & 0 deletions debs/SPECS/wazuh-manager/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ override_dh_install:
mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/generic
mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/amzn/1
mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/amzn/2
mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/amzn/2023
mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/centos/5
mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/centos/6
mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/centos/7
Expand Down Expand Up @@ -162,6 +163,7 @@ override_dh_install:

cp etc/templates/config/amzn/1/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/amzn/1
cp etc/templates/config/amzn/2/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/amzn/2
cp etc/templates/config/amzn/2023/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/amzn/2023

cp etc/templates/config/darwin/15/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/darwin/15
cp etc/templates/config/darwin/16/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/darwin/16
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
11 changes: 7 additions & 4 deletions rpms/SPECS/wazuh-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ rm -f ${RPM_BUILD_ROOT}%{_localstatedir}/ruleset/sca/*

# Install configuration assesment files and files templates
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/{generic}
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/{1,2}
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/{1,2,2023}
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/{8,7,6,5}
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/{9,8,7,6,5}
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/{11,12,15}
Expand All @@ -117,6 +117,7 @@ cp etc/templates/config/generic/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp

cp etc/templates/config/amzn/1/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/1
cp etc/templates/config/amzn/2/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2
cp etc/templates/config/amzn/2023/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2023

cp etc/templates/config/centos/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos
cp etc/templates/config/centos/8/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/8
Expand Down Expand Up @@ -306,7 +307,7 @@ elif [ -r "/etc/os-release" ]; then
if [ "X$DIST_VER" = "X" ]; then
DIST_VER="0"
fi
if [ "$DIST_NAME" = "amzn" ] && [ "$DIST_VER" != "2" ]; then
if [ "$DIST_NAME" = "amzn" ] && [ "$DIST_VER" != "2" ] && [ "$DIST_VER" != "2023" ]; then
DIST_VER="1"
fi
DIST_SUBVER=$(echo $VERSION_ID | sed -rn 's/[^0-9]*[0-9]+\.([0-9]+).*/\1/p')
Expand Down Expand Up @@ -561,6 +562,8 @@ rm -fr %{buildroot}
%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/1/*
%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2
%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2/*
%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2023
%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2023/*
%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos
%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/sca.files
%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/5
Expand Down Expand Up @@ -626,9 +629,9 @@ rm -fr %{buildroot}
- More info: https://documentation.wazuh.com/current/release-notes/release-4-9-0.html
* 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 240e514

Please sign in to comment.