From 77da068720e4eaadb9ccd98884d1fc470f8f7275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Fri, 14 Jun 2024 10:17:43 +0100 Subject: [PATCH 1/5] fix: update wazuh_template_branch to 4.8.1 --- provisioning/roles/wazuh/ansible-filebeat-oss/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/roles/wazuh/ansible-filebeat-oss/defaults/main.yml b/provisioning/roles/wazuh/ansible-filebeat-oss/defaults/main.yml index 4af68ae478..affd0222ab 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.0 +wazuh_template_branch: 4.8.1 filebeat_node_name: node-1 From 053b78c80db8909c4e3c96d5964ce94c116fc886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Mon, 17 Jun 2024 15:35:34 +0100 Subject: [PATCH 2/5] feat: include abuseControl timeout to initial VD tests --- .../test_vulnerability_detector.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py index 1c50c90194..4fcdf301a7 100644 --- a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py +++ b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py @@ -71,8 +71,11 @@ from wazuh_testing.end_to_end.waiters import wait_until_vd_is_updated from wazuh_testing.tools.system import HostManager + pytestmark = [pytest.mark.e2e, pytest.mark.vulnerability_detector, pytest.mark.tier0] +# Wazuh Indexer abuseControl timeout set to 30 minutes (1800 seconds) +MINIMUM_TIMEOUT_RESCAN = 1800 AGENTS_SCANNED_FIRST_SCAN = [] FIRST_SCAN_TIME = None @@ -318,7 +321,10 @@ def test_first_syscollector_scan( ) logging.critical("Waiting until agent all agents have been scanned.") - time.sleep(TIMEOUT_PER_AGENT_VULNERABILITY_FIRST_SCAN * len(AGENTS_SCANNED_FIRST_SCAN)) + + time_to_wait = max(TIMEOUT_PER_AGENT_VULNERABILITY_FIRST_SCAN * len(AGENTS_SCANNED_FIRST_SCAN), + MINIMUM_TIMEOUT_RESCAN) + time.sleep(time_to_wait) logging.critical("Checking vulnerabilities in the index") vuln_by_agent_index = get_vulnerabilities_from_states_by_agent( From 7433697b490a76cb10940504ff7574e60e3aee05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Tue, 18 Jun 2024 13:20:38 +0100 Subject: [PATCH 3/5] feat: increase time in 30 minutes always --- .../test_vulnerability_detector.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py index 4fcdf301a7..260033a04b 100644 --- a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py +++ b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py @@ -320,11 +320,13 @@ def test_first_syscollector_scan( "Syscollector scan not started in any agent. Check agent logs for more information" ) + + logging.critical("Waiting 30 minutes to avoid Indexer abuseControl.") + time.sleep(MINIMUM_TIMEOUT_RESCAN) + logging.critical("Waiting until agent all agents have been scanned.") + time.sleep(TIMEOUT_PER_AGENT_VULNERABILITY_FIRST_SCAN * len(AGENTS_SCANNED_FIRST_SCAN)) - time_to_wait = max(TIMEOUT_PER_AGENT_VULNERABILITY_FIRST_SCAN * len(AGENTS_SCANNED_FIRST_SCAN), - MINIMUM_TIMEOUT_RESCAN) - time.sleep(time_to_wait) logging.critical("Checking vulnerabilities in the index") vuln_by_agent_index = get_vulnerabilities_from_states_by_agent( From 8b40e589e7efdb9212b0ebcc999eb4381afaaa64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Tue, 18 Jun 2024 13:22:28 +0100 Subject: [PATCH 4/5] style: remove extra whitespaces --- .../test_vulnerability_detector/test_vulnerability_detector.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py index 260033a04b..238b791679 100644 --- a/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py +++ b/tests/end_to_end/test_vulnerability_detector/test_vulnerability_detector.py @@ -320,14 +320,12 @@ def test_first_syscollector_scan( "Syscollector scan not started in any agent. Check agent logs for more information" ) - logging.critical("Waiting 30 minutes to avoid Indexer abuseControl.") time.sleep(MINIMUM_TIMEOUT_RESCAN) logging.critical("Waiting until agent all agents have been scanned.") time.sleep(TIMEOUT_PER_AGENT_VULNERABILITY_FIRST_SCAN * len(AGENTS_SCANNED_FIRST_SCAN)) - logging.critical("Checking vulnerabilities in the index") vuln_by_agent_index = get_vulnerabilities_from_states_by_agent( host_manager, From aa36bf7b82ccc04700d64b48c9b57d2823e47e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rebollo=20P=C3=A9rez?= Date: Wed, 19 Jun 2024 10:43:58 +0100 Subject: [PATCH 5/5] docs: include 5432 changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c67e0c56d..b55b1e1d68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## [4.8.1] - TBD +### Changed + +- 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 ### Added