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

Wazuh installation assistant and tools adaptation #33

Merged
merged 25 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bb25924
Copied Installation assistant files
davidcr01 Aug 14, 2024
f05966a
Added VERSION file
davidcr01 Aug 14, 2024
de19d53
Added SECURITY.md file
davidcr01 Aug 14, 2024
ce4b56d
Added README.md file
davidcr01 Aug 19, 2024
08eab8d
Added CHANGELOG.md file
davidcr01 Aug 19, 2024
d446b3c
Copied tests directory
davidcr01 Aug 19, 2024
acf7aff
Replaced unattended references
davidcr01 Aug 19, 2024
8121896
Updated CHANGELOG.md file
davidcr01 Aug 20, 2024
e1d5ea1
Fixed Wazuh API validation
davidcr01 Aug 20, 2024
4641500
Updated CHANGELOG for #29
davidcr01 Aug 20, 2024
449c1ef
Merge pull request #29 from wazuh/bug/28-false-negative-wazuh-api-con…
c-bordon Aug 20, 2024
ccd5bae
Added changes of packages#3074
davidcr01 Aug 20, 2024
5b07c14
Changed unattended reference
davidcr01 Aug 20, 2024
44afd93
Added changes of packages#3082
davidcr01 Aug 21, 2024
5fc130e
Reverted major and version
davidcr01 Aug 21, 2024
a469b5a
Changed README.md unit tests file
davidcr01 Aug 21, 2024
8bbd245
Improved README.md file
davidcr01 Aug 21, 2024
8f2070c
Deleted unattended references in tests
davidcr01 Aug 22, 2024
788b689
Merge branch '4.10.0' into enhancement/19-installation-assistant-file…
davidcr01 Aug 22, 2024
02ef885
Added 4.9.1 in the CHANGELOG.md file
davidcr01 Aug 22, 2024
b342ce4
Added blank line at the end of check.sh file
davidcr01 Aug 22, 2024
299f844
Fixed builder help
davidcr01 Aug 22, 2024
4c14993
Removed duplicated files
c-bordon Aug 22, 2024
97fb204
Added filebeat file
c-bordon Aug 22, 2024
7c52be1
Renamed installation assistant pytest
davidcr01 Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 172 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Change Log
All notable changes to this project will be documented in this file.

## [4.10.0]

### Changed

- Added post-install validations for the Wazuh manager and Filebeat. ([#3059](https://github.com/wazuh/wazuh-packages/pull/3059))

### Fixed

- Fixed Wazuh API validation ([#29](https://github.com/wazuh/wazuh-installation-assistant/pull/29))

## [4.9.1]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.9.1

## [4.9.0]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.9.0

## [4.8.1]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.8.1

## [4.8.0]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.8.0

## [4.7.5]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.7.5

## [4.7.4]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.7.4

## [4.7.3]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.7.3

## [4.7.2]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.7.2

## [4.7.1]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.7.1

## [v4.7.0]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.7.0

## [v4.6.0]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.6.0

## [v4.5.4]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.5.4

## [v4.5.3]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.5.3

## [v4.5.2]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.5.2

## [v4.5.1]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.5.1

## [v4.5.0]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.5.0

## [v4.4.5]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.4.5

## [v4.4.4]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.4.4

## [v4.4.3]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.4.3

## [v4.4.2]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.4.2

## [v4.3.11]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.11

## [v4.4.1]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.4.1

## [v4.4.0]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.4.0

## [v4.3.10]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.10

## [v4.3.9]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.9

## [v4.3.8]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.8

## [v4.3.7]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.7

## [v4.3.6]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.6

## [v4.3.5]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.5

## [v4.3.4]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.4

## [v4.3.3]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.3

## [v4.3.2]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.2

## [v4.2.7]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.2.7

## [v4.3.1]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.1

## [v4.3.0]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.3.0

## [v4.2.7]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.2.7

## [v4.2.6]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.2.7

## [v4.2.5]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.2.5

## [v4.2.4]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.2.4

## [v4.2.3]

- https://github.com/wazuh/wazuh-packages/releases/tag/v4.2.3
46 changes: 0 additions & 46 deletions Development-guide.md

This file was deleted.

177 changes: 176 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,176 @@
# wazuh-installation-assistant
# Wazuh installation assistant

[![Slack](https://img.shields.io/badge/slack-join-blue.svg)](https://wazuh.com/community/join-us-on-slack/)
[![Email](https://img.shields.io/badge/email-join-blue.svg)](https://groups.google.com/forum/#!forum/wazuh)
[![Documentation](https://img.shields.io/badge/docs-view-green.svg)](https://documentation.wazuh.com)
[![Documentation](https://img.shields.io/badge/web-view-green.svg)](https://wazuh.com)
[![Twitter](https://img.shields.io/twitter/follow/wazuh?style=social)](https://twitter.com/wazuh)
[![YouTube](https://img.shields.io/youtube/views/peTSzcAueEc?style=social)](https://www.youtube.com/watch?v=peTSzcAueEc)

## Table of Contents
1. [Overview](#overview)
2. [Tools](#tools)
3. [User Guide](#user-guide)
4. [Use Cases](#use-cases)
5. [Options Table](#options-table)
6. [Contribute](#contribute)
7. [Development Guide](#development-guide)
7. [More Information](#more-information)
9. [Authors](#authors)

## Overview

The Wazuh installation Assistant is a tool designed to simplify the deployment of Wazuh. It guides users through the process of installing Wazuh components. Key features include:

- **Guided Installation**: Step-by-step instructions for easy setup.
- **Component Selection**: Install only the Wazuh components you need.
- **System Requirements Check**: Automatically checks if your system meets the necessary requirements.
- **Automated Configuration**: Reduces errors by automating most of the setup.
- **Multi-Platform Support**: Compatible with various Linux distributions like Ubuntu, CentOS, and Debian.

## Tools

The Wazuh installation assistant uses the following tools to enhance security during the installation process:

- **Wazuh password tool**: Securely generate and manage passwords. [Learn more](https://documentation.wazuh.com/current/user-manual/user-administration/password-management.html).
- **Wazuh cert tool**: Manage SSL/TLS certificates for secure communications. [Learn more](https://documentation.wazuh.com/current/user-manual/wazuh-dashboard/certificates.html).



## User Guide

### Downloads
- [Download the Wazuh installation assistant.](https://packages.wazuh.com/4.10/wazuh-install.sh)
- [Download the Wazuh password tool.](https://packages.wazuh.com/4.10/wazuh-passwords-tool.sh)
- [Download the Wazuh cert tool.](https://packages.wazuh.com/4.10/wazuh-certs-tool.sh)

### Build the scripts
As an alternative to downloading, use the `builder.sh` script to build the Wazuh installation assistant and tools:


1. Build the Wazuh installation assistant - `wazuh-install.sh`:
```bash
bash builder.sh -i
```

2. Build the Wazuh password tool - `wazuh-passwords-tool.sh`:
```bash
bash builder.sh -p
```

3. Build the Wazuh cert tool - `wazuh-certs-tool.sh`:
```bash
bash builder.sh -c
```

## Use Cases

Start by downloading the [configuration file](https://packages.wazuh.com/4.10/config.yml) and replace the node names and IP values with the corresponding ones.

> [!NOTE]
> It is not necessary to download the Wazuh password tool and the Wazuh cert tool to use the Wazuh installation assistant. The Wazuh installation assistant has embedded the previous tools.

### Common commands

1. Generate the passwords and certificates. Needs the [configuration file](https://packages.wazuh.com/4.10/config.yml).
```bash
bash wazuh-install.sh -g
```
2. Install all central components on the local machine:
```bash
bash wazuh-install.sh -a
```

3. Uninstall all central components:
```bash
bash wazuh-install.sh -u
```

4. Install the Wazuh indexer specifying the same name as specified in the configuration file:
```bash
bash wazuh-install.sh --wazuh-indexer <NODE_NAME>
```

5. Initialize the Wazuh indexer cluster:
```bash
bash wazuh-install.sh --start-cluster
```

6. Install the Wazuh server specifying the same name as specified in the configuration file:
```bash
bash wazuh-install.sh --wazuh-server <NODE_NAME>
```

7. Install the Wazuh dashboard specifying the same name as specified in the configuration file:
```bash
bash wazuh-install.sh --wazuh-dashboard <NODE_NAME>
```

8. Display all options and help:
```bash
bash wazuh-install.sh -h
```

## Options Table

All the options for the Wazuh installation assistant are listed in the following table:
| Option | Description |
|---------------------------------------|----------------------------------------|
| `-a`, `--all-in-one` | Install and configure Wazuh server, Wazuh indexer, Wazuh dashboard. |
| `-c`, `--config-file <path-to-config-yml>` | Path to the configuration file used to generate `wazuh-install-files.tar` file containing the files needed for installation. By default, the Wazuh installation assistant will search for a file named `config.yml` in the same path as the script. |
| `-dw`, `--download-wazuh <deb,rpm>` | Download all the packages necessary for offline installation. Specify the type of packages to download for offline installation (`rpm`, `deb`). |
| `-fd`, `--force-install-dashboard` | Force Wazuh dashboard installation to continue even when it is not capable of connecting to the Wazuh indexer. |
| `-g`, `--generate-config-files` | Generate `wazuh-install-files.tar` file containing the files needed for installation from `config.yml`. In distributed deployments, you will need to copy this file to all hosts. |
| `-h`, `--help` | Display this help and exit. |
| `-i`, `--ignore-check` | Ignore the check for minimum hardware requirements. |
| `-o`, `--overwrite` | Overwrite previously installed components. This will erase all the existing configuration and data. |
| `-of`, `--offline-installation` | Perform an offline installation. This option must be used with `-a`, `-ws`, `-s`, `-wi`, or `-wd`. |
| `-p`, `--port` | Specify the Wazuh web user interface port. Default is the `443` TCP port. Recommended ports are: `8443`, `8444`, `8080`, `8888`, `9000`. |
| `-s`, `--start-cluster` | Initialize Wazuh indexer cluster security settings. |
| `-t`, `--tar <path-to-certs-tar>` | Path to tar file containing certificate files. By default, the Wazuh installation assistant will search for a file named `wazuh-install-files.tar` in the same path as the script. |
| `-u`, `--uninstall` | Uninstall all Wazuh components. This will erase all the existing configuration and data. |
| `-v`, `--verbose` | Show the complete installation output. |
| `-V`, `--version` | Show the version of the script and Wazuh packages. |
| `-wd`, `--wazuh-dashboard <dashboard-node-name>` | Install and configure Wazuh dashboard, used for distributed deployments. |
| `-wi`, `--wazuh-indexer <indexer-node-name>` | Install and configure Wazuh indexer, used for distributed deployments. |
| `-ws`, `--wazuh-server <server-node-name>` | Install and configure Wazuh manager and Filebeat, used for distributed deployments. |


## Contribute

If you want to contribute to our repository, please fork our GitHub repository and submit a pull request. Alternatively, you can share ideas through [our users' mailing list](https://groups.google.com/d/forum/wazuh).

## Development Guide

To ensure consistency in development, please follow these guidelines:

- Write functions with a single objective and limited arguments.
- Use libraries selectively (e.g., `install_functions`).
- Main functions should not depend on specific implementations.
- Use descriptive names for variables and functions.
- Use `${var}` instead of `$(var)` and `$(command)` instead of backticks.
- Always quote variables: `"${var}"`.
- Use the `common_logger` function instead of `echo`.
- Check command results with `$?` or `PIPESTATUS`.
- Use timeouts for long commands.
- Ensure all necessary resources are available both online and offline.
- Check command existence with `command -v`.
- Parametrize all package versions.
- Use `| grep -q` instead of `| grep`.
- Use standard `$((..))` instead of old `$[]`.

> [!TIP]
> *Additional check*: Run unit [tests](/tests/unit/README) before preparing a pull request.

Some useful links and acknowledgment:
- [Bash meets solid](https://codewizardly.com/bash-meets-solid/)
- [Shellcheck](https://github.com/koalaman/shellcheck#gallery-of-bad-code)

## More Information

For more detailed instructions and advanced use cases, please refer to the [Wazuh Quickstart Guide](https://documentation.wazuh.com/current/quickstart.html).


## Authors

Wazuh Copyright (C) 2015-2023 Wazuh Inc. (License GPLv2)
Loading