wazuh / wazuh-packages

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

Improve the Wazuh unattended scripts to be used with a proxy #2829

Closed rauldpm closed 1 month ago

rauldpm commented 4 months ago

Description

A community user has reported a problem when running the installation assistant and is unable to correctly set the GPG key when using the following command:

sudo curl --proxy myCompanyProxy.xxx.com:80 -sO https://packages.wazuh.com/4.7/wazuh-install.sh && sudo bash ./wazuh-install.sh -a

Note that to download the script, the --proxy option had to be used in the curl command, but this is not propagated to the script execution, and since it has multiple curl calls it will fail to download the resources.

We must allow the execution of the script if a proxy server is available; for this, it is necessary to add a new option that accepts the proxy address

To avoid this problem it is possible to set environment variables with export:

export http_proxy=http://proxy.example.com:8080
export https_proxy=http://proxy.example.com:8080

Or passing the variable directly to the script:

http_proxy=proxy.example.com:8080 https_proxy=proxy.example.com:8080 bash ./wazuh-install.sh -a

But we should not delegate this type of action since the script should be user-friendly with the functionality it offers

[!NOTE] Other download options such as installing the central components should be taken into account