Skip to content

Commit

Permalink
Merge branch '4.3' into 1666-remove-config
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelfdez99 committed Jul 1, 2022
2 parents bd3983d + 67b69df commit 8d20d96
Show file tree
Hide file tree
Showing 20 changed files with 71 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ unattended_installer/wazuh-install-files*
unattended_installer/wazuh-install.sh
unattended_installer/wazuh-certs-tool.sh
unattended_installer/wazuh-passwords-tool.sh
unattended_installer/passwords.wazuh
unattended_installer/wazuh-passwords.txt
tests/unattended/unit/*.log
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

## [v4.3.6]

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

## [v4.3.5]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.5
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.5
4.3.6
4 changes: 3 additions & 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.3.5
Version: 4.3.6
Release: 1
License: GPL
URL: https://www.wazuh.com/
Expand Down Expand Up @@ -290,6 +290,8 @@ rm -fr %{buildroot}
%attr(750, root, wazuh) %{_localstatedir}/wodles/*

%changelog
* Thu Jul 07 2022 support <[email protected]> - 4.3.6
- More info: https://documentation.wazuh.com/current/release-notes/
* Wed Jun 29 2022 support <[email protected]> - 4.3.5
- More info: https://documentation.wazuh.com/current/release-notes/
* Tue Jun 07 2022 support <[email protected]> - 4.3.4
Expand Down
6 changes: 6 additions & 0 deletions debs/SPECS/wazuh-agent/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wazuh-agent (4.3.6-RELEASE) stable; urgency=low

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

-- Wazuh, Inc <[email protected]> Thu, 07 Jul 2022 15:00:00 +0000

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

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

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

-- Wazuh, Inc <[email protected]> Thu, 07 Jul 2022 15:00:00 +0000

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

* More info: https://documentation.wazuh.com/current/release-notes/
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.3.5-1</string>
<string>4.3.6-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.3.5-1</string>
<string>wazuh-agent-4.3.6-1</string>
<key>PAYLOAD_ONLY</key>
<false/>
<key>TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING</key>
Expand Down
4 changes: 3 additions & 1 deletion 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.3.5
Version: 4.3.6
Release: %{_release}
License: GPL
Group: System Environment/Daemons
Expand Down Expand Up @@ -612,6 +612,8 @@ rm -fr %{buildroot}


%changelog
* Thu Jul 07 2022 support <[email protected]> - 4.3.6
- More info: https://documentation.wazuh.com/current/release-notes/
* Wed Jun 29 2022 support <[email protected]> - 4.3.5
- More info: https://documentation.wazuh.com/current/release-notes/
* Tue Jun 07 2022 support <[email protected]> - 4.3.4
Expand Down
4 changes: 3 additions & 1 deletion 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.3.5
Version: 4.3.6
Release: %{_release}
License: GPL
Group: System Environment/Daemons
Expand Down Expand Up @@ -826,6 +826,8 @@ rm -fr %{buildroot}


%changelog
* Thu Jul 07 2022 support <[email protected]> - 4.3.6
- More info: https://documentation.wazuh.com/current/release-notes/
* Wed Jun 29 2022 support <[email protected]> - 4.3.5
- More info: https://documentation.wazuh.com/current/release-notes/
* Tue Jun 07 2022 support <[email protected]> - 4.3.4
Expand Down
6 changes: 5 additions & 1 deletion stack/dashboard/deb/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ override_dh_install:
chown $(USER):$(GROUP) $(TARGET_DIR)/etc/systemd/system/$(NAME)
chown $(USER):$(GROUP) $(TARGET_DIR)/etc/default/$(NAME)

runuser $(USER) --shell="/bin/bash" --command="$(TARGET_DIR)$(INSTALLATION_DIR)/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-$(BASE_VERSION)-${BASE_REVISION}.zip"
if [ "$(BASE_VERSION)" = "99.99.0" ]; then \
runuser $(USER) --shell="/bin/bash" --command="$(TARGET_DIR)$(INSTALLATION_DIR)/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/futures/ui/dashboard/wazuh-99.99.0-1.zip" ;\
else \
runuser $(USER) --shell="/bin/bash" --command="$(TARGET_DIR)$(INSTALLATION_DIR)/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-$(BASE_VERSION)-${BASE_REVISION}.zip" ;\
fi

find $(TARGET_DIR)$(INSTALLATION_DIR)/plugins/wazuh/ -exec chown $(USER):$(GROUP) {} \;

Expand Down
6 changes: 5 additions & 1 deletion stack/dashboard/rpm/wazuh-dashboard.spec
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ find %{buildroot}%{CONFIG_DIR} -exec chown %{USER}:%{GROUP} {} \;
chown %{USER}:%{GROUP} %{buildroot}/etc/systemd/system/wazuh-dashboard.service
chown %{USER}:%{GROUP} %{buildroot}/etc/init.d/wazuh-dashboard

runuser %{USER} --shell="/bin/bash" --command="%{buildroot}%{INSTALL_DIR}/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-%{version}-%{release}.zip"
if [ "%{version}" = "99.99.0" ];then
runuser %{USER} --shell="/bin/bash" --command="%{buildroot}%{INSTALL_DIR}/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/futures/ui/dashboard/wazuh-99.99.0-1.zip"
else
runuser %{USER} --shell="/bin/bash" --command="%{buildroot}%{INSTALL_DIR}/bin/opensearch-dashboards-plugin install https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-%{version}-%{release}.zip"
fi

find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -exec chown %{USER}:%{GROUP} {} \;
find %{buildroot}%{INSTALL_DIR}/plugins/wazuh/ -type f -perm 644 -exec chmod 640 {} \;
Expand Down
5 changes: 5 additions & 0 deletions stack/indexer/deb/debian/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ if [ "$REMOVE_DIRS" = "true" ]; then
if [ -d "${LOG_DIR}" ]; then
rmdir --ignore-fail-on-non-empty "${LOG_DIR}"
fi

# Delete performanceanalyzer directory
if [ -d "/dev/shm/performanceanalyzer" ]; then
rm -rf "/dev/shm/performanceanalyzer" > /dev/null 2>&1
fi
fi


Expand Down
3 changes: 3 additions & 0 deletions stack/indexer/rpm/wazuh-indexer.spec
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ if [ $1 = 0 ];then
fi

# Remove lingering folders and files
if [ -d /dev/shm/performanceanalyzer ]; then
rm -rf /dev/shm/performanceanalyzer
fi
rm -rf %{INSTALL_DIR}
fi

Expand Down
8 changes: 4 additions & 4 deletions tests/unattended/install/test_unattended.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def get_password(username):
tmp_yaml=""

with tarfile.open("../../../unattended_installer/wazuh-install-files.tar") as configurations:
configurations.extract("wazuh-install-files/passwords.wazuh")
configurations.extract("wazuh-install-files/wazuh-passwords.txt")

with open("wazuh-install-files/passwords.wazuh", 'r') as pass_file:
with open("wazuh-install-files/wazuh-passwords.txt", 'r') as pass_file:
while pass_dict["username"] != username:
for i in range(4):
tmp_yaml+=pass_file.readline()
Expand Down Expand Up @@ -196,7 +196,7 @@ def test_check_log_errors():
for line in f.readlines():
if 'ERROR' in line:
found_error = True
if get_wazuh_version() == 'v4.3.5':
if get_wazuh_version() == 'v4.3.6':
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 @@ -220,7 +220,7 @@ def test_check_cluster_log_errors():
for line in f.readlines():
if 'ERROR' in line:
found_error = True
if get_wazuh_version() == 'v4.3.5':
if get_wazuh_version() == 'v4.3.6':
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
8 changes: 4 additions & 4 deletions tests/unattended/unit/suites/test-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test-05-common_checkInstalled-all-installed-yum() {

@mocktrue yum list installed

@mock grep wazuh-manager === @echo wazuh-manager.x86_64 4.3.5-1 @wazuh
@mock grep wazuh-manager === @echo wazuh-manager.x86_64 4.3.6-1 @wazuh
@mkdir /var/ossec

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

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

@echo "wazuh-indexer.x86_64 1.13.2-1 @wazuh"
Expand All @@ -144,7 +144,7 @@ test-06-common_checkInstalled-all-installed-zypper() {
@mocktrue zypper packages
@mock grep i+

@mock grep wazuh-manager === @echo "i+ | EL-20211102 - Wazuh | wazuh-manager | 4.3.5-1 | x86_64"
@mock grep wazuh-manager === @echo "i+ | EL-20211102 - Wazuh | wazuh-manager | 4.3.6-1 | x86_64"
@mkdir /var/ossec

@mock grep wazuh-indexer === @echo "i+ | EL-20211102 - Wazuh | wazuh-indexer | 1.13.2-1 | x86_64"
Expand Down Expand Up @@ -189,7 +189,7 @@ test-06-common_checkInstalled-all-installed-zypper() {
}

test-06-common_checkInstalled-all-installed-zypper-assert() {
@echo "i+ | EL-20211102 - Wazuh | wazuh-manager | 4.3.5-1 | x86_64"
@echo "i+ | EL-20211102 - Wazuh | wazuh-manager | 4.3.6-1 | x86_64"
@echo 1

@echo "i+ | EL-20211102 - Wazuh | wazuh-indexer | 1.13.2-1 | x86_64"
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.3.5"
wazuh_version="4.3.6"
elasticsearch_oss_version="7.10.2"
wazuh_kibana_plugin_revision="1"
repobaseurl="https://packages.wazuh.com/4.x"
Expand Down
18 changes: 9 additions & 9 deletions tests/unattended/unit/suites/test-installCommon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -957,17 +957,17 @@ test-48-installCommon_changePasswords-with-tarfile() {
tar_file=tarfile.tar
base_path=/tmp
@touch $tar_file
@mock tar -xf tarfile.tar -C /tmp wazuh-install-files/passwords.wazuh === @touch /tmp/passwords.wazuh
@mock tar -xf tarfile.tar -C /tmp wazuh-install-files/wazuh-passwords.txt === @touch /tmp/wazuh-passwords.txt
installCommon_changePasswords
@echo $changeall
@rm /tmp/passwords.wazuh
@rm /tmp/wazuh-passwords.txt
}

test-48-installCommon_changePasswords-with-tarfile-assert() {
common_checkInstalled
installCommon_readPasswordFileUsers
passwords_changePassword
rm -rf /tmp/passwords.wazuh
rm -rf /tmp/wazuh-passwords.txt
@echo
}

Expand All @@ -977,10 +977,10 @@ test-49-installCommon_changePasswords-with-tarfile-aio() {
base_path=/tmp
AIO=1
@touch $tar_file
@mock tar -xf tarfile.tar -C /tmp wazuh-install-files/passwords.wazuh === @touch /tmp/passwords.wazuh
@mock tar -xf tarfile.tar -C /tmp wazuh-install-files/wazuh-passwords.txt === @touch /tmp/wazuh-passwords.txt
installCommon_changePasswords
@echo $changeall
@rm /tmp/passwords.wazuh
@rm /tmp/wazuh-passwords.txt
}

test-49-installCommon_changePasswords-with-tarfile-aio-assert() {
Expand All @@ -992,7 +992,7 @@ test-49-installCommon_changePasswords-with-tarfile-aio-assert() {
passwords_generateHash
passwords_changePassword
passwords_runSecurityAdmin
rm -rf /tmp/passwords.wazuh
rm -rf /tmp/wazuh-passwords.txt
@echo 1
}

Expand All @@ -1002,10 +1002,10 @@ test-50-installCommon_changePasswords-with-tarfile-start-elastic-cluster() {
base_path=/tmp
AIO=1
@touch $tar_file
@mock tar -xf tarfile.tar -C /tmp wazuh-install-files/passwords.wazuh === @touch /tmp/passwords.wazuh
@mock tar -xf tarfile.tar -C /tmp wazuh-install-files/wazuh-passwords.txt === @touch /tmp/wazuh-passwords.txt
installCommon_changePasswords
@echo $changeall
@rm /tmp/passwords.wazuh
@rm /tmp/wazuh-passwords.txt
}

test-50-installCommon_changePasswords-with-tarfile-start-elastic-cluster-assert() {
Expand All @@ -1017,7 +1017,7 @@ test-50-installCommon_changePasswords-with-tarfile-start-elastic-cluster-assert(
passwords_generateHash
passwords_changePassword
passwords_runSecurityAdmin
rm -rf /tmp/passwords.wazuh
rm -rf /tmp/wazuh-passwords.txt
@echo 1
}

Expand Down
6 changes: 3 additions & 3 deletions unattended_installer/install_functions/installCommon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function installCommon_createInstallFiles() {
if [ -n "${server_node_types[*]}" ]; then
installCommon_createClusterKey
fi
gen_file="/tmp/wazuh-install-files/passwords.wazuh"
gen_file="/tmp/wazuh-install-files/wazuh-passwords.txt"
passwords_generatePasswordFile
# Using cat instead of simple cp because OpenSUSE unknown error.
eval "cat '${config_file}' > '/tmp/wazuh-install-files/wazuh-config.yml'"
Expand All @@ -194,8 +194,8 @@ function installCommon_changePasswords() {

common_logger -d "Setting Wazuh indexer cluster passwords."
if [ -f "${tar_file}" ]; then
eval "tar -xf ${tar_file} -C /tmp wazuh-install-files/passwords.wazuh ${debug}"
p_file="/tmp/wazuh-install-files/passwords.wazuh"
eval "tar -xf ${tar_file} -C /tmp wazuh-install-files/wazuh-passwords.txt ${debug}"
p_file="/tmp/wazuh-install-files/wazuh-passwords.txt"
common_checkInstalled
if [ -n "${start_indexer_cluster}" ] || [ -n "${AIO}" ]; then
changeall=1
Expand Down
2 changes: 1 addition & 1 deletion unattended_installer/install_functions/installVariables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Package vars
readonly wazuh_major="4.3"
readonly wazuh_version="4.3.5"
readonly wazuh_version="4.3.6"
readonly wazuh_revision_deb="1"
readonly wazuh_revision_rpm="1"
readonly indexer_revision_deb="1"
Expand Down
4 changes: 2 additions & 2 deletions unattended_installer/passwords_tool/passwordsMain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function getHelp() {
echo -e " -v, --verbose"
echo -e " Shows the complete script execution output."
echo -e ""
echo -e " -f, --file <passwords.wazuh>"
echo -e " -f, --file <wazuh-passwords.txt>"
echo -e " Changes the passwords for the ones given in the file."
echo -e ""
echo -e " Wazuh indexer users must have this format:"
Expand All @@ -61,7 +61,7 @@ function getHelp() {
echo -e " api_username: <user>"
echo -e " api_password: <password>"
echo -e ""
echo -e " -gf, --generate-file <passwords.wazuh>"
echo -e " -gf, --generate-file <wazuh-passwords.txt>"
echo -e " Generate password file with random passwords for standard users."
echo -e ""
echo -e " -h, --help"
Expand Down

0 comments on commit 8d20d96

Please sign in to comment.