-
Notifications
You must be signed in to change notification settings - Fork 97
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
Print on console the wazuh user's password when installing Wazuh server. #2957
Conversation
8bf06b6
to
2768196
Compare
There was a problem hiding this 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
Update ReportWe have done the tests with the requested changes and they passed successfully. Test in Ubuntu 22.04root@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.04root@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 |
@@ -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]}" |
There was a problem hiding this comment.
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]}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
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
Centos 7
More tests have been added:
Ubuntu 22.04 AIO