wazuh / wazuh-agent

Wazuh agent, the Wazuh agent for endpoints.
GNU Affero General Public License v3.0
32 stars 18 forks source link

Test Wazuh Agent with Mock Server Using Docker and Imposter #281

Closed vikman90 closed 2 days ago

vikman90 commented 2 weeks ago

Description

To thoroughly test the Wazuh Agent’s interaction with a server, we need to set up a mock server capable of handling several key use cases. Specifically, this includes:

  1. Agent Registration – Testing the process of registering a new agent with the server.
  2. Stateless Message Sending – Verifying the agent’s ability to send messages without expecting a response or maintaining a session.
  3. Stateful Message Sending – Testing the agent’s capacity to send messages while maintaining state (e.g., sessions).

To implement this, we will create a Docker container using Imposter as the mock server, which will facilitate these tests in a controlled environment.

Requirements

Tasks

  1. Set up a Docker environment with Imposter as the mock server.
  2. Configure Imposter to support SSL connections.
  3. Define mock endpoints for:
    • Agent registration
    • Stateless message handling
    • Stateful message handling
  4. Document the setup and configuration steps to replicate the testing environment.
  5. Implement test cases to verify that the Wazuh Agent can successfully communicate with the mock server in each of the defined scenarios.
vikman90 commented 2 weeks ago

Work progress

November 7

November 11

November 15

November 18

November 19

November 20