wazuh / wazuh-packages

Wazuh - Tools for packages creation
https://wazuh.com
GNU General Public License v2.0
103 stars 93 forks source link

PDF Wazuh dashboard dependencies are installed in OVA #2737

Closed davidcr01 closed 8 months ago

davidcr01 commented 8 months ago

Description

Related: https://github.com/wazuh/internal-devel-requests/issues/492 It has been found that the PDF report dependencies that were removed from the installation of Wazuh are present in the OVA generation.

It is necessary to check if these dependencies should be removed to have integrity and similar installed packages in the different installation alternatives.

https://github.com/wazuh/wazuh-packages/blob/9766d74e016e12a47dc857744c5b6bdfdee3b17b/ova/assets/steps.sh#L44-L46

Tasks

davidcr01 commented 8 months ago

Update Report

OVA generation

The yum install command was removed. The OVA generation was successful:

Show log ```console bash generate_ova.sh -r dev Version to build: 4.8.0 with development repository ==> default: VM not created. Moving on... Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'amazonlinux-2'... ==> default: Matching MAC address for NAT networking... ==> default: Setting the name of the VM: vm_wazuh ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: wazuh-user default: SSH auth method: password default: default: Inserting generated public key within guest... default: Removing insecure key from the guest if it's present... default: Key inserted! Disconnecting and reconnecting using new SSH key... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... ==> default: Setting hostname... ==> default: Rsyncing folder: /home/davidcr01/Wazuh/wazuh-packages/ova/ => /tmp ==> default: - Exclude: [".vagrant/", "output"] ==> default: Running provisioner: shell... default: Running: /tmp/vagrant-shell20240109-26000-du95sx.sh default: Using dev packages default: Upgrading the system. This may take a while ... default: Loaded plugins: langpacks, priorities, update-motd default: No packages marked for update default: Loaded plugins: langpacks, priorities, update-motd default: Resolving Dependencies default: --> Running transaction check default: ---> Package dracut-fips.x86_64 0:033-535.amzn2.1.6 will be installed default: --> Processing Dependency: hmaccalc for package: dracut-fips-033-535.amzn2.1.6.x86_64 default: --> Running transaction check default: ---> Package hmaccalc.x86_64 0:0.9.13-4.amzn2.0.1 will be installed default: --> Finished Dependency Resolution default: default: Dependencies Resolved default: default: ================================================================================ default: Package Arch Version Repository Size default: ================================================================================ default: Installing: default: dracut-fips x86_64 033-535.amzn2.1.6 amzn2-core 60 k default: Installing for dependencies: default: hmaccalc x86_64 0.9.13-4.amzn2.0.1 amzn2-core 26 k default: default: Transaction Summary default: ================================================================================ default: Install 1 Package (+1 Dependent package) default: default: Total download size: 87 k default: Installed size: 107 k default: Downloading packages: default: -------------------------------------------------------------------------------- default: Total 25 kB/s | 87 kB 00:03 default: Running transaction check default: Running transaction test default: Transaction test succeeded default: Running transaction default: Installing : hmaccalc-0.9.13-4.amzn2.0.1.x86_64 1/2 default: Installing : dracut-fips-033-535.amzn2.1.6.x86_64 2/2 default: Verifying : dracut-fips-033-535.amzn2.1.6.x86_64 1/2 default: Verifying : hmaccalc-0.9.13-4.amzn2.0.1.x86_64 2/2 default: default: Installed: default: dracut-fips.x86_64 0:033-535.amzn2.1.6 default: default: Dependency Installed: default: hmaccalc.x86_64 0:0.9.13-4.amzn2.0.1 default: default: Complete! default: Created symlink from /etc/systemd/system/multi-user.target.wants/updateIndexerHeap.service to /etc/systemd/system/updateIndexerHeap.service. default: 09/01/2024 15:35:10 INFO: Starting Wazuh installation assistant. Wazuh version: 4.8.0 default: 09/01/2024 15:35:10 INFO: Verbose logging redirected to /var/log/wazuh-install.log default: 09/01/2024 15:35:16 INFO: Verifying that your system meets the recommended minimum hardware requirements. default: 09/01/2024 15:35:16 INFO: Wazuh web interface port will be 443. default: 09/01/2024 15:35:18 INFO: Wazuh development repository added. default: 09/01/2024 15:35:18 INFO: --- Configuration files --- default: 09/01/2024 15:35:18 INFO: Generating configuration files. default: 09/01/2024 15:35:19 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation. default: 09/01/2024 15:35:19 INFO: --- Wazuh indexer --- default: 09/01/2024 15:35:19 INFO: Starting Wazuh indexer installation. default: 09/01/2024 15:40:23 INFO: Wazuh indexer installation finished. default: 09/01/2024 15:40:23 INFO: Wazuh indexer post-install configuration finished. default: 09/01/2024 15:40:23 INFO: Starting service wazuh-indexer. default: 09/01/2024 15:40:44 INFO: wazuh-indexer service started. default: 09/01/2024 15:40:44 INFO: Initializing Wazuh indexer cluster security settings. default: 09/01/2024 15:40:56 INFO: The Wazuh indexer cluster ISM initialized. default: 09/01/2024 15:40:56 INFO: Wazuh indexer cluster initialized. default: 09/01/2024 15:40:56 INFO: --- Wazuh server --- default: 09/01/2024 15:40:56 INFO: Starting the Wazuh manager installation. default: 09/01/2024 15:44:55 INFO: Wazuh manager installation finished. default: 09/01/2024 15:44:55 INFO: Starting service wazuh-manager. default: 09/01/2024 15:45:12 INFO: wazuh-manager service started. default: 09/01/2024 15:45:12 INFO: Starting Filebeat installation. default: 09/01/2024 15:46:52 INFO: Filebeat installation finished. default: 09/01/2024 15:46:54 INFO: Filebeat post-install configuration finished. default: 09/01/2024 15:46:54 INFO: Starting service filebeat. default: 09/01/2024 15:46:54 INFO: filebeat service started. default: 09/01/2024 15:46:54 INFO: --- Wazuh dashboard --- default: 09/01/2024 15:46:54 INFO: Starting Wazuh dashboard installation. default: 09/01/2024 15:49:26 INFO: Wazuh dashboard installation finished. default: 09/01/2024 15:49:26 INFO: Wazuh dashboard post-install configuration finished. default: 09/01/2024 15:49:26 INFO: Starting service wazuh-dashboard. default: 09/01/2024 15:49:27 INFO: wazuh-dashboard service started. default: 09/01/2024 15:49:44 INFO: Updating the internal users. default: 09/01/2024 15:49:50 INFO: A backup of the internal users has been saved in the /etc/wazuh-indexer/internalusers-backup folder. default: 09/01/2024 15:50:12 INFO: Initializing Wazuh dashboard web application. default: 09/01/2024 15:50:12 INFO: Wazuh dashboard web application not yet initialized. Waiting... default: 09/01/2024 15:50:29 INFO: Wazuh dashboard web application not yet initialized. Waiting... default: 09/01/2024 15:50:44 INFO: Wazuh dashboard web application initialized. default: 09/01/2024 15:50:44 INFO: --- Summary --- default: 09/01/2024 15:50:44 INFO: You can access the web interface https://:443 default: User: admin default: Password: admin default: 09/01/2024 15:50:44 INFO: Installation finished. default: Loaded plugins: langpacks, priorities, update-motd default: Cleaning repos: amzn2-core amzn2extra-docker wazuh default: Cleaning up everything default: Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos ==> default: Saving VM state and suspending execution... Exporting ova 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Successfully exported 1 machine(s). ==> default: Discarding saved state of VM... ==> default: Destroying VM and associated drives... wazuh-4.8.0.ovf wazuh-4.8.0-disk001.vmdk Setting up ova for VMware ESXi Standarizing OVA Setting OVA to default wazuh-4.8.0.ovf wazuh-4.8.0-disk001.vmdk OVF extracted mv: '/home/davidcr01/Wazuh/wazuh-packages/ova/new-ova/wazuh-4.8.0.ovf' and '/home/davidcr01/Wazuh/wazuh-packages/ova/new-ova/wazuh-4.8.0.ovf' are the same file mv: cannot stat '/home/davidcr01/Wazuh/wazuh-packages/ova/new-ova/*.mf': No such file or directory Files renamed OVF Version changed OVF Size changed Manifest changed wazuh-4.8.0.ovf wazuh-4.8.0-disk-1.vmdk wazuh-4.8.0.mf New OVA created Cleaned temporary directory Process finished ==> default: VM not created. Moving on... ```

After importing the OVA, changing the host-bridged adapter to access the Wazuh interface, accessing the interface, and creating a dashboard, the popup is displayed and no errors are generated: Screenshot from 2024-01-10 11-34-45

The PDF is removed correctly: Screenshot from 2024-01-10 11-35-14

The visualization is empty as no data was collected, but the PDF was successfully generated, which is the aim of the test.

Note: the test was done using the 4.8.0 pre-release packages, as there are no 4.8.2 packages yet.