Skip to content

Commit

Permalink
Merge branch '4.8.0' into fix/5368-remove-false-positive-CVE-2023-4822
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebits committed May 22, 2024
2 parents ae4509c + e62180d commit fca26be
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ All notable changes to this project will be documented in this file.

### Changed

- Disable debug evidences for Vulnerability Detector E2E tests by default ([#5331](https://github.com/wazuh/wazuh-qa/pull/5331)) \- ( Tests)
- Include new package information from wdb ([#5350](https://github.com/wazuh/wazuh-qa/pull/5350)) \- (Tests)
- Disable debug evidences for Vulnerability Detector E2E tests by default ([#5331](https://github.com/wazuh/wazuh-qa/pull/5331)) \- (Tests)
- Include CVE-2023-4822 vulnerability to grafana packages ([#5332](https://github.com/wazuh/wazuh-qa/pull/5332)) \- (Framework)
- Remove sslverify from host manager install package method ([#5339](https://github.com/wazuh/wazuh-qa/pull/5339)) \- (Framework)
- Include additional Vulnerability Detector E2E tests ([#5287](https://github.com/wazuh/wazuh-qa/pull/5287)) \- (Framework + Tests)
Expand Down Expand Up @@ -62,6 +63,9 @@ All notable changes to this project will be documented in this file.
### Fixed

- Remove false positive from E2E Vulnerability Detection tests ([#5369](https://github.com/wazuh/wazuh-qa/pull/5369)) \- (Framework)
- Fix multigroups guess system test ([#5396](https://github.com/wazuh/wazuh-qa/pull/5396)) \- (Tests)
- Fix hotfixes syscollector agent simulator messages ([#5379](https://github.com/wazuh/wazuh-qa/pull/5379)) \- (Framework)
- Fix restart agent in change manager Vulnerability Detector E2E test case ([#5355](https://github.com/wazuh/wazuh-qa/pull/5355)) \- (Tests)
- Fix E2E Vulnerability Detection Windows package installation error ([#5363](https://github.com/wazuh/wazuh-qa/pull/5363)) \- (Framework)
- Fix shutdown messages system test ([#5298](https://github.com/wazuh/wazuh-qa/pull/5298)) \- (Framework + Tests)
- Fix upgrade macOS package cases for vulnerability scanner E2E ([#5334](https://github.com/wazuh/wazuh-qa/pull/5334)) \- (Tests)
Expand Down
2 changes: 1 addition & 1 deletion deps/wazuh_testing/wazuh_testing/tools/agent_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ def __init__(self, agent_name, mq='d', tag='syscollector'):

self.syscollector_event_type_mapping = {
'packages': 'dbsync_packages',
'hotfix': 'dbsync_hotfix',
'hotfix': 'dbsync_hotfixes',
'hwinfo': 'dbsync_hwinfo',
'ports': 'dbsync_ports',
'osinfo': 'dbsync_osinfo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,19 @@ def permutate_agents_managers(self, host_manager):
)
change_agent_manager_ip(host_manager, agent, manager_ip)

# Restart agents to apply the new configuration changes
logging.error("Restarting agents")
host_manager.control_environment("restart", ["agent"], parallel=True)

yield

# Restore the original configuration after tests are done
restore_configuration(host_manager, backup_configuration)

# Restart agents again to ensure they reconnect with their original managers
logging.error("Restarting agents")
host_manager.control_environment("restart", ["agent"], parallel=True)

@pytest.mark.parametrize("preconditions, body, teardown", single_vulnerable_case_complete_list,
ids=single_vulnerable_case_list_ids,)
def test_install_vulnerable_package_when_agent_down(self, host_manager, request, record_property, preconditions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from system import (ERR_MSG_CLIENT_KEYS_IN_MASTER_NOT_FOUND, check_agent_groups, check_keys_file,
create_new_agent_group, delete_agent_group, remove_cluster_agents,
assign_agent_to_new_group, restart_cluster)
from wazuh_testing import T_10, T_20
from wazuh_testing.tools.system import HostManager
from wazuh_testing.tools.file import replace_regex_in_file
from wazuh_testing.tools.system_monitoring import HostMonitor
Expand All @@ -73,8 +74,6 @@
# Variables
group_id = 'group_test'
multigroups_id = 'default,group_test'
# this timeout is temporality, this test will be update
timeout = 20


# Fixtures
Expand Down Expand Up @@ -135,7 +134,7 @@ def test_guess_single_group(target_node, status_guess_agent_group, clean_environ
'''
# Restart master to apply local internal options
restart_cluster([test_infra_managers[0]], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Create new group
create_new_agent_group(test_infra_managers[0], group_id, host_manager)
Expand All @@ -156,7 +155,7 @@ def test_guess_single_group(target_node, status_guess_agent_group, clean_environ
# Remove agent from default to test single group guess (not multigroup)
host_manager.run_command(test_infra_managers[0], f"/var/ossec/bin/agent_groups -q -r -i {agent_id} -g default")

time.sleep(timeout)
time.sleep(T_20)

# Check that agent has group set to group_test on Managers
check_agent_groups(agent_id, group_id, test_infra_managers, host_manager)
Expand All @@ -173,7 +172,7 @@ def test_guess_single_group(target_node, status_guess_agent_group, clean_environ

# Restart agent
restart_cluster([test_infra_agents[0]], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Check if remoted.guess_agent_group is disabled
expected_group = 'default' if int(status_guess_agent_group) == 0 else group_id
Expand Down Expand Up @@ -228,7 +227,7 @@ def test_guess_multigroups(n_agents, target_node, status_guess_agent_group, clea
'''
# Restart master to apply local internal options
restart_cluster([test_infra_managers[0]], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Create new group
create_new_agent_group(test_infra_managers[0], group_id, host_manager)
Expand All @@ -241,6 +240,7 @@ def test_guess_multigroups(n_agents, target_node, status_guess_agent_group, clea

# Restart agent
restart_cluster(test_infra_agents, host_manager)
time.sleep(T_10)

# Check that agent has client key file
for agent in range(n_agents):
Expand All @@ -250,7 +250,7 @@ def test_guess_multigroups(n_agents, target_node, status_guess_agent_group, clea
# Create new group and assing agent
for agent in range(n_agents):
assign_agent_to_new_group(test_infra_managers[0], group_id, agents_data[agent][1], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Check that agent has group set to group_test on Managers
for agent in range(n_agents):
Expand All @@ -268,7 +268,7 @@ def test_guess_multigroups(n_agents, target_node, status_guess_agent_group, clea

# Restart agent
restart_cluster([test_infra_agents[0]], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Check if remoted.guess_agent_group is disabled
expected_group = 'default' if int(status_guess_agent_group) == 0 or n_agents == 1 else multigroups_id
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.8.0",
"revision": "40809"
"revision": "40810"
}

0 comments on commit fca26be

Please sign in to comment.