Closed Nicogp closed 4 months ago
In order to develop this test two principal test cases are necessary: 0- Provisioning environment: One manager and 2 agents with only agent1 connected.
Case 1
0- Deactivate autoenrrolment.
1- Copy Agent 1 key
2- Paste Agent 1 key in the Agent2 client.keys file (/var/ossec/etc/client.keys)
3- Connect Agent 2
Expected Result: agent will be rejected with message log "Agent key already in use: agent ID {id}". Log example: 2022/01/19 19:52:11 wazuh-remoted: WARNING: Agent key already in use: agent ID '007'
Case 2
0- Autoenrrolment active by default.
1- Copy Agent 1 key
2- Paste Agent 1 key in the Agent2 client.keys file (/var/ossec/etc/client.keys)
3- Connect Agent 2
Expected Result: the manager will assign a new client.keys configuration to the second agent.
Working branch: 2456-test-prevent-same-key-config
Description:
This issue is associated with https://github.com/wazuh/wazuh/issues/10172. Main goal of this test is reject same key configuration agent. When manager receive same key configuration from a new connection, and that agent has a different socket number, the new connection is rejected.
Category:
Environment requirements:
Warning:
General configuration:
Expected behavior:
2022/01/19 19:52:11 wazuh-remoted: WARNING: Agent key already in use: agent ID '007'
DoD
pycodestyle --max-line-length=120 --show-source --show-pep8 file.py
.1864-qa-docs-fixes