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

Print on console the wazuh user's password when installing Wazuh server. #2957

Merged

Conversation

CarlosALgit
Copy link
Member

@CarlosALgit CarlosALgit commented May 20, 2024

Related issue
Related: #2883

Description

The problem was that the Installation Assistant changed the wazuh user's password without notifying the user of these changes. Now the user is notified by console with the wazuh user and it's password when installing Wazuh server with the Installation Assistant.

Tests

The Wazuh server component is installed and it's verified that the password shown by console is correct.
The tests have been done on Ubuntu 22.04 and Centos7:

Ubuntu 22.04
root@ubuntu2204:~/wazuh-packages/unattended_installer# bash wazuh-install.sh --wazuh-server wazuh-1
20/05/2024 12:05:39 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3
20/05/2024 12:05:39 INFO: Verbose logging redirected to /var/log/wazuh-install.log
20/05/2024 12:05:48 INFO: Wazuh repository added.
20/05/2024 12:05:48 INFO: --- Wazuh server ---
20/05/2024 12:05:48 INFO: Starting the Wazuh manager installation.
20/05/2024 12:06:15 INFO: Wazuh manager installation finished.
20/05/2024 12:06:15 INFO: Starting service wazuh-manager.
20/05/2024 12:06:30 INFO: wazuh-manager service started.
20/05/2024 12:06:30 INFO: Starting Filebeat installation.
20/05/2024 12:06:32 INFO: Filebeat installation finished.
20/05/2024 12:06:33 INFO: Filebeat post-install configuration finished.
20/05/2024 12:06:37 INFO: The password for user wazuh is qvvuqi7w4Jd3+kjNIFEA2aJU*ud.0xT5
20/05/2024 12:06:37 INFO: The password for user wazuh-wui is 8QGdCg6i?SU88x5FP.W*JwZ0IghklarT
20/05/2024 12:06:37 INFO: Starting service filebeat.
20/05/2024 12:06:38 INFO: filebeat service started.
20/05/2024 12:06:38 INFO: Installation finished.
root@ubuntu2204:~/wazuh-packages/unattended_installer# TOKEN=$(curl -u wazuh:qvvuqi7w4Jd3+kjNIFEA2aJU*ud.0xT5 -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   398  100   398    0     0   1486      0 --:--:-- --:--:-- --:--:--  1490
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjA2ODE0LCJleHAiOjE3MTYyMDc3MTQsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.ARHaH99db6jPMOHgeCq1hxKPPtM7nCyfd_kkGLX-g-8GQ924AFs-Yt4Nn3xWYyy6hqAjnlDOi_DeyQJNAORubjMpAQQZFt6chLCTVhV8e_B1rj32brU7N1IXoxE6chorWkWC-4zqDRdTFCrT0-maUeYpy9BnQR9hX568ox_JAEFfZxf7
root@ubuntu2204:~/wazuh-packages/unattended_installer# TOKEN=$(curl -u wazuh-wui:8QGdCg6i?SU88x5FP.W*JwZ0IghklarT -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   404  100   404    0     0   1526      0 --:--:-- --:--:-- --:--:--  1530
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjA2ODM3LCJleHAiOjE3MTYyMDc3MzcsInN1YiI6IndhenVoLXd1aSIsInJ1bl9hcyI6ZmFsc2UsInJiYWNfcm9sZXMiOlsxXSwicmJhY19tb2RlIjoid2hpdGUifQ.ASyS2ASaH1rnwtwFnp63yy-jRUoffdTnUrKOB-LqVBNDHh59wm99ZNKdFs4zmLSogIRwEVBMYMOUtIOEa-eYyycPAb-ri02rC2BFveTe-AuIAPxmw569t-0qT-nRV4gXsbpO6dAr_fa9sxBACiaRwB4s98NXFHeyUVeO7x4HsvholaTT
Centos 7
[root@centos7 unattended_installer]# bash wazuh-install.sh --wazuh-server wazuh-1
20/05/2024 12:13:42 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3
20/05/2024 12:13:42 INFO: Verbose logging redirected to /var/log/wazuh-install.log
20/05/2024 12:13:46 WARNING: The system has Firewalld enabled. Please ensure that traffic is allowed on these ports: 1514, 1515, 1516, 55000.
20/05/2024 12:13:47 INFO: Wazuh repository added.
20/05/2024 12:13:47 INFO: --- Wazuh server ---
20/05/2024 12:13:47 INFO: Starting the Wazuh manager installation.
20/05/2024 12:14:17 INFO: Wazuh manager installation finished.
20/05/2024 12:14:17 INFO: Starting service wazuh-manager.
20/05/2024 12:14:31 INFO: wazuh-manager service started.
20/05/2024 12:14:31 INFO: Starting Filebeat installation.
20/05/2024 12:14:42 INFO: Filebeat installation finished.
20/05/2024 12:14:42 INFO: Filebeat post-install configuration finished.
20/05/2024 12:14:46 INFO: The password for user wazuh is AQaXfcRdnoUpyinzJZ1wLJ*o.uvb6dV3
20/05/2024 12:14:46 INFO: The password for user wazuh-wui is JGFYcj8sxThmC2G4z3KaWW8W+FshhqNO
20/05/2024 12:14:46 INFO: Starting service filebeat.
20/05/2024 12:14:46 INFO: filebeat service started.
20/05/2024 12:14:46 INFO: Installation finished.
[root@centos7 unattended_installer]# TOKEN=$(curl -u wazuh:AQaXfcRdnoUpyinzJZ1wLJ*o.uvb6dV3 -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   398  100   398    0     0   1521      0 --:--:-- --:--:-- --:--:--  1519
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjA3MzI2LCJleHAiOjE3MTYyMDgyMjYsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AdME7rXdKjlNVbHHveVAPz1FCsufqLG2mnvm--SYSC81Dc_c5lTRHe53uFNPAH6syUEYrzZImr_xwhUhEaoGSSKFAHBKb_6PdQs2fBLmB8bljILOi_xCsYV8s5kKF2GKCu-SplaMN9mTUMTUZC38ntoawVFbBVlMGS_ds82kVjkAiHPi
[root@centos7 unattended_installer]# TOKEN=$(curl -u wazuh-wui:JGFYcj8sxThmC2G4z3KaWW8W+FshhqNO -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   404  100   404    0     0   1628      0 --:--:-- --:--:-- --:--:--  1629
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjA3MzQ3LCJleHAiOjE3MTYyMDgyNDcsInN1YiI6IndhenVoLXd1aSIsInJ1bl9hcyI6ZmFsc2UsInJiYWNfcm9sZXMiOlsxXSwicmJhY19tb2RlIjoid2hpdGUifQ.ARTqWyNbhL-lH3EOCOgCbvyT2fHev46rZGRuEnD8VBVNfKRHDKzN79fE_fAPaoq4t6cyyDW2F6RulpYL2e4m7q7FAECcJlELPaEvIpNJIaPMOhnBWfoMXWf-E24helUpTldxhO0AcbVWQcFEEeogM5YqFjJa5IHf7REKMhZMGb3dDaax

More tests have been added:

Ubuntu 22.04 AIO
root@ubuntu2204:~/wazuh-packages/unattended_installer# bash wazuh-install.sh -a
20/05/2024 10:36:18 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3
20/05/2024 10:36:18 INFO: Verbose logging redirected to /var/log/wazuh-install.log

20/05/2024 10:36:28 INFO: Wazuh web interface port will be 443.
20/05/2024 10:36:32 INFO: Wazuh repository added.
20/05/2024 10:36:32 INFO: --- Configuration files ---
20/05/2024 10:36:32 INFO: Generating configuration files.
20/05/2024 10:36:33 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
20/05/2024 10:36:33 INFO: --- Wazuh indexer ---
20/05/2024 10:36:33 INFO: Starting Wazuh indexer installation.
20/05/2024 10:37:35 INFO: Wazuh indexer installation finished.
20/05/2024 10:37:35 INFO: Wazuh indexer post-install configuration finished.
20/05/2024 10:37:35 INFO: Starting service wazuh-indexer.
20/05/2024 10:37:44 INFO: wazuh-indexer service started.
20/05/2024 10:37:44 INFO: Initializing Wazuh indexer cluster security settings.
20/05/2024 10:37:54 INFO: Wazuh indexer cluster initialized.
20/05/2024 10:37:54 INFO: --- Wazuh server ---
20/05/2024 10:37:54 INFO: Starting the Wazuh manager installation.
20/05/2024 10:38:22 INFO: Wazuh manager installation finished.
20/05/2024 10:38:22 INFO: Starting service wazuh-manager.
20/05/2024 10:38:37 INFO: wazuh-manager service started.
20/05/2024 10:38:37 INFO: Starting Filebeat installation.
20/05/2024 10:38:40 INFO: Filebeat installation finished.
20/05/2024 10:38:41 INFO: Filebeat post-install configuration finished.
20/05/2024 10:38:41 INFO: Starting service filebeat.
20/05/2024 10:38:42 INFO: filebeat service started.
20/05/2024 10:38:42 INFO: --- Wazuh dashboard ---
20/05/2024 10:38:42 INFO: Starting Wazuh dashboard installation.
20/05/2024 10:39:23 INFO: Wazuh dashboard installation finished.
20/05/2024 10:39:23 INFO: Wazuh dashboard post-install configuration finished.
20/05/2024 10:39:23 INFO: Starting service wazuh-dashboard.
20/05/2024 10:39:23 INFO: wazuh-dashboard service started.
20/05/2024 10:39:43 INFO: The password for user wazuh is E2J*pjjaRbTAmc+wNF3q.*cgjurDVxVe
20/05/2024 10:39:43 INFO: The password for user wazuh-wui is BkJd.HPKTD?oiA?39sptRupamqYv14?C
20/05/2024 10:39:43 INFO: Initializing Wazuh dashboard web application.
20/05/2024 10:39:44 INFO: Wazuh dashboard web application initialized.
20/05/2024 10:39:44 INFO: --- Summary ---
20/05/2024 10:39:44 INFO: You can access the web interface https://<wazuh-dashboard-ip>:443
    User: admin
    Password: I08f4sK2c+0sRwDS3?h.?ri+xNSYh244
20/05/2024 10:39:44 INFO: Installation finished.

root@ubuntu2204:~/wazuh-packages/unattended_installer# TOKEN=$(curl -u wazuh:E2J*pjjaRbTAmc+wNF3q.*cgjurDVxVe -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   398  100   398    0     0   1441      0 --:--:-- --:--:-- --:--:--  1447
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjAxNzYwLCJleHAiOjE3MTYyMDI2NjAsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AZTtwmivKbuY_8uFAPjQwqabsjZForpKDvxS2-NRuZXegPcO9X6Ut-kmZ-yJl8vpkfR2JStO2iApG6vjMZaaoHgvAYNUftVHW0JKUdmtpBREBeuWN2Yi04wvCaPqptjcWLlXzcE3VxVSI45BddP6kGzwcf-jUwfvAlySJJNZBaOx2uVz
root@ubuntu2204:~/wazuh-packages/unattended_installer# TOKEN=$(curl -u wazuh-wui:BkJd.HPKTD?oiA?39sptRupamqYv14?C -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   404  100   404    0     0   1481      0 --:--:-- --:--:-- --:--:--  1485
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjAxNzg0LCJleHAiOjE3MTYyMDI2ODQsInN1YiI6IndhenVoLXd1aSIsInJ1bl9hcyI6ZmFsc2UsInJiYWNfcm9sZXMiOlsxXSwicmJhY19tb2RlIjoid2hpdGUifQ.AeuzCTfj6n7JmT5KheEXAFqEm_E1vbrdaRgeW-qJdNoPYfm5xDHlosjw4KWvOriykM7sPHmEc9ZBFuh8MYe5htUIAHBfrsSF6IU1Ald0Q8Hq8agTaxce6lfVP-OK7qHz1crNsTJ5w8KTZzc4UBn6HzywIsxkE6jxXZ--zDQ6602uscrl

@CarlosALgit CarlosALgit self-assigned this May 20, 2024
@CarlosALgit CarlosALgit linked an issue May 20, 2024 that may be closed by this pull request
2 tasks
@CarlosALgit CarlosALgit requested a review from a team May 20, 2024 09:06
@CarlosALgit CarlosALgit force-pushed the bug/2883-installation-assistant-modifies-wazuh-api-password branch from 8bf06b6 to 2768196 Compare May 20, 2024 10:22
Copy link
Contributor

@davidcr01 davidcr01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test the code removing the if conditional:

if [ -n "${wazuh}" ] || [ -n "${AIO}" ]; then

I think it is not necessary, as the installCommon_changePasswordApi call is already filtered:

if [ -n "${wazuh}" ] || [ -n "${dashboard}" ] || [ -n "${AIO}" ]; then
        if [ "${server_node_types[pos]}" == "master" ] || [ "${#server_node_names[@]}" -eq 1 ] || [ -n "${dashboard_installed}" ]; then
            installCommon_changePasswordApi
        fi
    fi

@CarlosALgit
Copy link
Member Author

Update Report

We have done the tests with the requested changes and they passed successfully.

Test in Ubuntu 22.04
root@ubuntu2204:~/wazuh-packages/unattended_installer# bash wazuh-install.sh --wazuh-server wazuh-1
21/05/2024 08:17:38 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3
21/05/2024 08:17:38 INFO: Verbose logging redirected to /var/log/wazuh-install.log
21/05/2024 08:17:55 INFO: Wazuh repository added.
21/05/2024 08:17:56 INFO: --- Wazuh server ---
21/05/2024 08:17:56 INFO: Starting the Wazuh manager installation.
21/05/2024 08:18:48 INFO: Wazuh manager installation finished.
21/05/2024 08:18:48 INFO: Starting service wazuh-manager.
21/05/2024 08:19:07 INFO: wazuh-manager service started.
21/05/2024 08:19:07 INFO: Starting Filebeat installation.
21/05/2024 08:19:12 INFO: Filebeat installation finished.
21/05/2024 08:19:13 INFO: Filebeat post-install configuration finished.
21/05/2024 08:19:18 INFO: The password for user wazuh is qvvuqi7w4Jd3+kjNIFEA2aJU*ud.0xT5
21/05/2024 08:19:18 INFO: The password for user wazuh-wui is 8QGdCg6i?SU88x5FP.W*JwZ0IghklarT
21/05/2024 08:19:18 INFO: Starting service filebeat.
21/05/2024 08:19:20 INFO: filebeat service started.
21/05/2024 08:19:20 INFO: Installation finished.
root@ubuntu2204:~/wazuh-packages/unattended_installer# TOKEN=$(curl -u wazuh:qvvuqi7w4Jd3+kjNIFEA2aJU*ud.0xT5 -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   398  100   398    0     0    925      0 --:--:-- --:--:-- --:--:--   923
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2Mjc5NTgzLCJleHAiOjE3MTYyODA0ODMsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.ACHqUVWJ-JI6eYH2nqE_8ZG-X4oRh25zgKMqbRfPbZjPdV-tpD6PC3REi8PTHkHepZXYrwCYv6XP77ArMQHUeJs6AfFUoNFRovHa3Q1Web81uQeu-kdWHN3KYQNHt23wSb0JpHEY0KVpCSnJIOBrZvHt9zm4zHzy03slQqfN75CcXL_u
root@ubuntu2204:~/wazuh-packages/unattended_installer# TOKEN=$(curl -u wazuh-wui:8QGdCg6i?SU88x5FP.W*JwZ0IghklarT -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   404  100   404    0     0    890      0 --:--:-- --:--:-- --:--:--   891
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2Mjc5NjAyLCJleHAiOjE3MTYyODA1MDIsInN1YiI6IndhenVoLXd1aSIsInJ1bl9hcyI6ZmFsc2UsInJiYWNfcm9sZXMiOlsxXSwicmJhY19tb2RlIjoid2hpdGUifQ.AQ3GCpNL2wGb5QSsBUn5d0FFjvEIDJPAhz5xe4xdEfOTYb5_Lw_rDy9tC2iAaPHmb_Kc6NBREmVRWacyfINkKlTMAHoN4Z4SLLzDJ-WLU3Zv2e__ETcLDNewxDqNodvFqwsJ6xLixVa2s4aTVDTw56dsmgOY4wuWvunYhU_c8jin1u2n
Test in Centos 7
[root@centos7 unattended_installer]# bash wazuh-install.sh --wazuh-server wazuh-1
21/05/2024 08:38:24 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3
21/05/2024 08:38:24 INFO: Verbose logging redirected to /var/log/wazuh-install.log
21/05/2024 08:38:32 WARNING: The system has Firewalld enabled. Please ensure that traffic is allowed on these ports: 1514, 1515, 1516, 55000.
21/05/2024 08:38:33 INFO: Wazuh repository added.
21/05/2024 08:38:33 INFO: --- Wazuh server ---
21/05/2024 08:38:33 INFO: Starting the Wazuh manager installation.
21/05/2024 08:39:24 INFO: Wazuh manager installation finished.
21/05/2024 08:39:24 INFO: Starting service wazuh-manager.
21/05/2024 08:39:41 INFO: wazuh-manager service started.
21/05/2024 08:39:41 INFO: Starting Filebeat installation.
21/05/2024 08:39:54 INFO: Filebeat installation finished.
21/05/2024 08:39:55 INFO: Filebeat post-install configuration finished.
21/05/2024 08:40:01 INFO: The password for user wazuh is AQaXfcRdnoUpyinzJZ1wLJ*o.uvb6dV3
21/05/2024 08:40:01 INFO: The password for user wazuh-wui is JGFYcj8sxThmC2G4z3KaWW8W+FshhqNO
21/05/2024 08:40:01 INFO: Starting service filebeat.
21/05/2024 08:40:01 INFO: filebeat service started.
21/05/2024 08:40:01 INFO: Installation finished.
[root@centos7 unattended_installer]# TOKEN=$(curl -u wazuh:AQaXfcRdnoUpyinzJZ1wLJ*o.uvb6dV3 -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   398  100   398    0     0    818      0 --:--:-- --:--:-- --:--:--   818
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjgwODI3LCJleHAiOjE3MTYyODE3MjcsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AEX6xEw68tMU_Ss0Hw5Y4y8ZGRUx0Sknm22e6wI_g17wkIpVSGopazuvNxV3THNZNSc8QXbVNU6VZu0haYWhWMQ3AOJ-X3A5WzP0R6fmhdaddnrqjNuWC6bI2Nh2DExqxIBgH4ZgNbAOIhGagkRtL-yYuzXrpmwyaoQBxrzCqvKp-2pJ
[root@centos7 unattended_installer]# TOKEN=$(curl -u wazuh-wui:JGFYcj8sxThmC2G4z3KaWW8W+FshhqNO -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   404  100   404    0     0    774      0 --:--:-- --:--:-- --:--:--   773
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjgwODQ5LCJleHAiOjE3MTYyODE3NDksInN1YiI6IndhenVoLXd1aSIsInJ1bl9hcyI6ZmFsc2UsInJiYWNfcm9sZXMiOlsxXSwicmJhY19tb2RlIjoid2hpdGUifQ.AANSC1mq6X5jrezqfBiqd4z_FPGFEF9SVSqfIpl6CGIhWlazjcAwRo9HxeVh8oEF0cCnFLB-SDJNgj_bIFIVRkrMAXNalwR8OVMwH4aZLwGI8lZDBsuZg8fJVDWMP49s67PN6VT-5xsVi8treithHAprixrmKBUdVy_sip6YnRYcgoHl
Test AIO in Ubuntu 22.04
root@ubuntu2204:~/wazuh-packages/unattended_installer# bash wazuh-install.sh -a
21/05/2024 08:27:46 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3
21/05/2024 08:27:46 INFO: Verbose logging redirected to /var/log/wazuh-install.log
21/05/2024 08:27:53 INFO: Wazuh web interface port will be 443.
21/05/2024 08:27:59 INFO: Wazuh repository added.
21/05/2024 08:27:59 INFO: --- Configuration files ---
21/05/2024 08:27:59 INFO: Generating configuration files.
21/05/2024 08:28:02 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
21/05/2024 08:28:02 INFO: --- Wazuh indexer ---
21/05/2024 08:28:02 INFO: Starting Wazuh indexer installation.
21/05/2024 08:29:11 INFO: Wazuh indexer installation finished.
21/05/2024 08:29:11 INFO: Wazuh indexer post-install configuration finished.
21/05/2024 08:29:11 INFO: Starting service wazuh-indexer.
21/05/2024 08:29:31 INFO: wazuh-indexer service started.
21/05/2024 08:29:31 INFO: Initializing Wazuh indexer cluster security settings.
21/05/2024 08:29:41 INFO: Wazuh indexer cluster initialized.
21/05/2024 08:29:41 INFO: --- Wazuh server ---
21/05/2024 08:29:41 INFO: Starting the Wazuh manager installation.
21/05/2024 08:30:33 INFO: Wazuh manager installation finished.
21/05/2024 08:30:33 INFO: Starting service wazuh-manager.
21/05/2024 08:30:52 INFO: wazuh-manager service started.
21/05/2024 08:30:52 INFO: Starting Filebeat installation.
21/05/2024 08:30:56 INFO: Filebeat installation finished.
21/05/2024 08:30:57 INFO: Filebeat post-install configuration finished.
21/05/2024 08:30:57 INFO: Starting service filebeat.
21/05/2024 08:30:58 INFO: filebeat service started.
21/05/2024 08:30:58 INFO: --- Wazuh dashboard ---
21/05/2024 08:30:58 INFO: Starting Wazuh dashboard installation.
21/05/2024 08:31:58 INFO: Wazuh dashboard installation finished.
21/05/2024 08:31:58 INFO: Wazuh dashboard post-install configuration finished.
21/05/2024 08:31:58 INFO: Starting service wazuh-dashboard.
21/05/2024 08:31:59 INFO: wazuh-dashboard service started.
21/05/2024 08:32:31 INFO: The password for user wazuh is P8vT.Ww5F4ZqOn1wyHp3x1orcO?XOl60
21/05/2024 08:32:31 INFO: The password for user wazuh-wui is OU4sepwdxlOZ1RL?JbwwR0Zl9i.DeKzj
21/05/2024 08:32:31 INFO: Initializing Wazuh dashboard web application.
21/05/2024 08:32:32 INFO: Wazuh dashboard web application initialized.
21/05/2024 08:32:32 INFO: --- Summary ---
21/05/2024 08:32:32 INFO: You can access the web interface https://<wazuh-dashboard-ip>:443
    User: admin
    Password: Ck*X94gPO6oN9fIj65jVACP.H.GGFE5U
21/05/2024 08:32:32 INFO: Installation finished.
root@ubuntu2204:~/wazuh-packages/unattended_installer# TOKEN=$(curl -u wazuh:P8vT.Ww5F4ZqOn1wyHp3x1orcO?XOl60 -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   398  100   398    0     0   1030      0 --:--:-- --:--:-- --:--:--  1031
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjgwMzk0LCJleHAiOjE3MTYyODEyOTQsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AcAxD3rcQaQnzeaURS2mj1EV1he04hW2_FmVqGdgVnx-pPtCkiglOpde7pW31m8UY74IFnXNUq1SxLQIfmhNelHPAQseNVglEIc-qPwQiLn5KFoDWzJztnMmVI4c7oH6uN7kns6FwKn3HE60pZltYN37y76sOsJpD-w0i678YmNW0wSQ
root@ubuntu2204:~/wazuh-packages/unattended_installer# TOKEN=$(curl -u wazuh-wui:OU4sepwdxlOZ1RL?JbwwR0Zl9i.DeKzj -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   404  100   404    0     0   1211      0 --:--:-- --:--:-- --:--:--  1213
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjgwNDE2LCJleHAiOjE3MTYyODEzMTYsInN1YiI6IndhenVoLXd1aSIsInJ1bl9hcyI6ZmFsc2UsInJiYWNfcm9sZXMiOlsxXSwicmJhY19tb2RlIjoid2hpdGUifQ.AffaIY0aco_Mvdw8qGOt0MgE5C7Jpf0XWDYSpgd4FVjWkDfYoF8U985MdcA1nzs1fhz5d5bILxJHTvs6GUuGF9yUAP43k58zyccYhzolY7-YG-UHEfNVI4Ju61pbBTDBCuNEwNMBN4aCDp1xD16pN9n3TPkQAXaFTbOEOmQlf1VWpt1L
Test AIO in Centos 7
[root@centos7 unattended_installer]# bash wazuh-install.sh -a
21/05/2024 08:42:23 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3
21/05/2024 08:42:23 INFO: Verbose logging redirected to /var/log/wazuh-install.log
21/05/2024 08:42:29 INFO: Wazuh web interface port will be 443.
21/05/2024 08:42:29 WARNING: The system has Firewalld enabled. Please ensure that traffic is allowed on these ports: 1515, 1514, 443.
21/05/2024 08:42:30 INFO: Wazuh repository added.
21/05/2024 08:42:30 INFO: --- Configuration files ---
21/05/2024 08:42:30 INFO: Generating configuration files.
21/05/2024 08:42:31 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
21/05/2024 08:42:31 INFO: --- Wazuh indexer ---
21/05/2024 08:42:31 INFO: Starting Wazuh indexer installation.
21/05/2024 08:43:40 INFO: Wazuh indexer installation finished.
21/05/2024 08:43:40 INFO: Wazuh indexer post-install configuration finished.
21/05/2024 08:43:41 INFO: Starting service wazuh-indexer.
21/05/2024 08:43:48 INFO: wazuh-indexer service started.
21/05/2024 08:43:48 INFO: Initializing Wazuh indexer cluster security settings.
21/05/2024 08:43:58 INFO: Wazuh indexer cluster initialized.
21/05/2024 08:43:58 INFO: --- Wazuh server ---
21/05/2024 08:43:58 INFO: Starting the Wazuh manager installation.
21/05/2024 08:44:30 INFO: Wazuh manager installation finished.
21/05/2024 08:44:30 INFO: Starting service wazuh-manager.
21/05/2024 08:44:44 INFO: wazuh-manager service started.
21/05/2024 08:44:44 INFO: Starting Filebeat installation.
21/05/2024 08:44:51 INFO: Filebeat installation finished.
21/05/2024 08:44:51 INFO: Filebeat post-install configuration finished.
21/05/2024 08:44:51 INFO: Starting service filebeat.
21/05/2024 08:44:52 INFO: filebeat service started.
21/05/2024 08:44:52 INFO: --- Wazuh dashboard ---
21/05/2024 08:44:52 INFO: Starting Wazuh dashboard installation.
21/05/2024 08:45:47 INFO: Wazuh dashboard installation finished.
21/05/2024 08:45:47 INFO: Wazuh dashboard post-install configuration finished.
21/05/2024 08:45:47 INFO: Starting service wazuh-dashboard.
21/05/2024 08:45:47 INFO: wazuh-dashboard service started.
21/05/2024 08:46:05 INFO: The password for user wazuh is Mdx?IU4qB.q*ML04jXjL4fW?YhZT?k?l
21/05/2024 08:46:05 INFO: The password for user wazuh-wui is RO5Hk.u01g5Yh.PC8V*RbUNtkE4yDhfI
21/05/2024 08:46:05 INFO: Initializing Wazuh dashboard web application.
21/05/2024 08:46:06 INFO: Wazuh dashboard web application initialized.
21/05/2024 08:46:06 INFO: --- Summary ---
21/05/2024 08:46:06 INFO: You can access the web interface https://<wazuh-dashboard-ip>:443
    User: admin
    Password: tMJlMxAWWPC4CmysG7J7Iw+ZtV*UaQeY
21/05/2024 08:46:06 INFO: Installation finished.
[root@centos7 unattended_installer]# TOKEN=$(curl -u wazuh:Mdx?IU4qB.q*ML04jXjL4fW?YhZT?k?l -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   398  100   398    0     0   1573      0 --:--:-- --:--:-- --:--:--  1579
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjgxMzcxLCJleHAiOjE3MTYyODIyNzEsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AJngqDaI3uQ2OcFUSo-jOicf1-Qw1d-IU1WaiyohmvGkxyeFUQ4oLPVe27EzGcVQUX_KgrkCJIxhqT4H062bhnUVAXzVa_-DPryfg2tSW-THMUoqdmc6d5qnZUwufGUQ0_qnMm7TX7dwepjMQtP8Birp_zq-0YZNocGylGK3HbSV5t3j
[root@centos7 unattended_installer]# TOKEN=$(curl -u wazuh-wui:RO5Hk.u01g5Yh.PC8V*RbUNtkE4yDhfI -k -X POST "https://localhost:55000/security/user/authenticate?raw=true") && echo $TOKEN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   404  100   404    0     0   1616      0 --:--:-- --:--:-- --:--:--  1622
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNzE2MjgxMzkyLCJleHAiOjE3MTYyODIyOTIsInN1YiI6IndhenVoLXd1aSIsInJ1bl9hcyI6ZmFsc2UsInJiYWNfcm9sZXMiOlsxXSwicmJhY19tb2RlIjoid2hpdGUifQ.ATWupxtgWV_VW5MNj3CrMbmX4PtgZHOYtqagYvZZlsnFFB9YM6FVBfODjIYcEIBE9PRjp0qKz0hjiWua1TEK5AxkAPKcUvTFDaZWTK8QiM5sGDQVpDZG0YZd5wCHDJzzrCQf-Cm6E3SsDcUvM2wuJXB7MKhTPve7W_-E4w7vnd2fbK6h

davidcr01
davidcr01 previously approved these changes May 21, 2024
c-bordon
c-bordon previously approved these changes May 21, 2024
@@ -178,6 +178,12 @@ function installCommon_changePasswordApi() {
fi
fi

for i in "${!api_users[@]}"; do
if [ "${api_users[i]}" == "wazuh" ] || [ "${api_users[i]}" == "wazuh-wui" ]; then
common_logger "The password for user ${api_users[i]} is ${api_passwords[i]}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change the message to print something like:
The password for the ${api_users[i]} user is ${api_passwords[i]}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@CarlosALgit CarlosALgit dismissed stale reviews from c-bordon and davidcr01 via 7bfb6e9 May 22, 2024 07:56
@c-bordon c-bordon merged commit d6b4df5 into master May 22, 2024
4 checks passed
@c-bordon c-bordon deleted the bug/2883-installation-assistant-modifies-wazuh-api-password branch May 22, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wazuh installation assistant modifies wazuh-api passwords
4 participants