-
Notifications
You must be signed in to change notification settings - Fork 5
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
SPIKE - Installation assistant #150
Comments
Update reportThe different parts of the code have been reviewed to assess the feasibility of using Python as the programming language, particularly concerning the external dependencies it may require. This investigation is tentative for now, as the installation assistant for version
This division in the investigation reflects the priority of the different parts, with the Core Code being the most critical for decision-making and the Deprecated Code being the least significant. |
Dependencies of the Installation AssistantTypes of DependenciesThe installation assistant has two types of dependencies:
These libraries are:
Minimum Python version to useMost of the libraries to be used have been part of Python for quite some time. However, the minimum version required, for now, would be 3.4, as Important It is also important to note that elements such as ConclusionAfter completing the investigation, it can be concluded that all dependencies of the installation assistant are native to Python, so no additional dependencies need to be installed for its proper functioning. Note The most commonly used library for making HTTP requests in Python is DisclaimerAs shown, there are currently no external libraries required in the installation assistant's code. However, this does not mean that external libraries won't need to be added as the code evolves, such as the use of Pydantic, among others. |
Update reportFirst, it is necessary to specify which options from the installation assistant will be kept and which will be deprecated. For now, it is clear that both offline installation and the password-tool will be deprecated starting from version Below is a list of all the options currently available in the installation assistant. Each option will have an associated color tag indicating whether it will be maintained or deprecated in version Options ListLegend: 🔴 Deprecated option
Questions to DiscussBased on this table, several questions arise for discussion with the team members:
|
Options ListLegend: 🔴 Deprecated option
Questions to Discuss
The owners of each tool will maintain the password tool. (each tool will have their password tool)
Some things need to be defined about the cert-tool, but in principle, it would keep the same functions and be published as it is currently. For the moment, it would be kept in bash, and ultimately, if the changes to the assistant are successful, it would be migrated to Python. This could lead to the assistant not having the cert-tool embedded as it is currently.
I understand that this is a decision that we must make. Currently, this option gives the user more flexibility in handling these files. In principle, we would keep them.
As planned, no, the installation assistant should have a file with the list of URLs of the packages to be installed. In the case of development, we should use that file and replace the URLs of the packages according to our needs.
No, the installation assistant will only install the products on the default ports, customization of this will not be allowed.
This will probably be answered later in the product itself. Wazuh server probably has some functionality to validate connectivity against indexer. We will check.
Distributed installation will be possible, but only with the default options. That is, only the configuration will be modified to be able to be configured in a distributed way.
The security admin script will be maintained so we will have to maintain a similar option to initialize the cluster |
Function FilteringOnce the list of options for the Installation Assistant has been defined, it is necessary to analyze and categorize the existing functions. Some functions may no longer be needed or used. Among these functions, we will need to distinguish between:
By creating this list, we will ensure a more efficient migration of the Installation Assistant to Python. Function ListFunctions listMain directoriesThere are two directories dedicated to the functions of the installation assistant. These are:
Each function in every directory has been evaluated and categorized into three statuses:
Common_functionscommon_functionsIn this directory, there are 2 files:
Install_functionsinstall_functionsMain directory of the installation assistant. It contains all the functions related to each Wazuh component, checks, and global functions for each component. This directory has 10 files. Two of them are related to offline installation and one to Filebeat. Therefore, 7 files remain to be reviewed.
Functions SummarySummary
|
Development Plan for the Installation Assistant RepositoryThis development plan divides the installation-assistant repository into two fundamental parts:
There will also be a module used by both parts, which will control and manage the configuration data of each component. This module will handle the data from Below, each part is described with the different modules that need to be considered during their creation. Cert-toolCertificate Management Module (cert-tool)This module is responsible for managing certificates, including:
The way to obtain information regarding each component for certificate creation will be through the module responsible for managing configuration data. Installation-assistant1. Package Download and Installation ModuleThis module is responsible for obtaining and installing the necessary packages. Its responsibilities include:
This module manages the prerequisites and the installation of packages, serving as a precursor to the configuration of each component. 2. Wazuh Global Configuration ModuleThis module handles the configuration and initialization of Wazuh's main components. It considers the following:
Since this information is already retrieved beforehand, it does not need to be obtained again, and it will be passed as context to the components for configuration. Main Submodules
These submodules will exclusively contain files, classes, and functions dedicated to each specific component. They will be responsible for:
Generic ModuleIn addition to the specific submodules, a
This module will not be created separately from the start but will be built progressively as the installation assistant evolves and the need for generic checks or functions arises. 3. Component Data Configurer ModuleThis module extracts relevant component information from a
Based on this configuration and data extraction:
Since this module is not independent but serves as a complementary module for both the cert-tool and the installation-assistant, it will be housed inside the |
How the Installation Assistant will be executedThe installation of the Installation Assistant components, being implemented in Python, will be managed within a virtual environment. This ensures that if any external Python dependencies are required, they will be installed inside this environment rather than alongside the user's system-wide Python packages. This approach keeps the installation isolated from the user's machine files and configurations. Once the Installation Assistant finishes executing, it will automatically remove the virtual environment along with all installed Python dependencies, leaving the system clean of them. Transparency for the UserTo make the installation process as seamless as possible for the user, the following approach has been designed: Currently, users execute the
This approach ensures an initial dependency check to verify that all necessary components are available before starting the installation. Additionally, it maintains a seamless experience for users, who will not need to change how they execute the Installation Assistant compared to previous versions. |
Development ToolsOne of the main tools that will be necessary to keep the code clean is On the other hand, when developing and testing a new feature or simply running tests to ensure everything works correctly, I propose using Hatch and Hatch is a tool for managing virtual environments, installing dependencies, and running tests. It allows for a centralized development environment to be defined within In addition to managing environments and dependencies, Hatch has the option to run custom commands through scripts defined in the With In addition to defining dependencies, Thanks to this, we can have a centralized place for all configurations and execute different commands more easily and efficiently. It also helps in the creation of workflows, such as the one responsible for running the tests. |
Description
As part of the DevOps overhaul objective, we need to research, analyze alternatives, and design how to implement the following changes:
Simplification:
Package Usage:
Configuration Standardization:
Requirements Validation:
Tool Optimization:
Testing Improvements:
Implementation restrictions
Plan
Research & Analysis:
Simplification:
Package & Configuration Updates:
Requirements Validation:
Tool Integration:
Testing Enhancements:
Documentation Updates:
Validation & Feedback:
The text was updated successfully, but these errors were encountered: