Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function installCommon_checkAptLock is not found in WIA #2686

Closed
7 tasks done
davidcr01 opened this issue Dec 13, 2023 · 2 comments · Fixed by #2687
Closed
7 tasks done

Function installCommon_checkAptLock is not found in WIA #2686

davidcr01 opened this issue Dec 13, 2023 · 2 comments · Fixed by #2687
Assignees
Labels
level/task Subtask issue type/bug Bug issue

Comments

@davidcr01
Copy link
Contributor

davidcr01 commented Dec 13, 2023

Wazuh version Install type Action performed Platform
4.8.0 Installation Assistant Install Any

Description

It has been observed that the WIA is broken in 4.8.0.

root@ubuntu22:/home/vagrant# bash wazuh-install.sh -a
13/12/2023 10:09:47 INFO: Starting Wazuh installation assistant. Wazuh version: 4.8.0
13/12/2023 10:09:47 INFO: Verbose logging redirected to /var/log/wazuh-install.log
13/12/2023 10:10:02 INFO: Verifying that your system meets the recommended minimum hardware requirements.
13/12/2023 10:10:02 INFO: Wazuh web interface port will be 443.
13/12/2023 10:10:07 INFO: --- Dependencies ----
13/12/2023 10:10:07 INFO: Installing apt-transport-https.
wazuh-install.sh: line 1808: installCommon_checkAptLock: command not found
wazuh-install.sh: line 1810: [: : integer expression expected
13/12/2023 10:10:07 ERROR: Cannot install dependency: apt-transport-https.

After some investigation, it has been found that the installCommon_checkAptLock has disappeared from the code.
Related:

It is necessary to include the installCommon_checkAptLock in the common.sh file, rename the function, and call it when necessary.

Tasks

  • Investigate a fix
  • Apply the fix
  • Validate the fix:
    • The checkAptLock function is included in the WIA and the rest of the tools: the cert and password tool.
    • The cert tool works correctly
    • The password tool works correctly
    • The WIA works correctly
@davidcr01 davidcr01 added level/task Subtask issue type/bug Bug issue labels Dec 13, 2023
@davidcr01 davidcr01 self-assigned this Dec 13, 2023
@davidcr01
Copy link
Contributor Author

davidcr01 commented Dec 13, 2023

Update Report

Development

  • The function has been moved to the common.sh file and renamed to common_checkAptLock
  • The occurrences of installCommon_checkAptLock have been replaced to common_checkAptLock
  • The function is correctly included in the password and certificates tools:
>  cat wazuh-passwords-tool.sh| grep common_checkAptLock
function common_checkAptLock() {

> cat wazuh-certs-tool.sh| grep common_checkAptLock 
function common_checkAptLock() {

> cat wazuh-install.sh | grep common_checkAptLock
    common_checkAptLock
            common_checkAptLock
            common_checkAptLock
            common_checkAptLock
            common_checkAptLock
function common_checkAptLock() {

Testing

🟢 AIO installation in Ubuntu 22 system
root@ubuntu22:/home/vagrant# bash wazuh-install.sh -a
13/12/2023 10:32:47 INFO: Starting Wazuh installation assistant. Wazuh version: 4.8.0
13/12/2023 10:32:47 INFO: Verbose logging redirected to /var/log/wazuh-install.log
13/12/2023 10:33:00 INFO: Verifying that your system meets the recommended minimum hardware requirements.
13/12/2023 10:33:00 INFO: Wazuh web interface port will be 443.
13/12/2023 10:33:04 INFO: --- Dependencies ----
13/12/2023 10:33:04 INFO: Installing apt-transport-https.
13/12/2023 10:33:22 INFO: Wazuh development repository added.
13/12/2023 10:33:22 INFO: --- Configuration files ---
13/12/2023 10:33:22 INFO: Generating configuration files.
13/12/2023 10:33:24 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
13/12/2023 10:33:24 INFO: --- Wazuh indexer ---
13/12/2023 10:33:24 INFO: Starting Wazuh indexer installation.
13/12/2023 10:37:36 INFO: Wazuh indexer installation finished.
13/12/2023 10:37:36 INFO: Wazuh indexer post-install configuration finished.
13/12/2023 10:37:36 INFO: Starting service wazuh-indexer.
13/12/2023 10:38:09 INFO: wazuh-indexer service started.
13/12/2023 10:38:09 INFO: Initializing Wazuh indexer cluster security settings.
13/12/2023 10:38:21 INFO: The Wazuh indexer cluster ISM initialized.
13/12/2023 10:38:21 INFO: Wazuh indexer cluster initialized.
13/12/2023 10:38:21 INFO: --- Wazuh server ---
13/12/2023 10:38:21 INFO: Starting the Wazuh manager installation.
13/12/2023 10:40:02 INFO: Wazuh manager installation finished.
13/12/2023 10:40:02 INFO: Starting service wazuh-manager.
13/12/2023 10:40:25 INFO: wazuh-manager service started.
13/12/2023 10:40:25 INFO: Starting Filebeat installation.
13/12/2023 10:40:37 INFO: Filebeat installation finished.
13/12/2023 10:40:44 INFO: Filebeat post-install configuration finished.
13/12/2023 10:40:44 INFO: Starting service filebeat.
13/12/2023 10:40:46 INFO: filebeat service started.
13/12/2023 10:40:46 INFO: --- Wazuh dashboard ---
13/12/2023 10:40:46 INFO: Starting Wazuh dashboard installation.
13/12/2023 10:42:45 INFO: Wazuh dashboard installation finished.
13/12/2023 10:42:45 INFO: Wazuh dashboard post-install configuration finished.
13/12/2023 10:42:45 INFO: Starting service wazuh-dashboard.
13/12/2023 10:42:46 INFO: wazuh-dashboard service started.
13/12/2023 10:42:48 INFO: Updating the internal users.
13/12/2023 10:42:57 INFO: A backup of the internal users has been saved in the /etc/wazuh-indexer/internalusers-backup folder.
13/12/2023 10:43:27 INFO: Initializing Wazuh dashboard web application.
13/12/2023 10:43:28 INFO: Wazuh dashboard web application initialized.
13/12/2023 10:43:28 INFO: --- Summary ---
13/12/2023 10:43:28 INFO: You can access the web interface https://<wazuh-dashboard-ip>:443
    User: admin
    Password: c8q.8dXDG9NpzgHb7*WUbkse0CZzXlFT
13/12/2023 10:43:28 INFO: Installation finished.
🟢 AIO installation in CentOS7 system
[root@centos7 vagrant]# bash wazuh-install.sh -a
13/12/2023 11:03:14 INFO: Starting Wazuh installation assistant. Wazuh version: 4.8.0
13/12/2023 11:03:14 INFO: Verbose logging redirected to /var/log/wazuh-install.log
13/12/2023 11:03:22 INFO: Verifying that your system meets the recommended minimum hardware requirements.
13/12/2023 11:03:23 INFO: Wazuh web interface port will be 443.
13/12/2023 11:03:26 INFO: Wazuh development repository added.
13/12/2023 11:03:26 INFO: --- Configuration files ---
13/12/2023 11:03:26 INFO: Generating configuration files.
13/12/2023 11:03:28 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
13/12/2023 11:03:28 INFO: --- Wazuh indexer ---
13/12/2023 11:03:28 INFO: Starting Wazuh indexer installation.
13/12/2023 11:04:48 INFO: Wazuh indexer installation finished.
13/12/2023 11:04:48 INFO: Wazuh indexer post-install configuration finished.
13/12/2023 11:04:48 INFO: Starting service wazuh-indexer.
13/12/2023 11:05:08 INFO: wazuh-indexer service started.
13/12/2023 11:05:08 INFO: Initializing Wazuh indexer cluster security settings.
13/12/2023 11:05:22 INFO: The Wazuh indexer cluster ISM initialized.
13/12/2023 11:05:22 INFO: Wazuh indexer cluster initialized.
13/12/2023 11:05:22 INFO: --- Wazuh server ---
13/12/2023 11:05:22 INFO: Starting the Wazuh manager installation.
13/12/2023 11:07:26 INFO: Wazuh manager installation finished.
13/12/2023 11:07:26 INFO: Starting service wazuh-manager.
13/12/2023 11:07:43 INFO: wazuh-manager service started.
13/12/2023 11:07:43 INFO: Starting Filebeat installation.
13/12/2023 11:08:10 INFO: Filebeat installation finished.
13/12/2023 11:08:12 INFO: Filebeat post-install configuration finished.
13/12/2023 11:08:12 INFO: Starting service filebeat.
13/12/2023 11:08:12 INFO: filebeat service started.
13/12/2023 11:08:12 INFO: --- Wazuh dashboard ---
13/12/2023 11:08:12 INFO: Starting Wazuh dashboard installation.
13/12/2023 11:11:08 INFO: Wazuh dashboard installation finished.
13/12/2023 11:11:08 INFO: Wazuh dashboard post-install configuration finished.
13/12/2023 11:11:08 INFO: Starting service wazuh-dashboard.
13/12/2023 11:11:08 INFO: wazuh-dashboard service started.
13/12/2023 11:11:11 INFO: Updating the internal users.
13/12/2023 11:11:17 INFO: A backup of the internal users has been saved in the /etc/wazuh-indexer/internalusers-backup folder.
13/12/2023 11:11:47 INFO: Initializing Wazuh dashboard web application.
13/12/2023 11:11:48 INFO: Wazuh dashboard web application initialized.
13/12/2023 11:11:48 INFO: --- Summary ---
13/12/2023 11:11:48 INFO: You can access the web interface https://<wazuh-dashboard-ip>:443
    User: admin
    Password: mL5J22*EoQ7FtMHkNNvlnrdtUojEa69+
13/12/2023 11:11:48 INFO: Installation finished.
🟢 Uninstallation in Ubuntu 22 system
root@ubuntu22::/home/ubuntu# bash wazuh-install.sh -u
13/12/2023 11:26:06 INFO: Starting Wazuh installation assistant. Wazuh version: 4.8.0
13/12/2023 11:26:06 INFO: Verbose logging redirected to /var/log/wazuh-install.log
13/12/2023 11:26:09 INFO: Removing Wazuh manager.
13/12/2023 11:26:33 INFO: Wazuh manager removed.
13/12/2023 11:26:33 INFO: Removing Wazuh indexer.
13/12/2023 11:26:49 INFO: Wazuh indexer removed.
13/12/2023 11:26:49 INFO: Removing Filebeat.
13/12/2023 11:27:02 INFO: Filebeat removed.
13/12/2023 11:27:02 INFO: Removing Wazuh dashboard.
13/12/2023 11:27:33 INFO: Wazuh dashboard removed.
🟢 Uninstallation in CentOS 7 system
[root@centos7 vagrant]# bash wazuh-install.sh -u
13/12/2023 11:12:08 INFO: Starting Wazuh installation assistant. Wazuh version: 4.8.0
13/12/2023 11:12:08 INFO: Verbose logging redirected to /var/log/wazuh-install.log
13/12/2023 11:12:10 INFO: Removing Wazuh manager.
13/12/2023 11:12:35 INFO: Wazuh manager removed.
13/12/2023 11:12:35 INFO: Removing Wazuh indexer.
13/12/2023 11:12:41 INFO: Wazuh indexer removed.
13/12/2023 11:12:41 INFO: Removing Filebeat.
13/12/2023 11:12:45 INFO: Filebeat removed.
13/12/2023 11:12:45 INFO: Removing Wazuh dashboard.
13/12/2023 11:13:01 INFO: Wazuh dashboard removed.
🟢 Wazuh passwords tool working correctly
[root@centos7 vagrant]#/home/ubuntu# bash wazuh-passwords-tool.sh -a
13/12/2023 11:19:13 INFO: Updating the internal users.
13/12/2023 11:19:19 INFO: A backup of the internal users has been saved in the /etc/wazuh-indexer/internalusers-backup folder.
13/12/2023 11:19:19 INFO: Wazuh API admin credentials not provided, Wazuh API passwords not changed.
13/12/2023 11:19:47 INFO: The password for user admin is .mn9x*9TAPFLc.7wyzpCeXHhlZtL6Eg5
13/12/2023 11:19:47 INFO: The password for user kibanaserver is Dep7sl++9iXoelbcGQ803z6K*KjZlpxH
13/12/2023 11:19:47 INFO: The password for user kibanaro is nur3BzI3yFB.FSEJlJxWFqj3?VW5Veog
13/12/2023 11:19:47 INFO: The password for user logstash is qNS*CcsQF6qaWuhejGQHG.3Ye78b?+O*
13/12/2023 11:19:47 INFO: The password for user readall is Lqxd8NH1kR0XZ3Y5+m4f+3KNvQOv9H*2
13/12/2023 11:19:47 INFO: The password for user snapshotrestore is o5923Lx8AfchB7UNhvhMREL+9*jl+dTl
13/12/2023 11:19:47 WARNING: Wazuh indexer passwords changed. Remember to update the password in the Wazuh dashboard and Filebeat nodes if necessary, and restart the services.
[root@centos7 vagrant]#/home/ubuntu# 
🟢 Wazuh certs tool working correctly
[root@centos7 vagrant]#/home/ubuntu# bash wazuh-certs-tool.sh --all wazuh-install-files/root-ca.pem wazuh-install-files/root-ca.key 
13/12/2023 11:24:11 INFO: Admin certificates created.
13/12/2023 11:24:13 INFO: Wazuh indexer certificates created.
13/12/2023 11:24:13 INFO: Wazuh server certificates created.
13/12/2023 11:24:13 INFO: Wazuh dashboard certificates created.

@jnasselle
Copy link
Member

RCA

Code was removed in this PR/commit https://github.com/wazuh/wazuh-packages/pull/2648/files#diff-31d5f1eaa91b837b7f91a80dbee9b531e84575ff1fcc23280e484ef223b7cadaL183-L196

@teddytpc1 teddytpc1 linked a pull request Dec 13, 2023 that will close this issue
@wazuhci wazuhci moved this to In review in Release 4.8.0 Dec 13, 2023
@wazuhci wazuhci moved this from In review to Done in Release 4.8.0 Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Subtask issue type/bug Bug issue
Projects
No open projects
Status: Done
3 participants