Skip to content

Commit

Permalink
Merge branch '4.4' of https://github.com/wazuh/wazuh-packages into 86…
Browse files Browse the repository at this point in the history
…2-upgrade-installation-assistant
  • Loading branch information
DFolchA committed Nov 30, 2022
2 parents cb3d0b6 + b65f2e1 commit ecad5cb
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 81 deletions.
16 changes: 4 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file.
## [v4.3.10]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.10

## [v4.3.9]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.9

## [v4.5.0]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.5.0

## [v4.4.0]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.4.0

## [v4.3.10]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.10

## [v4.3.9]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.9
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.5.0
4.4.0
2 changes: 1 addition & 1 deletion aix/SPECS/wazuh-agent-aix.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Spec file for AIX systems
Name: wazuh-agent
Version: 4.5.0
Version: 4.4.0
Release: 1
License: GPL
URL: https://www.wazuh.com/
Expand Down
6 changes: 0 additions & 6 deletions debs/SPECS/wazuh-agent/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
wazuh-agent (4.5.0-RELEASE) stable; urgency=low

* More info: https://documentation.wazuh.com/current/release-notes/

-- Wazuh, Inc <[email protected]> Fri, 05 May 2023 11:56:07 +0000

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

* More info: https://documentation.wazuh.com/current/release-notes/
Expand Down
6 changes: 0 additions & 6 deletions debs/SPECS/wazuh-manager/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
wazuh-manager (4.5.0-RELEASE) stable; urgency=low

* More info: https://documentation.wazuh.com/current/release-notes/

-- Wazuh, Inc <[email protected]> Fri, 05 May 2023 11:56:07 +0000

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

* More info: https://documentation.wazuh.com/current/release-notes/
Expand Down
4 changes: 2 additions & 2 deletions debs/SPECS/wazuh-manager/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ case "$1" in
rm -rf ${DIR}/backup/groups

# Generation auto-signed certificate if not exists
if [ ! -f "${DIR}/etc/sslmanager.key" ] && [ ! -f "${DIR}/etc/sslmanager.cert" ]; then
${DIR}/bin/wazuh-authd -C 365 -B 2048 -S "/C=US/ST=California/CN=Wazuh/" -K ${DIR}/etc/sslmanager.key -X ${DIR}/etc/sslmanager.cert 2>/dev/null
if type openssl >/dev/null 2>&1 && [ ! -f "${DIR}/etc/sslmanager.key" ] && [ ! -f "${DIR}/etc/sslmanager.cert" ]; then
openssl req -x509 -batch -nodes -days 365 -newkey rsa:2048 -subj "/C=US/ST=California/CN=Wazuh/" -keyout ${DIR}/etc/sslmanager.key -out ${DIR}/etc/sslmanager.cert 2>/dev/null
fi

chmod 640 ${DIR}/etc/sslmanager.cert ${DIR}/etc/sslmanager.key > /dev/null 2>&1 || true
Expand Down
4 changes: 2 additions & 2 deletions macos/specs/wazuh-agent.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@
<key>USE_HFS+_COMPRESSION</key>
<false/>
<key>VERSION</key>
<string>4.5.0-1</string>
<string>4.4.0-1</string>
</dict>
<key>TYPE</key>
<integer>0</integer>
Expand Down Expand Up @@ -1239,7 +1239,7 @@
</dict>
</array>
<key>NAME</key>
<string>wazuh-agent-4.5.0-1</string>
<string>wazuh-agent-4.4.0-1</string>
<key>PAYLOAD_ONLY</key>
<false/>
<key>TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING</key>
Expand Down
37 changes: 19 additions & 18 deletions rpms/SPECS/wazuh-agent.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: Wazuh helps you to gain security visibility into your infrastructure by monitoring hosts at an operating system and application level. It provides the following capabilities: log analysis, file integrity monitoring, intrusions detection and policy and compliance monitoring
Name: wazuh-agent
Version: 4.5.0
Version: 4.4.0
Release: %{_release}
License: GPL
Group: System Environment/Daemons
Expand Down Expand Up @@ -222,23 +222,6 @@ fi
# If the package is being installed
if [ $1 = 1 ]; then

sles=""
if [ -f /etc/SuSE-release ]; then
sles="suse"
elif [ -f /etc/os-release ]; then
if `grep -q "\"sles" /etc/os-release` ; then
sles="suse"
elif `grep -q -i "\"opensuse" /etc/os-release` ; then
sles="opensuse"
fi
fi

if [ ! -z "$sles" ]; then
if [ -d /etc/init.d ]; then
install -m 755 %{_localstatedir}/packages_files/agent_installation_scripts/src/init/ossec-hids-suse.init /etc/init.d/wazuh-agent
fi
fi

touch %{_localstatedir}/logs/active-responses.log
chown wazuh:wazuh %{_localstatedir}/logs/active-responses.log
chmod 0660 %{_localstatedir}/logs/active-responses.log
Expand All @@ -264,6 +247,24 @@ if [ -f /etc/os-release ]; then
fi
fi

# We create this fix for the operating system that deprecated the SySV. For now, this fix is for suse/openSUSE
sles=""
if [ -f /etc/SuSE-release ]; then
sles="suse"
elif [ -f /etc/os-release ]; then
if `grep -q "\"sles" /etc/os-release` ; then
sles="suse"
elif `grep -q -i "\"opensuse" /etc/os-release` ; then
sles="opensuse"
fi
fi

if [ -n "$sles" ] && [ $(ps --no-headers -o comm 1) == "systemd" ]; then
if [ -f /etc/init.d/wazuh-agent ]; then
rm -f /etc/init.d/wazuh-agent
fi
fi

# Delete the installation files used to configure the agent
rm -rf %{_localstatedir}/packages_files

Expand Down
41 changes: 21 additions & 20 deletions rpms/SPECS/wazuh-manager.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: Wazuh helps you to gain security visibility into your infrastructure by monitoring hosts at an operating system and application level. It provides the following capabilities: log analysis, file integrity monitoring, intrusions detection and policy and compliance monitoring
Name: wazuh-manager
Version: 4.5.0
Version: 4.4.0
Release: %{_release}
License: GPL
Group: System Environment/Daemons
Expand Down Expand Up @@ -295,22 +295,6 @@ fi

# Fresh install code block
if [ $1 = 1 ]; then
sles=""
if [ -f /etc/SuSE-release ]; then
sles="suse"
elif [ -f /etc/os-release ]; then
if `grep -q "\"sles" /etc/os-release` ; then
sles="suse"
elif `grep -q -i "\"opensuse" /etc/os-release` ; then
sles="opensuse"
fi
fi

if [ ! -z "$sles" ]; then
if [ -d /etc/init.d ]; then
install -m 755 %{_localstatedir}/packages_files/manager_installation_scripts/src/init/ossec-hids-suse.init /etc/init.d/wazuh-manager
fi
fi

. %{_localstatedir}/packages_files/manager_installation_scripts/src/init/dist-detect.sh

Expand All @@ -328,6 +312,24 @@ if [ $1 = 1 ]; then
%{_localstatedir}/packages_files/manager_installation_scripts/add_localfiles.sh %{_localstatedir} >> %{_localstatedir}/etc/ossec.conf
fi

# We create this fix for the operating system that decraped the SySV. For now, this fix is for suse/openSUSE
sles=""
if [ -f /etc/SuSE-release ]; then
sles="suse"
elif [ -f /etc/os-release ]; then
if `grep -q "\"sles" /etc/os-release` ; then
sles="suse"
elif `grep -q -i "\"opensuse" /etc/os-release` ; then
sles="opensuse"
fi
fi

if [ -n "$sles" ] && [ $(ps --no-headers -o comm 1) == "systemd" ]; then
if [ -f /etc/init.d/wazuh-manager ]; then
rm -f /etc/init.d/wazuh-manager
fi
fi

if [ -f /etc/os-release ]; then
source /etc/os-release
if [ "${NAME}" = "Red Hat Enterprise Linux" ] && [ "$((${VERSION_ID:0:1}))" -ge 9 ]; then
Expand All @@ -336,8 +338,8 @@ if [ -f /etc/os-release ]; then
fi

# Generation auto-signed certificate if not exists
if [ ! -f "%{_localstatedir}/etc/sslmanager.key" ] && [ ! -f "%{_localstatedir}/etc/sslmanager.cert" ]; then
%{_localstatedir}/bin/wazuh-authd -C 365 -B 2048 -S "/C=US/ST=California/CN=Wazuh/" -K %{_localstatedir}/etc/sslmanager.key -X %{_localstatedir}/etc/sslmanager.cert 2>/dev/null
if type openssl >/dev/null 2>&1 && [ ! -f "%{_localstatedir}/etc/sslmanager.key" ] && [ ! -f "%{_localstatedir}/etc/sslmanager.cert" ]; then
openssl req -x509 -batch -nodes -days 365 -newkey rsa:2048 -subj "/C=US/ST=California/CN=Wazuh/" -keyout %{_localstatedir}/etc/sslmanager.key -out %{_localstatedir}/etc/sslmanager.cert 2>/dev/null
chmod 640 %{_localstatedir}/etc/sslmanager.key
chmod 640 %{_localstatedir}/etc/sslmanager.cert
fi
Expand Down Expand Up @@ -537,7 +539,6 @@ fi

# posttrans code is the last thing executed in a install/upgrade
%posttrans

if [ -f %{_sysconfdir}/systemd/system/wazuh-manager.service ]; then
rm -rf %{_sysconfdir}/systemd/system/wazuh-manager.service
systemctl daemon-reload > /dev/null 2>&1
Expand Down
4 changes: 2 additions & 2 deletions solaris/solaris10/postremove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# postremove script for wazuh-agent
# Wazuh, Inc 2015

if getent passwd wazuh; then
if getent passwd wazuh > /dev/null 2>&1; then
userdel wazuh
fi

if getent group wazuh; then
if getent group wazuh > /dev/null 2>&1; then
groupdel wazuh
fi
8 changes: 4 additions & 4 deletions solaris/solaris10/preinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ if [ ! -f ${OSMYSHELL} ]; then
fi
fi

getent group | grep "^wazuh"
if [ "$?" -eq 1 ]; then
getent group wazuh > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
groupadd ${GROUP}
fi

getent passwd wazuh
if [ "$?" -eq 1 ]; then
getent passwd wazuh > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
useradd -d ${DIR} -s ${OSMYSHELL} -g ${GROUP} ${USER} > /dev/null 2>&1
fi

Expand Down
4 changes: 2 additions & 2 deletions tests/unattended/install/test_unattended.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def test_check_log_errors():
for line in f.readlines():
if 'ERROR' in line:
found_error = True
if get_wazuh_version() == 'v4.5.0':
if get_wazuh_version() == 'v4.4.0':
if 'ERROR: Cluster error detected' in line or 'agent-upgrade: ERROR: (8123): There has been an error executing the request in the tasks manager.' in line:
found_error = False
else:
Expand All @@ -236,7 +236,7 @@ def test_check_cluster_log_errors():
for line in f.readlines():
if 'ERROR' in line:
found_error = True
if get_wazuh_version() == 'v4.5.0':
if get_wazuh_version() == 'v4.4.0':
if 'Could not connect to master' in line or 'Worker node is not connected to master' in line or 'Connection reset by peer' in line:
found_error = False
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/unattended/unit/suites/test-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test-04-common_checkInstalled-all-installed-yum() {

@mocktrue yum list installed

@mock grep wazuh-manager === @echo wazuh-manager.x86_64 4.5.0-1 @wazuh
@mock grep wazuh-manager === @echo wazuh-manager.x86_64 4.4.0-1 @wazuh
@mkdir /var/ossec

@mock grep wazuh-indexer === @echo wazuh-indexer.x86_64 1.13.2-1 @wazuh
Expand Down Expand Up @@ -105,7 +105,7 @@ test-04-common_checkInstalled-all-installed-yum() {
}

test-05-common_checkInstalled-all-installed-yum-assert() {
@echo "wazuh-manager.x86_64 4.5.0-1 @wazuh"
@echo "wazuh-manager.x86_64 4.4.0-1 @wazuh"
@echo 1

@echo "wazuh-indexer.x86_64 1.13.2-1 @wazuh"
Expand Down
2 changes: 1 addition & 1 deletion tests/unattended/unit/suites/test-dashboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source "${base_dir}"/bach.sh
@setup-test {
@ignore common_logger
k_certs_path="/etc/wazuh-dashboard/certs/"
wazuh_version="4.5.0"
wazuh_version="4.4.0"
elasticsearch_oss_version="7.10.2"
wazuh_kibana_plugin_revision="1"
repobaseurl="https://packages.wazuh.com/4.x"
Expand Down
4 changes: 2 additions & 2 deletions unattended_installer/install_functions/installVariables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Foundation.

## Package vars
readonly wazuh_major="4.5"
readonly wazuh_version="4.5.0"
readonly wazuh_major="4.4"
readonly wazuh_version="4.4.0"
readonly filebeat_version="7.10.2"
readonly wazuh_install_vesion="0.1"

Expand Down

0 comments on commit ecad5cb

Please sign in to comment.