tools/testing/enrollment-simulator/README.md
A performance testing tool for the Wazuh authentication daemon (wazuh-manager-authd). This simulator generates concurrent SSL connections to test agent enrollment scenarios under various load conditions.
The enrollment simulator creates multiple threads that simultaneously attempt to register agents with the Wazuh authentication daemon. It supports various agent configurations and provides detailed performance statistics including response times, success rates, and throughput metrics.
cd tools/testing/enrollment-simulator
# Configure the build
cmake -B build
# Build the project
cmake --build build
The executable `enrollment-simulator` will be created in the `build/` directory.
## Usage
### Basic Usage
```bash
./enrollment-simulator --host localhost --port 1515 --total 1000 --threads 4
| Option | Description | Default |
|---|---|---|
--host HOST | Target Wazuh server hostname or IP | localhost |
--port PORT | Target port for wazuh-manager-authd | 1515 |
--password PASS | Correct authentication password (optional) | none |
--threads N | Number of concurrent threads | 4 |
--total N | Total number of registrations to perform | 10000 |
--new-ratio RATIO | Ratio of new agents (0.0-1.0) | 0.5 |
--incorrect-pass-ratio RATIO | Ratio of incorrect passwords (0.0-1.0) | 0.01 |
--modern-version-ratio RATIO | Ratio of modern version agents (0.0-1.0) | 0.05 |
--group-ratio RATIO | Ratio of agents with group assignment (0.0-1.0) | 0.5 |
--connect-delay MS | Delay before TLS handshake in milliseconds | 0 |
--send-delay MS | Delay before sending request in milliseconds | 0 |
--log-file FILE | Write output to file (and stdout) | - |
--csv-file FILE | Export results to CSV file | - |
--help | Show help message | - |
The --password option is optional. When omitted, enrollment requests are sent without authentication.
Both --connect-delay and --send-delay support range specifications:
100 (fixed 100ms delay)100-500 (random delay between 100-500ms)./enrollment-simulator --host 192.168.1.100 --total 5000 --threads 8
./enrollment-simulator \
--host production-server \
--total 10000 \
--threads 16 \
--connect-delay 50-200 \
--send-delay 10-100 \
--csv-file results.csv
./enrollment-simulator \
--host localhost \
--total 1000 \
--incorrect-pass-ratio 0.1 \
--new-ratio 0.8 \
--log-file error-test.log
The simulator provides real-time progress updates and comprehensive statistics:
Starting simulation with 4 threads...
Total registrations: 10000
Target server: localhost:1515
Connect delay: 0 ms
Send delay: 0 ms
Press Ctrl+C to stop early and see partial results
------------------------------------------------------------
Progress: 2500 registrations completed...
============================================================
SIMULATION RESULTS
============================================================
Overall Statistics:
Target registrations: 10000
Completed registrations: 10000 (100.00% of target)
Successful: 9950 (99.50%)
Failed: 50 (0.50%)
Total time: 45.23 seconds
Throughput: 221.12 registrations/second
Response Time Statistics (ms):
Min: 2.34
Max: 156.78
Mean: 18.45
Median: 15.67
Std Dev: 12.34
Statistics by Category:
------------------------------------------------------------
...
When using --csv-file, detailed metrics are exported including:
SSL_VERIFY_NONE for testing)This tool is part of the Wazuh project and follows the same licensing terms.