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

Installation assistant must ask for confirmation before installing dependencies #2879

Open
3 of 6 tasks
davidcr01 opened this issue Mar 12, 2024 · 2 comments
Open
3 of 6 tasks
Assignees
Labels
level/task Subtask issue type/change Change requested

Comments

@davidcr01
Copy link
Contributor

davidcr01 commented Mar 12, 2024

Description

Wazuh version Install type Action performed Platform
5.0.0 All components Install Any

Context

Currently, the Wazuh installation assistant installs two types of dependencies:

  • Dependencies used by the Installation assistant itself, which are removed after the installation.
  • Dependencies used by the Wazuh central components, which can not be removed because it would break the Wazuh installation.

Feature request

It is necessary to implement a new logic that avoids installing dependencies without permission. This new logic is divided in:

  • Asking the user if the dependencies can be installed, with a prompt like [Y/n], making the script interactive
  • Adding a new option to the script that assumes yes to the dependency installation question, like --asume-yes, -y, --install-dependencies, etc

Steps before development

  • Decide if the Installation assistant dependencies should be asked. Yes, but not the Wazuh dependencies.
  • Decide the name of the new parameter. --install-dependencies
  • Decide if the script should ask for every dependency or perform a scan and ask for a dependency list. List

Steps after development

  • Validate interactive behavior
  • Validate non-interactive behavior
  • Research the impact of this in OVA, AMI, and Jenkins pipeline tests and open issues if necessary.
    • AMI and OVA will be migrated in 5.0.0 to: https://github.com/wazuh/wazuh-virtual-machines
    • Jenkins pipelines Test_unattended_tier, Test_unattended, Test_unattended_distributed and Test_unattended_distributed_cases will be deprecated.
    • This changes impact to DTT1, in the testing and provision modules.
@davidcr01 davidcr01 added level/task Subtask issue type/change Change requested labels Mar 12, 2024
@teddytpc1 teddytpc1 changed the title Installation assistant must ask permission before installing dependencies Installation assistant must ask for confirmation before installing dependencies Mar 12, 2024
@davidcr01
Copy link
Contributor Author

davidcr01 commented May 21, 2024

Update Report

Approach

After talking this issue with the team, we decided not to make the script interactive. The proposed approach is to inform the user about the dependencies that need to be installed and stop the execution of the script (if the --install-dependencies parameter is not specified).

With this, we avoid making the script interactive (that can be bothersome to the user), but the Installation assistant will require a confirmation to install the dependencies by specifying the new parameter).

@davidcr01
Copy link
Contributor Author

davidcr01 commented May 24, 2024

Update Report

New approach

As the dependencies installation is done, the previous approach had conflicts with the openssl and lsof packages, which are treated as "special dependencies" and are installed separately. These dependencies would make not inform the user about the rest of the dependencies that are going to be installed.

After talking with @c-bordon, we reached the conclusion to rework the way the Installation assistant installs the dependencies and solve this problem as effectively as possible.

The approach is:

  1. Scan dependencies
  2. Inform about all the dependencies that are going to be installed, and also the ones which are going to be removed. At this point, the Assistant exists if the new parameter is specified.
  3. If the parameter is specified, install the Assistant dependencies
  4. Install the rest of the dependencies, depending on the chosen installation type.
  5. Remove the Assistant dependencies when finishing the installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Subtask issue type/change Change requested
Projects
Status: In progress
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant