wazuh / wazuh-agent

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

Add Mock Server for Wazuh Agent #323

Closed vikman90 closed 2 days ago

vikman90 commented 2 days ago
Related issue
Closes #281

Description

This PR introduces a mock server based on Imposter to simulate the Wazuh Agent's Comms API (port 27000) and Management API (port 55000). The mock server supports HTTP and HTTPS protocols, logs stateful and stateless requests, and facilitates testing the agent's interactions without requiring a full backend setup.

The mock server is distributed as a Docker environment and includes a script to simplify execution and configuration.

Usage

Command-line Options

The server script supports the following options: Option Description Default
--comms-port <PORT> Comms API port 27000
--http Use HTTP
--https Use HTTPS
--log-stateful Log stateful requests
--log-stateless Log stateless requests
--mgmt-port <PORT> Management API port 55000

Requirements

Example

To start the mock server with default settings:

./mock-server

To use HTTP instead of HTTPS and log stateful requests:

./mock-server --http --log-stateful

09:07:37 INFO i.g.i.Imposter - Starting mock engine 4.2.1 09:07:41 INFO i.g.i.Imposter - Mock engine up and running on https://localhost:8443