diff --git a/CHANGELOG.md b/CHANGELOG.md index 50f124969d..f82f0d5c2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. ### Changed +- Remove hardcoded references in provision playbook for E2E tests ([#5517](https://github.com/wazuh/wazuh-qa/pull/5517)) \- (Framework) - Fix test_consistency_initial_scans by adding a 30-minute wait before collecting vulnerabilities. ([#5507](https://github.com/wazuh/wazuh-qa/pull/5507)) \- (Tests) ## [4.8.0] - 12/06/2024 diff --git a/provisioning/roles/wazuh/ansible-filebeat-oss/defaults/main.yml b/provisioning/roles/wazuh/ansible-filebeat-oss/defaults/main.yml index affd0222ab..af8021bdc1 100644 --- a/provisioning/roles/wazuh/ansible-filebeat-oss/defaults/main.yml +++ b/provisioning/roles/wazuh/ansible-filebeat-oss/defaults/main.yml @@ -1,7 +1,7 @@ --- filebeat_version: 7.10.2 -wazuh_template_branch: 4.8.1 +wazuh_template_branch: "{{ SOURCE_REFERENCE }}" filebeat_node_name: node-1 diff --git a/provisioning/roles/wazuh/ansible-wazuh-agent/defaults/main.yml b/provisioning/roles/wazuh/ansible-wazuh-agent/defaults/main.yml index 4e0477cd35..566418a76a 100644 --- a/provisioning/roles/wazuh/ansible-wazuh-agent/defaults/main.yml +++ b/provisioning/roles/wazuh/ansible-wazuh-agent/defaults/main.yml @@ -1,7 +1,5 @@ --- -wazuh_agent_version: 4.8.0 - # Custom packages installation wazuh_custom_packages_installation_agent_enabled: false @@ -56,8 +54,6 @@ wazuh_winagent_config: check_md5: True md5: a03806b7302767d0470d65d3f103fabb -wazuh_winagent_config_url: https://packages.wazuh.com/4.x/windows/wazuh-agent-4.8.0-1.msi -wazuh_winagent_package_name: wazuh-agent-4.8.0-1.msi wazuh_winagent_package_name_generic: wazuh-agent.msi wazuh_dir: "/var/ossec" macos_wazuh_dir: "/Library/Ossec" diff --git a/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml b/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml index 99913e7b4b..eb747cbc7a 100644 --- a/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml +++ b/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml @@ -13,31 +13,6 @@ when: - wazuh_custom_packages_installation_agent_enabled -- name: Linux CentOS/RedHat | Install wazuh-agent - yum: - name: wazuh-agent-{{ wazuh_agent_version }} - state: present - lock_timeout: '{{ wazuh_agent_yum_lock_timeout }}' - when: - - ansible_os_family|lower == "redhat" - - not wazuh_agent_sources_installation.enabled - - not wazuh_custom_packages_installation_agent_enabled - tags: - - init - -- name: Linux Debian | Install wazuh-agent - apt: - name: "wazuh-agent={{ wazuh_agent_version }}-*" - state: present - cache_valid_time: 3600 - when: - - ansible_os_family|lower != "redhat" - - not wazuh_agent_sources_installation.enabled - - not wazuh_custom_packages_installation_agent_enabled - - not ansible_check_mode - tags: - - init - - name: Linux | Check if client.keys exists stat: path: "{{ wazuh_dir }}/etc/client.keys" diff --git a/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml b/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml index d5c12a1e2d..efee98924c 100644 --- a/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml +++ b/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml @@ -18,38 +18,6 @@ when: - not check_path.stat.exists -- name: Windows | Check if Wazuh installer is already downloaded - win_stat: - path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}" - register: wazuh_package_downloaded - -- name: Windows | Download Wazuh Agent package - win_get_url: - url: "{{ wazuh_winagent_config_url }}" - dest: "{{ wazuh_winagent_config.download_dir }}" - when: - - not wazuh_package_downloaded.stat.exists - - not wazuh_custom_packages_installation_agent_enabled - -- name: Windows | Verify the Wazuh Agent installer - win_stat: - path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}" - get_checksum: true - checksum_algorithm: md5 - register: wazuh_agent_status - failed_when: - - wazuh_agent_status.stat.checksum != wazuh_winagent_config.md5 - when: - - wazuh_winagent_config.check_md5 - - not wazuh_custom_packages_installation_agent_enabled - - -- name: Windows | Install Agent if not already installed - win_package: - path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}" - state: present - when: not wazuh_custom_packages_installation_agent_enabled - - name: Windows | Check if client.keys exists win_stat: path: "{{ wazuh_agent_win_path }}client.keys" @@ -94,11 +62,6 @@ tags: - config -- name: Windows | Delete downloaded Wazuh agent installer file - win_file: - path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}" - state: absent - - include_tasks: "installation_from_custom_packages.yml" when: - wazuh_custom_packages_installation_agent_enabled diff --git a/provisioning/roles/wazuh/ansible-wazuh-manager/defaults/main.yml b/provisioning/roles/wazuh/ansible-wazuh-manager/defaults/main.yml index 78bf48dfd7..33b3e0a23c 100644 --- a/provisioning/roles/wazuh/ansible-wazuh-manager/defaults/main.yml +++ b/provisioning/roles/wazuh/ansible-wazuh-manager/defaults/main.yml @@ -1,7 +1,5 @@ --- -wazuh_manager_version: 4.8.0 - wazuh_manager_fqdn: "wazuh-server" wazuh_manager_package_state: present diff --git a/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml b/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml index 1079f8d20b..a2ab137338 100644 --- a/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml +++ b/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml @@ -104,16 +104,6 @@ state: present when: wazuh_manager_sources_installation.enabled -- name: Debian/Ubuntu | Install wazuh-manager - apt: - name: - - "wazuh-manager={{ wazuh_manager_version }}-*" - state: present - tags: init - when: - - not wazuh_manager_sources_installation.enabled - - not wazuh_custom_packages_installation_manager_enabled - - include_tasks: "installation_from_sources.yml" when: - wazuh_manager_sources_installation.enabled diff --git a/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml b/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml index b873b02118..18c85f3205 100644 --- a/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml +++ b/provisioning/roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml @@ -99,19 +99,6 @@ state: present when: wazuh_manager_sources_installation.enabled -- name: CentOS/RedHat/Amazon | Install wazuh-manager - package: - name: "wazuh-manager-{{ wazuh_manager_version }}" - state: "{{ wazuh_manager_package_state }}" - register: wazuh_manager_main_packages_installed - until: wazuh_manager_main_packages_installed is succeeded - when: - - ansible_os_family|lower == "redhat" - - not wazuh_manager_sources_installation.enabled - - not wazuh_custom_packages_installation_manager_enabled - tags: - - init - - include_tasks: "../tasks/installation_from_sources.yml" when: - wazuh_manager_sources_installation.enabled diff --git a/provisioning/roles/wazuh/check-packages/defaults/main.yml b/provisioning/roles/wazuh/check-packages/defaults/main.yml deleted file mode 100644 index 7a91513886..0000000000 --- a/provisioning/roles/wazuh/check-packages/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -wazuh_version: 4.8.0 diff --git a/provisioning/roles/wazuh/check-packages/scripts/check_packages.sh b/provisioning/roles/wazuh/check-packages/scripts/check_packages.sh deleted file mode 100755 index 20c6204788..0000000000 --- a/provisioning/roles/wazuh/check-packages/scripts/check_packages.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -VERSION=$1 -#echo $VERSION -## Replace VERSION with $VERSION in packages_uri.txt and save it as packages_uri_new.txt -sed 's,VERSION,'$VERSION',g' ../files/packages_uri.txt > ../files/packages_uri_new.txt - -checkPackages(){ - ## Set S3 Bucket URL - if [ $1 == "production" ]; then - echo "production" - PACKAGES_URL=https://packages.wazuh.com/4.x/ - elif [ $1 == "pre-release" ]; then - echo "pre-release" - PACKAGES_URL=https://packages-dev.wazuh.com/pre-release/ - elif [ $1 == "staging" ]; then - echo "staging" - PACKAGES_URL=https://packages-dev.wazuh.com/staging/ - CHECK_WIN_PACKAGE=$(grep windows ../files/packages_uri_new.txt) - echo $CHECK_WIN_PACKAGE - if [ -n "$CHECK_WIN_PACKAGE" ]; then - WIN_AGENT_NAME=$(aws s3 ls s3://packages-dev.wazuh.com/staging/windows/wazuh-agent-$VERSION --region=us-west-1 | tail -1 | awk '{printf $4}') - if [ -z $WIN_AGENT_NAME ]; then - echo "Windows agent package for version " $VERSION " does not exist in the staging repository" - exit 1 - fi - WIN_AGENT_URI="windows/"$WIN_AGENT_NAME - echo $PACKAGES_URL$WIN_AGENT_URI "check" - sed -i 's,windows/.*,'$WIN_AGENT_URI',g' ../files/packages_uri_new.txt - sed -i 's,wazuh_winagent_config_url.*,wazuh_winagent_config_url: \"'$PACKAGES_URL$WIN_AGENT_URI'\",g' ../../vars/repo_staging.yml - sed -i 's,wazuh_winagent_package_name.*,wazuh_winagent_package_name: \"'$WIN_AGENT_NAME'\",g' ../../vars/repo_staging.yml - fi - fi - - ## Set EXISTS to 0 (true) - EXISTS=0 - - ## Loop through the packages_uri_new.txt file - while IFS= read -r URI - do - echo "$URI" - ## Check if the package exists - PACKAGE=$(curl --silent -I $PACKAGES_URL$URI | grep -E "^HTTP" | awk '{print $2}') - ## If it does not exist set EXISTS to 1 (false) - if [ "$PACKAGE" != "200" ]; then - EXISTS=1 - #echo $PACKAGES_URL$URI "does not exist" - return $EXISTS - fi - done < ../files/packages_uri_new.txt - - return $EXISTS -} - -replaceVars(){ - sed -i "s|packages_repository:.*|packages_repository: $1|g" ../../vars/repo_vars.yml - -} - -## Call the checkPackages function for each repository -if checkPackages "production"; then - echo "production" - replaceVars "production" - exit 0 -elif checkPackages "pre-release"; then - echo "pre-release" - replaceVars "pre-release" - exit 0 -elif checkPackages "production"; then - echo "production" - replaceVars "production" - exit 0 -elif checkPackages "staging"; then - echo "staging" - replaceVars "staging" - exit 0 -else - echo "Failed" - exit 1 -fi \ No newline at end of file diff --git a/provisioning/roles/wazuh/check-packages/tasks/main.yml b/provisioning/roles/wazuh/check-packages/tasks/main.yml deleted file mode 100644 index bbee623b55..0000000000 --- a/provisioning/roles/wazuh/check-packages/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - - name: Check packages - shell: | - ./check_packages.sh {{ wazuh_version }} - args: - warn: false - executable: /bin/bash - chdir: "{{ role_path }}/scripts/" - delegate_to: localhost - become: no - diff --git a/provisioning/roles/wazuh/vars/repo.yml b/provisioning/roles/wazuh/vars/repo.yml index 870e4393c6..bc10d89538 100644 --- a/provisioning/roles/wazuh/vars/repo.yml +++ b/provisioning/roles/wazuh/vars/repo.yml @@ -3,10 +3,8 @@ wazuh_repo: yum: 'https://packages-dev.wazuh.com/4.x/yum/' gpg: 'https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH' key_id: '0DCFCA5547B19D2A6099506096B3EE5F29111145' -wazuh_winagent_config_url: "https://packages.wazuh.com/4.x/windows/wazuh-agent-{{ wazuh_agent_version }}-1.msi" -wazuh_winagent_package_name: "wazuh-agent-{{ wazuh_agent_version }}-1.msi" -certs_gen_tool_version: 4.8 +certs_gen_tool_version: "{{ CERTS_GEN_TOOL_VERSION }}" # Url of certificates generator tool -certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh" \ No newline at end of file +certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh" diff --git a/provisioning/roles/wazuh/vars/repo_pre-release.yml b/provisioning/roles/wazuh/vars/repo_pre-release.yml index 23469ce116..cd3e8fee4f 100644 --- a/provisioning/roles/wazuh/vars/repo_pre-release.yml +++ b/provisioning/roles/wazuh/vars/repo_pre-release.yml @@ -3,10 +3,8 @@ wazuh_repo: yum: 'https://packages-dev.wazuh.com/pre-release/yum/' gpg: 'https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH' key_id: '0DCFCA5547B19D2A6099506096B3EE5F29111145' -wazuh_winagent_config_url: "https://packages-dev.wazuh.com/pre-release/windows/wazuh-agent-{{ wazuh_agent_version }}-1.msi" -wazuh_winagent_package_name: "wazuh-agent-{{ wazuh_agent_version }}-1.msi" -certs_gen_tool_version: 4.8 +certs_gen_tool_version: "{{ CERTS_GEN_TOOL_VERSION }}" # Url of certificates generator tool -certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh" \ No newline at end of file +certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh" diff --git a/provisioning/roles/wazuh/vars/repo_staging.yml b/provisioning/roles/wazuh/vars/repo_staging.yml index 06343c8802..6c53daed4c 100644 --- a/provisioning/roles/wazuh/vars/repo_staging.yml +++ b/provisioning/roles/wazuh/vars/repo_staging.yml @@ -3,10 +3,8 @@ wazuh_repo: yum: 'https://packages-dev.wazuh.com/staging/yum/' gpg: 'https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH' key_id: '0DCFCA5547B19D2A6099506096B3EE5F29111145' -wazuh_winagent_config_url: "https://packages-dev.wazuh.com/staging/windows/wazuh-agent-{{ wazuh_agent_version }}-1.msi" -wazuh_winagent_package_name: "wazuh-agent-{{ wazuh_agent_version }}-1.msi" -certs_gen_tool_version: 4.8 +certs_gen_tool_version: "{{ CERTS_GEN_TOOL_VERSION }}" # Url of certificates generator tool -certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh" \ No newline at end of file +certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh" diff --git a/provisioning/roles/wazuh/wazuh-dashboard/defaults/main.yml b/provisioning/roles/wazuh/wazuh-dashboard/defaults/main.yml index d26912bfa2..13f0527ee9 100644 --- a/provisioning/roles/wazuh/wazuh-dashboard/defaults/main.yml +++ b/provisioning/roles/wazuh/wazuh-dashboard/defaults/main.yml @@ -13,13 +13,9 @@ dashboard_node_name: node-1 dashboard_server_host: "0.0.0.0" dashboard_server_port: "443" dashboard_server_name: "dashboard" -wazuh_version: 4.8.0 indexer_cluster_nodes: - 127.0.0.1 -# The Wazuh dashboard package repository -dashboard_version: "4.8.0" - # API credentials wazuh_api_credentials: - id: "default" diff --git a/provisioning/roles/wazuh/wazuh-dashboard/tasks/Debian.yml b/provisioning/roles/wazuh/wazuh-dashboard/tasks/Debian.yml index 54610f2a45..c797319a19 100644 --- a/provisioning/roles/wazuh/wazuh-dashboard/tasks/Debian.yml +++ b/provisioning/roles/wazuh/wazuh-dashboard/tasks/Debian.yml @@ -20,17 +20,6 @@ ] state: present - - name: Install Wazuh dashboard - apt: - name: "wazuh-dashboard={{ dashboard_version }}-*" - state: present - update_cache: yes - register: install - - tags: - - install - when: not wazuh_custom_packages_installation_dashboard_enabled - - include_tasks: "install_from_custom_package.yml" when: - wazuh_custom_packages_installation_dashboard_enabled diff --git a/provisioning/roles/wazuh/wazuh-dashboard/tasks/RedHat.yml b/provisioning/roles/wazuh/wazuh-dashboard/tasks/RedHat.yml index 4ff1a0b451..1fc7b631c2 100644 --- a/provisioning/roles/wazuh/wazuh-dashboard/tasks/RedHat.yml +++ b/provisioning/roles/wazuh/wazuh-dashboard/tasks/RedHat.yml @@ -18,17 +18,6 @@ state: present ignore_errors: yes - - name: Install Wazuh dashboard - package: - name: "wazuh-dashboard-{{ dashboard_version }}" - state: present - update_cache: yes - register: install - - tags: - - install - when: not wazuh_custom_packages_installation_dashboard_enabled - - include_tasks: "install_from_custom_package.yml" when: - wazuh_custom_packages_installation_dashboard_enabled diff --git a/provisioning/roles/wazuh/wazuh-dashboard/vars/debian.yml b/provisioning/roles/wazuh/wazuh-dashboard/vars/debian.yml deleted file mode 100644 index ad178fecc1..0000000000 --- a/provisioning/roles/wazuh/wazuh-dashboard/vars/debian.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -dashboard_version: 4.8.0 diff --git a/provisioning/roles/wazuh/wazuh-indexer/defaults/main.yml b/provisioning/roles/wazuh/wazuh-indexer/defaults/main.yml index d073abbaac..6da93258de 100644 --- a/provisioning/roles/wazuh/wazuh-indexer/defaults/main.yml +++ b/provisioning/roles/wazuh/wazuh-indexer/defaults/main.yml @@ -5,7 +5,6 @@ wazuh_custom_packages_installation_indexer_deb_url: "" wazuh_custom_packages_installation_indexer_rpm_url: "" # Cluster Settings -indexer_version: 4.8.0 single_node: false indexer_node_name: node-1 diff --git a/provisioning/roles/wazuh/wazuh-indexer/tasks/Debian.yml b/provisioning/roles/wazuh/wazuh-indexer/tasks/Debian.yml index 4eccabee54..9957331f53 100644 --- a/provisioning/roles/wazuh/wazuh-indexer/tasks/Debian.yml +++ b/provisioning/roles/wazuh/wazuh-indexer/tasks/Debian.yml @@ -18,30 +18,6 @@ ] state: present -- name: Install wazuh-indexer - block: - - name: Add Wazuh indexer repository - block: - - name: Add apt repository signing key - apt_key: - url: "{{ wazuh_repo.gpg }}" - state: present - - - name: Add Wazuh indexer repository - apt_repository: - repo: "{{ wazuh_repo.apt }}" - state: present - filename: 'wazuh-indexer' - update_cache: yes - - - name: Install Wazuh indexer - apt: - name: wazuh-indexer={{ indexer_version }}-1 - state: present - register: install - tags: install - when: not wazuh_custom_packages_installation_indexer_enabled - - include_tasks: "install_from_custom_package.yml" when: - wazuh_custom_packages_installation_indexer_enabled diff --git a/provisioning/roles/wazuh/wazuh-indexer/tasks/RedHat.yml b/provisioning/roles/wazuh/wazuh-indexer/tasks/RedHat.yml index 690b5435b4..66a53253de 100644 --- a/provisioning/roles/wazuh/wazuh-indexer/tasks/RedHat.yml +++ b/provisioning/roles/wazuh/wazuh-indexer/tasks/RedHat.yml @@ -43,14 +43,6 @@ - wget - unzip - - name: Install Wazuh indexer - package: - name: wazuh-indexer-{{ indexer_version }} - state: present - register: install - tags: install - when: not wazuh_custom_packages_installation_indexer_enabled - tags: - install