wazuh / wazuh-qa

Wazuh - Quality Assurance
GNU General Public License v2.0
61 stars 30 forks source link

DTT1 - Test Module - Central component tests #5219

Closed fcaffieri closed 1 week ago

fcaffieri commented 1 month ago

Description

The objective of the issue is to make the necessary adaptations to perform connection tests on central components Wazuh indexer and Wazuh dashboard

Tasks

Related

pro-akim commented 3 weeks ago

Update

Tests in Vagrant

Experimenting some issues around debian 11 and 12 with dashboard install in AIO in Vagrant This behaviour was not replicable in AWS debian 11 and 12 EC2s

Debian 12 ``` root@bullseye:/home/vagrant# systemctl status wazuh-dashboard.service Unit wazuh-dashboard.service could not be found. ``` For example, during the uninstallation ``` root@bullseye:/home/vagrant# sudo bash wazuh-install.sh --uninstall --ignore-check 23/04/2024 17:11:27 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3 23/04/2024 17:11:27 INFO: Verbose logging redirected to /var/log/wazuh-install.log 23/04/2024 17:11:28 INFO: Wazuh dashboard not found in the system so it was not uninstalled. 23/04/2024 17:11:28 INFO: Removing Wazuh manager. 23/04/2024 17:11:34 INFO: Wazuh manager removed. 23/04/2024 17:11:34 INFO: Removing Wazuh indexer. 23/04/2024 17:11:35 INFO: Wazuh indexer removed. 23/04/2024 17:11:35 INFO: Removing Filebeat. 23/04/2024 17:11:36 INFO: Filebeat removed. ``` Manual Installation ``` root@bullseye:/home/vagrant# wget https://packages.wazuh.com/4.7/wazuh-install.sh && sudo bash ./wazuh-install.sh -a --ignore-check --2024-04-23 17:11:50-- https://packages.wazuh.com/4.7/wazuh-install.sh Resolving packages.wazuh.com (packages.wazuh.com)... 18.154.48.93, 18.154.48.50, 18.154.48.117, ... Connecting to packages.wazuh.com (packages.wazuh.com)|18.154.48.93|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 165733 (162K) [application/x-sh] Saving to: 'wazuh-install.sh.2' wazuh-install.sh.2 100%[=====================================>] 161.85K --.-KB/s in 0.06s 2024-04-23 17:11:50 (2.76 MB/s) - 'wazuh-install.sh.2' saved [165733/165733] 23/04/2024 17:11:50 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3 23/04/2024 17:11:50 INFO: Verbose logging redirected to /var/log/wazuh-install.log 23/04/2024 17:11:55 INFO: --- Dependencies ---- 23/04/2024 17:11:55 INFO: Installing gawk. 23/04/2024 17:11:56 INFO: Installing curl. 23/04/2024 17:11:58 WARNING: Hardware and system checks ignored. 23/04/2024 17:11:58 INFO: Wazuh web interface port will be 443. 23/04/2024 17:12:03 INFO: Wazuh repository added. 23/04/2024 17:12:03 INFO: --- Configuration files --- 23/04/2024 17:12:03 INFO: Generating configuration files. 23/04/2024 17:12:04 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation. 23/04/2024 17:12:04 INFO: --- Wazuh indexer --- 23/04/2024 17:12:04 INFO: Starting Wazuh indexer installation. 23/04/2024 17:13:00 INFO: Wazuh indexer installation finished. 23/04/2024 17:13:00 INFO: Wazuh indexer post-install configuration finished. 23/04/2024 17:13:00 INFO: Starting service wazuh-indexer. 23/04/2024 17:13:18 INFO: wazuh-indexer service started. 23/04/2024 17:13:18 INFO: Initializing Wazuh indexer cluster security settings. 23/04/2024 17:13:29 INFO: Wazuh indexer cluster initialized. 23/04/2024 17:13:29 INFO: --- Wazuh server --- 23/04/2024 17:13:29 INFO: Starting the Wazuh manager installation. 23/04/2024 17:14:19 INFO: Wazuh manager installation finished. 23/04/2024 17:14:19 INFO: Starting service wazuh-manager. 23/04/2024 17:14:38 INFO: wazuh-manager service started. 23/04/2024 17:14:38 INFO: Starting Filebeat installation. 23/04/2024 17:14:41 INFO: Filebeat installation finished. 23/04/2024 17:14:41 INFO: Filebeat post-install configuration finished. 23/04/2024 17:14:41 INFO: Starting service filebeat. 23/04/2024 17:14:42 INFO: filebeat service started. 23/04/2024 17:14:42 INFO: --- Wazuh dashboard --- 23/04/2024 17:14:42 INFO: Starting Wazuh dashboard installation. 23/04/2024 17:15:17 INFO: Wazuh dashboard installation finished. 23/04/2024 17:15:17 INFO: Wazuh dashboard post-install configuration finished. 23/04/2024 17:15:17 INFO: Starting service wazuh-dashboard. 23/04/2024 17:15:18 INFO: wazuh-dashboard service started. 23/04/2024 17:15:38 INFO: Initializing Wazuh dashboard web application. 23/04/2024 17:15:38 INFO: Wazuh dashboard web application initialized. 23/04/2024 17:15:38 INFO: --- Summary --- 23/04/2024 17:15:38 INFO: You can access the web interface https://:443 User: admin Password: p.QpHB4NDmbVrx9*VpLPZFWM2DSv6.0B 23/04/2024 17:15:38 INFO: --- Dependencies ---- 23/04/2024 17:15:38 INFO: Removing gawk. 23/04/2024 17:15:40 INFO: Removing curl. 23/04/2024 17:15:44 INFO: Installation finished. root@bullseye:/home/vagrant# systemctl status wazuh-dashboard Unit wazuh-dashboard.service could not be found. ```
Debian 11 ``` root@bookworm/home/vagrant# systemctl status wazuh-dashboard.service Unit wazuh-dashboard.service could not be found. ``` During the uninstallation ``` root@bookworm:/home/vagrant# sudo bash wazuh-install.sh --uninstall --ignore-check 23/04/2024 17:18:52 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3 23/04/2024 17:18:52 INFO: Verbose logging redirected to /var/log/wazuh-install.log 23/04/2024 17:18:53 INFO: Wazuh dashboard not found in the system so it was not uninstalled. 23/04/2024 17:18:53 INFO: Removing Wazuh manager. 23/04/2024 17:18:58 INFO: Wazuh manager removed. 23/04/2024 17:18:58 INFO: Removing Wazuh indexer. 23/04/2024 17:19:00 INFO: Wazuh indexer removed. 23/04/2024 17:19:00 INFO: Removing Filebeat. 23/04/2024 17:19:01 INFO: Filebeat removed. ``` Manual installation ``` root@bookworm:/home/vagrant# wget https://packages.wazuh.com/4.7/wazuh-install.sh && sudo bash ./wazuh-install.sh -a --ignore-check --2024-04-23 17:19:22-- https://packages.wazuh.com/4.7/wazuh-install.sh Resolving packages.wazuh.com (packages.wazuh.com)... 18.154.48.117, 18.154.48.93, 18.154.48.50, ... Connecting to packages.wazuh.com (packages.wazuh.com)|18.154.48.117|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 165733 (162K) [application/x-sh] Saving to: 'wazuh-install.sh.2' wazuh-install.sh.2 100%[=====================================>] 161.85K 771KB/s in 0.2s 2024-04-23 17:19:23 (771 KB/s) - 'wazuh-install.sh.2' saved [165733/165733] 23/04/2024 17:19:23 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3 23/04/2024 17:19:23 INFO: Verbose logging redirected to /var/log/wazuh-install.log 23/04/2024 17:19:29 INFO: --- Dependencies ---- 23/04/2024 17:19:29 INFO: Installing gawk. 23/04/2024 17:19:30 INFO: Installing curl. 23/04/2024 17:19:32 WARNING: Hardware and system checks ignored. 23/04/2024 17:19:32 INFO: Wazuh web interface port will be 443. 23/04/2024 17:19:37 INFO: Wazuh repository added. 23/04/2024 17:19:37 INFO: --- Configuration files --- 23/04/2024 17:19:37 INFO: Generating configuration files. 23/04/2024 17:19:39 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation. 23/04/2024 17:19:39 INFO: --- Wazuh indexer --- 23/04/2024 17:19:39 INFO: Starting Wazuh indexer installation. 23/04/2024 17:20:25 INFO: Wazuh indexer installation finished. 23/04/2024 17:20:25 INFO: Wazuh indexer post-install configuration finished. 23/04/2024 17:20:25 INFO: Starting service wazuh-indexer. 23/04/2024 17:20:41 INFO: wazuh-indexer service started. 23/04/2024 17:20:41 INFO: Initializing Wazuh indexer cluster security settings. 23/04/2024 17:20:52 INFO: Wazuh indexer cluster initialized. 23/04/2024 17:20:52 INFO: --- Wazuh server --- 23/04/2024 17:20:52 INFO: Starting the Wazuh manager installation. 23/04/2024 17:21:40 INFO: Wazuh manager installation finished. 23/04/2024 17:21:40 INFO: Starting service wazuh-manager. 23/04/2024 17:21:58 INFO: wazuh-manager service started. 23/04/2024 17:21:58 INFO: Starting Filebeat installation. 23/04/2024 17:22:00 INFO: Filebeat installation finished. 23/04/2024 17:22:01 INFO: Filebeat post-install configuration finished. 23/04/2024 17:22:01 INFO: Starting service filebeat. 23/04/2024 17:22:02 INFO: filebeat service started. 23/04/2024 17:22:02 INFO: --- Wazuh dashboard --- 23/04/2024 17:22:02 INFO: Starting Wazuh dashboard installation. 23/04/2024 17:22:35 INFO: Wazuh dashboard installation finished. 23/04/2024 17:22:35 INFO: Wazuh dashboard post-install configuration finished. 23/04/2024 17:22:35 INFO: Starting service wazuh-dashboard. 23/04/2024 17:22:36 INFO: wazuh-dashboard service started. 23/04/2024 17:22:59 INFO: Initializing Wazuh dashboard web application. 23/04/2024 17:22:59 INFO: Wazuh dashboard web application initialized. 23/04/2024 17:22:59 INFO: --- Summary --- 23/04/2024 17:22:59 INFO: You can access the web interface https://:443 User: admin Password: VKXbnIV?nmn0Z?0KAw3OAuCr9s7c4g2x 23/04/2024 17:22:59 INFO: --- Dependencies ---- 23/04/2024 17:22:59 INFO: Removing gawk. 23/04/2024 17:23:01 INFO: Removing curl. 23/04/2024 17:23:06 INFO: Installation finished. root@bookworm:/home/vagrant# systemctl status wazuh-dashboard Unit wazuh-dashboard.service could not be found. ```

Tests in AWS

Running OK in:

pro-akim commented 3 weeks ago

Update

Following tests added

pro-akim commented 3 weeks ago

Update

AWS tests :green_circle:

YAML file ``` version: 0.1 description: This workflow is used to test manager deployment for DDT1 PoC variables: central_components-os: - linux-ubuntu-20.04-amd64 - linux-ubuntu-22.04-amd64 - linux-amazon-2-amd64 - linux-redhat-7-amd64 - linux-redhat-8-amd64 - linux-redhat-9-amd64 - linux-centos-7-amd64 - linux-centos-8-amd64 - linux-debian-10-amd64 - linux-debian-11-amd64 - linux-debian-12-amd64 infra-provider: aws working-dir: /tmp/dtt1-poc tasks: # Unique central components allocate task - task: "allocate-central_components-{central_components}" description: "Allocate resources for the central_components." do: this: process with: path: python3 args: - modules/allocation/main.py - action: create - provider: "{infra-provider}" - size: large - composite-name: "{central_components}" - inventory-output: "{working-dir}/central_components-{central_components}/inventory.yaml" - track-output: "{working-dir}/central_components-{central_components}/track.yaml" - label-termination-date: "1d" - label-team: "qa" on-error: "abort-all" foreach: - variable: central_components-os as: central_components cleanup: this: process with: path: python3 args: - modules/allocation/main.py - action: delete - track-output: "{working-dir}/central_components-{central_components-os}/track.yaml" # Generic manager test task - task: "run-central_components-{central_components}-tests" description: "Run tests install for the central_components." do: this: process with: path: python3 args: - modules/testing/main.py - targets: - wazuh-1: "{working-dir}/central_components-{central_components}/inventory.yaml" - tests: "install,restart,stop,uninstall" - component: "central_components" - wazuh-version: "4.7.3" - wazuh-revision: "40714" - live: "True" on-error: "abort-all" foreach: - variable: central_components-os as: central_components ```

aws test result.txt

pro-akim commented 2 weeks ago

Update

Fixes done after review

pro-akim commented 2 weeks ago

Update

ETA was updated to 03/05/2024 considering all the fixes to be done.

pro-akim commented 2 weeks ago

Update

The checkfiles were being adjusted for version 4.7.3 On April 30, 4.7.4 was released. The checkfiles are failing because with the product modifications, their impact on the OS differs from the previous version.

Reported to @rauldpm

rauldpm commented 2 weeks ago

Noted, thanks @pro-akim, I will elevate this requirement to review it again as I think this test will not be sustainable over time, like the upgrade tests check-files as we are not only checking the components files but the system files cc @davidjiglesias

pro-akim commented 1 week ago

Update

Requested changes done.

rauldpm commented 1 week ago

Really a good job team!