Closed teddytpc1 closed 1 month ago
unattended_installer
folder. https://github.com/wazuh/wazuh-installation-assistant/commit/bb25924ac727b2798e7a6e68c79af3ba4b3602eeunattended
references to assistant
. https://github.com/wazuh/wazuh-installation-assistant/commit/acf7affd6d49ae9314aea0332a28f5cb3b10d2adVERSION
file. https://github.com/wazuh/wazuh-installation-assistant/commit/f05966a0d538b90b1118ed7ae747b12c9c2f6e2bSECURITY.md
file. https://github.com/wazuh/wazuh-installation-assistant/commit/de19d53b00c5250ab3b5c0d7ad6f7a5c9e3337bebuilder.sh
. https://github.com/wazuh/wazuh-installation-assistant/issues/19#issuecomment-2296523318
wazuh-install.sh
. https://github.com/wazuh/wazuh-installation-assistant/issues/19#issuecomment-2298630853wazuh-passwords-tool.sh
. https://github.com/wazuh/wazuh-installation-assistant/issues/19#issuecomment-2298630853wazuh-certs-tool.sh
. https://github.com/wazuh/wazuh-installation-assistant/issues/19#issuecomment-2298630853README.md
file. https://github.com/wazuh/wazuh-installation-assistant/commit/ce4b56d440a4c09f1bd51114d988f26e54194823 and https://github.com/wazuh/wazuh-installation-assistant/commit/8bbd2456087bb9bfe2d1451d28df4d9fca74ac6eCHANGELOG.md
file https://github.com/wazuh/wazuh-installation-assistant/commit/08eab8d16c1fca9c6dac8919b15c6537f2e181b0 and update the CHANGELOG.md
file .https://github.com/wazuh/wazuh-installation-assistant/commit/8121896cfa0c1303a599386dafc4cf6a96fc37fe.The scripts are built correctly after the migration:
➜ wazuh-installation-assistant git:(enhancement/19-installation-assistant-files-migration) bash builder.sh -i
➜ wazuh-installation-assistant git:(enhancement/19-installation-assistant-files-migration) ✗ ls | grep wazuh-install
wazuh-install.sh
➜ wazuh-installation-assistant git:(enhancement/19-installation-assistant-files-migration) ✗ bash builder.sh -c
➜ wazuh-installation-assistant git:(enhancement/19-installation-assistant-files-migration) ✗ ls | grep wazuh-certs
wazuh-certs-tool.sh
➜ wazuh-installation-assistant git:(enhancement/19-installation-assistant-files-migration) ✗ bash builder.sh -p
➜ wazuh-installation-assistant git:(enhancement/19-installation-assistant-files-migration) ✗ ls | grep wazuh-pass
wazuh-passwords-tool.sh
➜ wazuh-installation-assistant git:(enhancement/19-installation-assistant-files-migration) ✗
A new issue has been created reported that, if the builder is not used without any parameter, it does not print the help: https://github.com/wazuh/wazuh-installation-assistant/issues/24
While validating the installation assistant, I encountered an issue when the assistant detects that there is an error connecting to the API:
0/08/2024 09:03:23 DEBUG: Configuring Wazuh manager.
20/08/2024 09:03:23 DEBUG: Setting provisional Wazuh indexer password.
20/08/2024 09:03:23 INFO: Wazuh manager vulnerability detection configuration finished.
20/08/2024 09:03:23 INFO: Starting service wazuh-manager.
Created symlink /etc/systemd/system/multi-user.target.wants/wazuh-manager.service → /lib/systemd/system/wazuh-manager.service.
20/08/2024 09:03:38 INFO: wazuh-manager service started.
20/08/2024 09:03:38 INFO: Checking Wazuh API connection
20/08/2024 09:03:38 ERROR: Wazuh API connection Error. {
"data": {
"affected_items": [],
"total_affected_items": 0,
"total_failed_items": 0,
"failed_items": []
},
"message": "No agent information was returned",
"error": 0
}
wazuh-clusterd not running...
wazuh-modulesd is running...
wazuh-monitord is running...
wazuh-logcollector is running...
wazuh-remoted is running...
wazuh-syscheckd is running...
wazuh-analysisd is running...
wazuh-maild not running...
wazuh-execd is running...
wazuh-db is running...
wazuh-authd is running...
wazuh-agentlessd not running...
wazuh-integratord not running...
wazuh-dbd not running...
wazuh-csyslogd not running...
wazuh-apid is running...
20/08/2024 09:03:38 INFO: --- Removing existing Wazuh installation ---
If I debug the execution trace, I see that curl returns a valid JSON where there is no error, but the assistant handles it as if there is one:
+ wm_error='{
"data": {
"affected_items": [],
"total_affected_items": 0,
"total_failed_items": 0,
"failed_items": []
},
"message": "No agent information was returned",
"error": 0
}'
+ [[ {
"data": {
"affected_items": [],
"total_affected_items": 0,
"total_failed_items": 0,
"failed_items": []
},
"message": "no agent information was returned",
"error": 0
} = \"\e\r\r\o\r\"\:\ \0 ]]
+ common_logger -e 'Wazuh API connection Error. {
If I look at the code that was incorporated in https://github.com/wazuh/wazuh-packages/pull/3059, I see that the entire content of the vm_error
variable is being passed to minuscules and compared with the string error: 0
(exact comparison, that is, the vm_error
variable must only contain the string error: 0
for the condition to evaluate as true):
wm_error=$(curl -k -s -X GET "https://127.0.0.1:55000/agents/outdated?pretty=true" -H "Authorization: Bearer ${TOKEN}")
if [[ ${wm_error,,} = '"error": 0' ]]; then
common_logger "Wazuh API connection successful"
[!CAUTION] So maybe this is a false negative that needs to be investigated, and if it is a bug, it is necessary to open an issue reporting this.
Description
Because of the
Wazuh packages redesign tier 2
objective we need to migrate the Wazuh installation assistant-related files from thewazuh-packages
repository to this one.Tasks
wazuh-packages
repository to this one (including thetests/unattended
folder)unattended_installer
toinstallation_assistant
if appliesRelated