Closed QU3B1M closed 1 year ago
Tester | PR commit |
---|---|
@QU3B1M | cd53064 |
OS | OS version | Deployment | Image/AMI | Notes |
---|---|---|---|---|
Ubuntu | 22.04 | LOCAL \| Vagrant |
generic/ubuntu2204 |
wazuh-manager |
---|
deb |
Test execution was successful :green_circle:. When this manual test is approved and the core's PR merged, this QA PR that fixes wazuh_db
automated tests must also be merged.
cluster
with 2 worker
nodes wazuh-agents
connected assigned to 2 groupswazuh-agents
master
node.Then the groups_hash
reported from all the cluster nodes
are correct :red_circle:.
group hash origin | value |
---|---|
Real group hash | da39a3ee5e6b4b0d3255bfef95601890afd80709 |
Reported by master | 4672826f83e477ad4e24bbe43a718a5fa89e9c24 |
Reported by worker-1 | 94d6180a1569171c230635d7ccdc8fa488bf9e93 |
Reported by worker-2 | 94d6180a1569171c230635d7ccdc8fa488bf9e93 |
global_hash
A bug was found in the generation of global_hash
where it includes the group_hash of the agent 000
, as it is typically Null in most cases it does not have any impact, but if for any reason the group_hash
of the agent 000
is not Null it will causes inconsistencies in the global_group_hash
reported from the master
and the workers
. Testing paused until it is fixed.
The error in the global_hash
generation was fixed in this PR, the testing is restarted as there is a new commit, everything should be tested again.
After this fix one of our IT tests started to fail, after some research it was found that the test test_wazuh_db/test_sync_agent_groups_get.py
compares the global_hash
generated by wazuh to a hardcoded hash from the test case yaml.
An issue was created to fix this test:
group_hash
is generated correctly when new agents are connected :green_circle:master
:green_circle: master
:green_circle: workers
:green_circle: group_hash
is generated correctly when agents are removed :green_circle:master
:green_circle: master
:green_circle: workers
:green_circle: group_hash
is generated correctly when new agents are connected :green_circle:master
:green_circle: master
:green_circle: workers
:green_circle: group_hash
is generated correctly when agents are removed :green_circle:master
:green_circle: master
:green_circle: workers
:green_circle: Everything seems to be working properly.
Description
This issue aims to validate the Inconsistent behavior in wazuh-db during agent-groups insertion is fixed. The master and the workers must always have the
groups-hash
updated and synchronized between themProposed checks
[x]
group_hash
is generated correctly when new agents are connected.Test case
-Connect one agent
1. Configure the test environment. 2. Connect one `wazuh-agent`. 3. Create 2 groups and assign the agent to both. 4. Calculate the actual `groups_hash` and check it matches with the reported from the nodes.Connect one agent to each node
wazuh-agent
to each cluster's node.groups_hash
and check it matches with the reported from the nodes.Connect 50k agents and restart the `master`
wazuh-agents
.master
.groups_hash
reported from themaster
and theworker
.groups_hash
and check it matches with the reported from the nodes.Connect 10k agents to each node and restart the `master`
wazuh-agents
to each node.master
.groups_hash
reported from themaster
and theworker
.groups_hash
and check it matches with the reported from the nodes.Connect 10k agents to each node and restart the `workers`
wazuh-agents
to each node.workers
.groups_hash
reported from themaster
and theworker
.groups_hash
and check it matches with the reported from the nodes.[x]
group_hash
is generated correctly when agents are removed.Test case
-Remove 50k agents and restart the
1. Configure the test environment. 2. Connect 50k `wazuh-agents`. 3. Create 2 groups and assign all agents to both. 4. Delete all the groups and agents and immediately restart the `master`. 5. Get the `groups_hash` reported from the `master` and the `worker`. 6. Calculate the actual `groups_hash` and check it matches with the reported from the nodes.master
Remove 10k agents from each node and restart the
master
wazuh-agents
to each node.master
.groups_hash
reported from themaster
and theworker
.groups_hash
and check it matches with the reported from the nodes.Remove 10k agents from each node and restart the
workers
wazuh-agents
to each node.workers
.groups_hash
reported from themaster
and theworker
.groups_hash
and check it matches with the reported from the nodes.Remove one agent
wazuh-agent
.wazuh-agent
.groups_hash
reported from themaster
and theworker
.groups_hash
and check it matches with the reported from the nodes.Environment
Fix application methods
OS
Configuration and considerations