From 651efb9f9e43a489f6c43cbeb2a2c0caa3f9244b Mon Sep 17 00:00:00 2001 From: c-bordon Date: Thu, 7 Nov 2024 09:25:04 -0300 Subject: [PATCH 01/11] Removed check functions for Wazuh manager and Filebeat --- install_functions/filebeat.sh | 13 --------- install_functions/installMain.sh | 4 --- install_functions/manager.sh | 46 +------------------------------- 3 files changed, 1 insertion(+), 62 deletions(-) diff --git a/install_functions/filebeat.sh b/install_functions/filebeat.sh index 30f039f..266c725 100644 --- a/install_functions/filebeat.sh +++ b/install_functions/filebeat.sh @@ -6,19 +6,6 @@ # License (version 2) as published by the FSF - Free Software # Foundation. -function filebeat_checkService() { - common_logger "Checking Filebeat connection" - - if filebeat test output | grep -q -i -w "ERROR"; then - common_logger -e "Filebeat connection Error." - eval "filebeat test output x ${debug}" - installCommon_rollBack - exit 1 - else - common_logger "Filebeat connection successful" - fi -} - function filebeat_configure(){ common_logger -d "Configuring Filebeat." diff --git a/install_functions/installMain.sh b/install_functions/installMain.sh index 1e27b85..cecebaf 100755 --- a/install_functions/installMain.sh +++ b/install_functions/installMain.sh @@ -394,12 +394,10 @@ function main() { manager_startCluster fi installCommon_startService "wazuh-manager" - manager_checkService filebeat_install filebeat_configure installCommon_changePasswords installCommon_startService "filebeat" - filebeat_checkService installCommon_removeWIADependencies fi @@ -416,11 +414,9 @@ function main() { manager_install manager_configure installCommon_startService "wazuh-manager" - manager_checkService filebeat_install filebeat_configure installCommon_startService "filebeat" - filebeat_checkService common_logger "--- Wazuh dashboard ---" dashboard_install dashboard_configure diff --git a/install_functions/manager.sh b/install_functions/manager.sh index e20b9dc..c3d8415 100644 --- a/install_functions/manager.sh +++ b/install_functions/manager.sh @@ -42,50 +42,6 @@ function manager_startCluster() { } -function manager_checkService() { - common_logger "Checking Wazuh API connection" - - max_attempts=15 - attempt=0 - seconds=5 - api_password="wazuh-wui" - token_command="curl -k -s -X POST -u \"wazuh-wui:${api_password}\" https://127.0.0.1:55000/security/user/authenticate/run_as?raw=true -d '{\"user_name\":\"wzread\"}' -H \"content-type:application/json\"" - TOKEN=$(eval "${token_command}") - - # Wait for the API to be ready - while [[ -z "${TOKEN}" && "${attempt}" -lt "${max_attempts}" ]]; do - attempt=$((attempt+1)) - common_logger "Attempt $attempt: Checking the Wazuh API to be ready" - sleep "${seconds}" - TOKEN=$(eval "${token_command}") - done - common_logger "Wazuh API is ready to receive requests." - - # Change curl credentials in case the master node has changed the passwords - if [[ "${TOKEN}" =~ "Invalid credentials" && "${server_node_types[pos]}" == "worker" ]]; then - api_password=$(tar -axf "${tar_file}" wazuh-install-files/wazuh-passwords.txt -O | grep -P "'wazuh-wui'" -A 1 | awk 'NR==2 { print $2 }' | sed "s/'//g") - token_command="curl -k -s -X POST -u \"wazuh-wui:${api_password}\" https://127.0.0.1:55000/security/user/authenticate/run_as?raw=true -d '{\"user_name\":\"wzread\"}' -H \"content-type:application/json\"" - TOKEN=$(eval "${token_command}") - fi - - if [[ -z "${TOKEN}" ]]; then - common_logger -e "Failed to obtain Wazuh API token after $max_attempts attempts." - installCommon_rollBack - exit 1 - fi - - 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" - else - common_logger -e "Wazuh API connection Error. $wm_error" - eval "/var/ossec/bin/wazuh-control status ${debug}" - installCommon_rollBack - exit 1 - fi -} - function manager_configure(){ common_logger -d "Configuring Wazuh manager." @@ -107,7 +63,7 @@ function manager_configure(){ eval "sed -i s/filebeat-key.pem/${server_node_names[0]}-key.pem/ /var/ossec/etc/ossec.conf ${debug}" common_logger -d "Setting provisional Wazuh indexer password." eval "/var/ossec/bin/wazuh-keystore -f indexer -k username -v admin" - eval "/var/ossec/bin/wazuh-keystore -f indexer -k password -v admin" + eval "/var/ossec/bin/wazuh-keystore -f indexer -k password -v admin" common_logger "Wazuh manager vulnerability detection configuration finished." } From c5721bf5208e4a50fd424414618853aeeb6386ce Mon Sep 17 00:00:00 2001 From: c-bordon Date: Thu, 7 Nov 2024 10:08:53 -0300 Subject: [PATCH 02/11] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 693ec55..7277e2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ### Changed +- Removed check functions for Wazuh manager and Filebeat. ([#138](https://github.com/wazuh/wazuh-installation-assistant/pull/138)) - Add checksum input and update the upload files to S3 steps ([#106](https://github.com/wazuh/wazuh-installation-assistant/pull/106)) - Deleted the offline_checkDependencies function and unified logic in offline_checkPrerequisites function. ([#99](https://github.com/wazuh/wazuh-installation-assistant/pull/99)) - Add input for wazuh installation assistant reference in workflows. ([#98](https://github.com/wazuh/wazuh-installation-assistant/pull/98)) From b173313fe2a9901b57a734db166c699c4013ab6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Anguita=20L=C3=B3pez?= Date: Fri, 8 Nov 2024 12:53:08 +0100 Subject: [PATCH 03/11] changed source branch to alpha-3 --- builder.sh | 2 +- install_functions/installVariables.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder.sh b/builder.sh index 6b551bd..4fee537 100755 --- a/builder.sh +++ b/builder.sh @@ -16,7 +16,7 @@ readonly resources_certs="${base_path_builder}/cert_tool" readonly resources_passwords="${base_path_builder}/passwords_tool" readonly resources_common="${base_path_builder}/common_functions" readonly resources_download="${base_path_builder}/downloader" -source_branch="v4.10.0" +source_branch="v4.10.0-alpha3" function getHelp() { diff --git a/install_functions/installVariables.sh b/install_functions/installVariables.sh index b3f606a..60019b1 100644 --- a/install_functions/installVariables.sh +++ b/install_functions/installVariables.sh @@ -11,7 +11,7 @@ readonly wazuh_major="4.10" readonly wazuh_version="4.10.0" readonly filebeat_version="7.10.2" readonly wazuh_install_vesion="0.1" -source_branch="v${wazuh_version}" +source_branch="v${wazuh_version}-alpha3" repogpg="https://packages.wazuh.com/key/GPG-KEY-WAZUH" repobaseurl="https://packages.wazuh.com/4.x" From 7857f5b69bf00a351332b7359877bca9b8b53cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Anguita=20L=C3=B3pez?= Date: Fri, 8 Nov 2024 13:02:09 +0100 Subject: [PATCH 04/11] revert source branch for 4.10.0-alpha3 --- builder.sh | 2 +- install_functions/installVariables.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder.sh b/builder.sh index 4fee537..6b551bd 100755 --- a/builder.sh +++ b/builder.sh @@ -16,7 +16,7 @@ readonly resources_certs="${base_path_builder}/cert_tool" readonly resources_passwords="${base_path_builder}/passwords_tool" readonly resources_common="${base_path_builder}/common_functions" readonly resources_download="${base_path_builder}/downloader" -source_branch="v4.10.0-alpha3" +source_branch="v4.10.0" function getHelp() { diff --git a/install_functions/installVariables.sh b/install_functions/installVariables.sh index 60019b1..b3f606a 100644 --- a/install_functions/installVariables.sh +++ b/install_functions/installVariables.sh @@ -11,7 +11,7 @@ readonly wazuh_major="4.10" readonly wazuh_version="4.10.0" readonly filebeat_version="7.10.2" readonly wazuh_install_vesion="0.1" -source_branch="v${wazuh_version}-alpha3" +source_branch="v${wazuh_version}" repogpg="https://packages.wazuh.com/key/GPG-KEY-WAZUH" repobaseurl="https://packages.wazuh.com/4.x" From e695bd3edf7b6fa9a1069e0570a763fff9e157bf Mon Sep 17 00:00:00 2001 From: c-bordon Date: Wed, 20 Nov 2024 12:44:16 -0300 Subject: [PATCH 05/11] Migrated documentation templates to wazuh-installation-assistant repository --- .../wazuh/filebeat/filebeat.yml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 documentation-templates/wazuh/filebeat/filebeat.yml diff --git a/documentation-templates/wazuh/filebeat/filebeat.yml b/documentation-templates/wazuh/filebeat/filebeat.yml new file mode 100644 index 0000000..efb6b83 --- /dev/null +++ b/documentation-templates/wazuh/filebeat/filebeat.yml @@ -0,0 +1,39 @@ +# Wazuh - Filebeat configuration file +output.elasticsearch: + hosts: ["127.0.0.1:9200"] + protocol: https + username: ${username} + password: ${password} + ssl.certificate_authorities: + - /etc/filebeat/certs/root-ca.pem + ssl.certificate: "/etc/filebeat/certs/filebeat.pem" + ssl.key: "/etc/filebeat/certs/filebeat-key.pem" +setup.template.json.enabled: true +setup.template.json.path: '/etc/filebeat/wazuh-template.json' +setup.template.json.name: 'wazuh' +setup.ilm.overwrite: true +setup.ilm.enabled: false + +filebeat.modules: + - module: wazuh + alerts: + enabled: true + archives: + enabled: false + +logging.level: info +logging.to_files: true +logging.files: + path: /var/log/filebeat + name: filebeat + keepfiles: 7 + permissions: 0644 + +logging.metrics.enabled: false + +seccomp: + default_action: allow + syscalls: + - action: allow + names: + - rseq From 2ad4f2a821e112eb4e93f4ec5da7aaa641bfc812 Mon Sep 17 00:00:00 2001 From: c-bordon Date: Wed, 20 Nov 2024 12:49:29 -0300 Subject: [PATCH 06/11] Fixed gitignore for config.yml --- .gitignore | 1 + documentation-templates/wazuh/config.yml | 28 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 documentation-templates/wazuh/config.yml diff --git a/.gitignore b/.gitignore index 4fb53cf..c3c831a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ wazuh-install.sh wazuh-passwords-tool.sh wazuh-certs-tool.sh config.yml +!documentation-templates/wazuh/config.yml wazuh-install-files.tar wazuh-install-files/ wazuh-offline.tar.gz diff --git a/documentation-templates/wazuh/config.yml b/documentation-templates/wazuh/config.yml new file mode 100644 index 0000000..13cfe54 --- /dev/null +++ b/documentation-templates/wazuh/config.yml @@ -0,0 +1,28 @@ +nodes: + # Wazuh indexer nodes + indexer: + - name: node-1 + ip: "" + #- name: node-2 + # ip: "" + #- name: node-3 + # ip: "" + + # Wazuh server nodes + # If there is more than one Wazuh server + # node, each one must have a node_type + server: + - name: wazuh-1 + ip: "" + # node_type: master + #- name: wazuh-2 + # ip: "" + # node_type: worker + #- name: wazuh-3 + # ip: "" + # node_type: worker + + # Wazuh dashboard nodes + dashboard: + - name: dashboard + ip: "" \ No newline at end of file From 0e43f4a7e4311a4a49ba4300e1c5304bb6939f9c Mon Sep 17 00:00:00 2001 From: c-bordon Date: Wed, 20 Nov 2024 12:52:31 -0300 Subject: [PATCH 07/11] Updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7277e2e..616f0da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. ## [4.10.0] +### Added + +- Migrated documentation templates to wazuh-installation-assistant repository. ([#144](https://github.com/wazuh/wazuh-installation-assistant/pull/144)) + ### Changed - Removed check functions for Wazuh manager and Filebeat. ([#138](https://github.com/wazuh/wazuh-installation-assistant/pull/138)) From 14beec4e173277d2c8707ec5fe6e239d3034c827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Anguita=20L=C3=B3pez?= Date: Fri, 22 Nov 2024 10:33:05 +0100 Subject: [PATCH 08/11] change source branch to 4.10.0-beta1 --- builder.sh | 2 +- install_functions/installVariables.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder.sh b/builder.sh index 6b551bd..ef6a735 100755 --- a/builder.sh +++ b/builder.sh @@ -16,7 +16,7 @@ readonly resources_certs="${base_path_builder}/cert_tool" readonly resources_passwords="${base_path_builder}/passwords_tool" readonly resources_common="${base_path_builder}/common_functions" readonly resources_download="${base_path_builder}/downloader" -source_branch="v4.10.0" +source_branch="v4.10.0-beta1" function getHelp() { diff --git a/install_functions/installVariables.sh b/install_functions/installVariables.sh index b3f606a..caf69ec 100644 --- a/install_functions/installVariables.sh +++ b/install_functions/installVariables.sh @@ -11,7 +11,7 @@ readonly wazuh_major="4.10" readonly wazuh_version="4.10.0" readonly filebeat_version="7.10.2" readonly wazuh_install_vesion="0.1" -source_branch="v${wazuh_version}" +source_branch="v${wazuh_version}-beta1" repogpg="https://packages.wazuh.com/key/GPG-KEY-WAZUH" repobaseurl="https://packages.wazuh.com/4.x" From 52e2e2280d85491f3defd166171f8bfa0ff7eb75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Anguita=20L=C3=B3pez?= Date: Fri, 22 Nov 2024 10:37:50 +0100 Subject: [PATCH 09/11] revert source branch for 4.10.0-beta1 --- builder.sh | 2 +- install_functions/installVariables.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder.sh b/builder.sh index ef6a735..6b551bd 100755 --- a/builder.sh +++ b/builder.sh @@ -16,7 +16,7 @@ readonly resources_certs="${base_path_builder}/cert_tool" readonly resources_passwords="${base_path_builder}/passwords_tool" readonly resources_common="${base_path_builder}/common_functions" readonly resources_download="${base_path_builder}/downloader" -source_branch="v4.10.0-beta1" +source_branch="v4.10.0" function getHelp() { diff --git a/install_functions/installVariables.sh b/install_functions/installVariables.sh index caf69ec..b3f606a 100644 --- a/install_functions/installVariables.sh +++ b/install_functions/installVariables.sh @@ -11,7 +11,7 @@ readonly wazuh_major="4.10" readonly wazuh_version="4.10.0" readonly filebeat_version="7.10.2" readonly wazuh_install_vesion="0.1" -source_branch="v${wazuh_version}-beta1" +source_branch="v${wazuh_version}" repogpg="https://packages.wazuh.com/key/GPG-KEY-WAZUH" repobaseurl="https://packages.wazuh.com/4.x" From 496b07fd1d5e998b0498e856a587ca66b54aa504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Anguita=20L=C3=B3pez?= Date: Tue, 3 Dec 2024 10:17:22 +0100 Subject: [PATCH 10/11] change source branch to 4.10.0-rc1 --- builder.sh | 2 +- install_functions/installVariables.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder.sh b/builder.sh index 6b551bd..83ef49b 100755 --- a/builder.sh +++ b/builder.sh @@ -16,7 +16,7 @@ readonly resources_certs="${base_path_builder}/cert_tool" readonly resources_passwords="${base_path_builder}/passwords_tool" readonly resources_common="${base_path_builder}/common_functions" readonly resources_download="${base_path_builder}/downloader" -source_branch="v4.10.0" +source_branch="v4.10.0-rc1" function getHelp() { diff --git a/install_functions/installVariables.sh b/install_functions/installVariables.sh index b3f606a..39d3738 100644 --- a/install_functions/installVariables.sh +++ b/install_functions/installVariables.sh @@ -11,7 +11,7 @@ readonly wazuh_major="4.10" readonly wazuh_version="4.10.0" readonly filebeat_version="7.10.2" readonly wazuh_install_vesion="0.1" -source_branch="v${wazuh_version}" +source_branch="v${wazuh_version}-rc1" repogpg="https://packages.wazuh.com/key/GPG-KEY-WAZUH" repobaseurl="https://packages.wazuh.com/4.x" From 28acdacfcb98b2b1f277e73b02b5632c7c429bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Anguita=20L=C3=B3pez?= Date: Tue, 3 Dec 2024 10:33:30 +0100 Subject: [PATCH 11/11] revert source branch for 4.10.0-rc1 --- builder.sh | 2 +- install_functions/installVariables.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder.sh b/builder.sh index 83ef49b..6b551bd 100755 --- a/builder.sh +++ b/builder.sh @@ -16,7 +16,7 @@ readonly resources_certs="${base_path_builder}/cert_tool" readonly resources_passwords="${base_path_builder}/passwords_tool" readonly resources_common="${base_path_builder}/common_functions" readonly resources_download="${base_path_builder}/downloader" -source_branch="v4.10.0-rc1" +source_branch="v4.10.0" function getHelp() { diff --git a/install_functions/installVariables.sh b/install_functions/installVariables.sh index 39d3738..b3f606a 100644 --- a/install_functions/installVariables.sh +++ b/install_functions/installVariables.sh @@ -11,7 +11,7 @@ readonly wazuh_major="4.10" readonly wazuh_version="4.10.0" readonly filebeat_version="7.10.2" readonly wazuh_install_vesion="0.1" -source_branch="v${wazuh_version}-rc1" +source_branch="v${wazuh_version}" repogpg="https://packages.wazuh.com/key/GPG-KEY-WAZUH" repobaseurl="https://packages.wazuh.com/4.x"