1.0 ADBox test case specifications
1.1 Deploy ADBox via Docker and shell scripts TST-001
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- 26 GB storage on the machine
- git version 2.44.0
Test steps
-
Clone the ADBox repository.
git clone https://github.com/AbstractionsLab/idps-escape.git -
Change the working directory to the cloned folder containing all the files along with the Dockerfile.
cd siem-mtad-gat
- Build the image.
3a. Make the script executable: chmod +x build-adbox.sh
3b. And execute it as follows
./build-adbox.sh
- Run the container by executing the bash file containing the run commands.
4a. Make it executable: chmod +x adbox/adbox.sh
4b. And execute it as follows
./adbox/adbox.sh -h
Expected outcome
Step 1. A copy of siem-mtad-gat folder in local folder
Step 3. In the list of docker images (docker images), the following should be present
REPOSITORY TAG IMAGE ID CREATED SIZE
siem-mtad-gat v0.1.4 ... ... ...
Step 4b. Display ADBox help message
usage: driver.py [-h] [-i] [-u USECASE] [-c] [-s]
IDPS-ESCAPE ADBox, an open-source anomaly detection toolbox, developed in project CyFORT.
options:
-h, --help show this help message and exit
-i, --interactive run the interactive console for training and prediction
-u USECASE, --usecase USECASE
specify a configuration scenario/use-case file for training and prediction
-c, --connection check connection with Wazuh
-s, --shipping enable data shipping to Wazuh
Parent links: SRS-046 Cross-platform ADBox deployment
Child links: TRP-001 TCER: Deploy ADBox via Docker and shell scripts, TRP-023 TCER: ADBox deployment
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 1 |
| test_data | see referenced files |
| version | 0.2 |
1.3 Install ADBox as dev container TST-003
Preconditions and setup actions
- Docker engine version 26.1.3
- Docker desktop version 1.0.35
- Visual Studio Code version 1.83.1 (system setup)
- Dev Containers extension for VS Code by Microsoft version v0.315.1
- at least 26 GB of persistent/disk storage
Test steps
- Clone this repository:
git clone https://github.com/AbstractionsLab/idps-escape.git - Start Docker Desktop if not already running.
- Open the project folder in VS Code.
- Select the "Reopen in Container" option in the notification that pops up in VS Code or run it via the command palette.
- Open a terminal in VS Code and run
poetry installin the container to install all dependencies. - Run ADBox using its entrypoint.
poetry run adbox
Expected outcome
Step 1. Repository creation
Step 4. Container created and terminal open.
Step 5. Poetry install terminated with Installing the current project: siem-mtad-gat (0.1.4).
Step 6. Run ADBox default mode:
IDPS-ESCAPE ADBox running in default mode
Are you sure you wish to run the default ADBox in default mode? (y/n):
Parent links: SRS-044 Platform-Independent Deployment
Child links: TRP-003 TCER: Install ADBox as dev container, TRP-004 TCER: Install ADBox as dev container, TRP-020 TCER: Install ADBox as dev container, TRP-024 TCER: ADBox in dev container
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.4 Run ADBox console TST-004
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running.
Test steps
- Run the container “siem-mtad-gat-container” by executing the adbox script without any parameters.
./adbox/adbox.sh -i
Expected outcome
ADBox starts with
IDPS-ESCAPE ADBox driver running in interactive console mode.
Enter a number and press enter to select an ADBox action to perform:
1. Train an anomaly detector.
2. Predict anomalies using one of the available detectors.
3. Select an existing anomaly detector for prediction.
4. Exit
Enter a number (1-4):
Parent links: SRS-047 Interactive Use Case Builder
Child links: TRP-005 TCER: Run ADBox console, TRP-025 TCER: ADBox console
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.5 Run ADBox in default mode with a Wazuh connection TST-005
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - An instance of a Wazuh distribution should be running.
- Wazuh indexer RESTful API should be listening on port 9200.
- TST-034 and TST-035 should succeed
Test steps
- Run the container “siem-mtad-gat-container” by executing the adbox script without any parameters.
./adbox/adbox.sh - Input
yafterAre you sure you wish to run the default ADBox in default mode? (y/n):
Expected outcome
- ADBox starts with
IDPS-ESCAPE ADBox running in default mode
Are you sure you wish to run the default ADBox in default mode? (y/n): y
No input use-case: a detection with default config will be created.
Start training pipeline.
Init Data managers.
JSON file 'detector_input_parameters.json' saved at /home/alab/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}/input/detector_input_parameters.json.
Data ingestion.
...
- A detector {detector_id} is trained according to the default parameters specified in
siem_mtad_gat/assets/default_configs/default_detector_input_config.json. - Training response should be seen in the console.
- Training outputs and artifacts should be available in the following folder:
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}.
Parent links: SRS-048 Default Detector Training
Child links: TRP-006 TCER: Run ADBox in default mode with a Wazuh connection, TRP-026 TCER: ADBox in default mode with Wazuh
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.2 |
1.6 Run ADBox in default mode without a Wazuh connection TST-006
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.0 - No existing container named
“siem-mtad-gat-container”should be running. - No instance of Wazuh distribution running.
Test steps
- Run the container “siem-mtad-gat-container” by executing the adbox script without any parameters.
./adbox/adbox.sh - Input
yafterAre you sure you wish to run the default ADBox in default mode? (y/n):
Expected outcome
- ADBox starts with
IDPS-ESCAPE ADBox running in default mode
Are you sure you wish to run the default ADBox in default mode? (y/n): y
No input use-case: a detection with default config will be created.
Start training pipeline.
Init Data managers.
JSON file 'detector_input_parameters.json' saved at /home/alab/siem-mtad-gat/siem_mtad_gat/assets/detector_models/fb5faf1c-7913-4e90-880f-51f3a178a053/input/detector_input_parameters.json.
Data ingestion.
Wazuh data ingestor establishing connection to Wazuh...
Could not establish a connection with OpenSearch.
More details see logs.
...
- A detector {detector_id} is trained according to the default parameters specified in
siem_mtad_gat/assets/default_configs/default_detector_input_config.jsonand using default stored data
...
The file '/home/alab/siem-mtad-gat/siem_mtad_gat/assets/data/train/sample-alerts-train-2024-11.json' does not exist, returning all default data.
...
- Training response should be seen in the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder.
Parent links: SRS-048 Default Detector Training
Child links: TRP-007 TCER: Run ADBox in default mode without a Wazuh connection, TRP-019 TCER: Run ADBox in default mode without a Wazuh connection
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.7 ADBox use case 1 with a Wazuh connection TST-007
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - An instance of a Wazuh distribution should be running.
- Wazuh indexer RESTful API should be listening on port 9200.
- Wazuh configured to monitor linux resource utilization. (Monitoring Linux resource usage with Wazuh)
2024-07-*index not empty.- TST-034 and TST-035 should succeed
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 1 parameters../adbox/adbox.sh -u 1
Expected outcome
- ADBox starts with
IDPS-ESCAPE ADBox driver running use-case scenario configuration uc_1.yaml. - The training should run for 10 epochs.
- Training response should be seen in the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with the message
Predicting in real-time mode with interval 1 (min). - A prediction response should be seen in the output console after every 1 minute.
- Prediction outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}/predictionfolder.
Parent links: SRS-027 ML-Based Anomaly Detection
Child links: TRP-008 TCER: ADBox use case 1 with a Wazuh connection
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.8 ADBox use case 1 without a Wazuh connection TST-008
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - No instance of Wazuh distribution running.
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 1 parameters.
./adbox/adbox.sh -u 1
Expected outcome
- ADBox starts with
Running AD driver with user configuration uc_1.yaml. - Output screen should show the message
Could not establish a connection with OpenSearch. - And collect training data from the default file with message
Returning data from file /home/root/siem-mtad-gat/siem_mtad_gat/assets/data/train/sample-alerts-train-2024-07.json. - The training should run for 10 epochs.
- Training response should be seen in the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with message
Predicting in real-time mode with interval 1 (min). - Output screen should show the following messages:
Could not establish a connection with OpenSearch.Prediction in run_mode.REALTIME requires a connection with OpenSearch.No data found for given input.- And the application should exit.
Parent links: SRS-027 ML-Based Anomaly Detection
Child links: TRP-009 TCER: ADBox use case 1 without a Wazuh connection, TRP-018 TCER: ADBox use case 1 without a Wazuh connection
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.1 |
1.9 ADBox use case 2 with a Wazuh connection TST-009
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - An instance of a Wazuh distribution should be running.
- Wazuh indexer RESTful API should be listening on port 9200.
2024-07-*index not empty.- TST-034 and TST-035 should succeed
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 2 parameters../adbox/adbox.sh -u 2
Expected outcome
- ADBox starts with
Running AD driver with user configuration uc_2.yaml. - The training should run for 10 epochs.
- Training response should be seen in the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with message
Predicting in historical mode. - Prediction response should be seen in the output console.
- Prediction outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}/predictionfolder.
Parent links: SRS-035 Offline Anomaly Detection
Child links: TRP-010 TCER: ADBox use case 2 with a Wazuh connection, TRP-027 TCER: ADBox UC scenario 2 with Wazuh
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.10 ADBox use case 2 without a Wazuh connection TST-010
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - No instance of Wazuh distribution running.
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 2 parameters../adbox/adbox.sh -u 2
Expected outcome
- ADBox starts with
Running AD driver with user configuration uc_2.yaml. - Output screen should show the message
Could not establish a connection with OpenSearch. - And collect training data from the default file with message
Returning data from file /home/root/siem-mtad-gat/siem_mtad_gat/assets/data/train/sample-alerts-train-2024-07. - The training should run for 10 epochs.
- Training response should be seen on the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with message
Predicting in historical mode. - Output screen should show message
Could not establish a connection with OpenSearch. - And collect training data from default file with message
The file '/home/root/siem-mtad-gat/siem_mtad_gat/assets/data/predict/sample-alerts-predict-2024-07-26' does not exist, returning all default data., depending upon the date it was run. - Prediction response should be seen in the output console.
- Prediction outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}/predictionfolder.
Parent links: SRS-035 Offline Anomaly Detection
Child links: TRP-017 TCER: ADBox use case 2 without a Wazuh connection
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.11 ADBox use case 3 with a Wazuh connection TST-011
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - An instance of a Wazuh distribution should be running.
- Wazuh indexer RESTful API should be listening on port 9200.
2024-07-*index not empty.- TST-034 and TST-035 should succeed
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 3 parameters.
./adbox/adbox.sh -u 3
Expected outcome
- ADBox starts with
Running AD driver with user configuration uc_3.yaml. - The training should run for 10 epochs.
- Training response should be seen in the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with message
Predicting in batch mode with batch interval 5 (min). - Prediction response should be seen on the output console after every 5 minutes.
- Prediction outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}/predictionfolder.
Parent links: SRS-027 ML-Based Anomaly Detection
Child links: TRP-011 TCER: ADBox use case 3 with a Wazuh connection, TRP-028 TCER: ADBox UC scenario 3 with Wazuh
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.12 ADBox use case 3 without a Wazuh connection TST-012
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - No instance of Wazuh distribution running.
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 3 parameters.
./adbox/adbox.sh -u 3
Expected outcome
- ADBox starts with
Running AD driver with user configuration uc_3.yaml. - Output screen should show the message
Could not establish a connection with OpenSearch. - And collect training data from the default file with the message
Returning data from file /home/root/siem-mtad-gat/siem_mtad_gat/assets/data/train/sample-alerts-train-2024-07.json. - The training should run for 10 epochs.
- Train response should be seen on the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with message
Predicting in batch mode with batch interval 5 (min). - Output screen should show the following messages:
Could not establish a connection with OpenSearch.Prediction in run_mode.BATCH requires a connection with OpenSearch.No data found for given input.- And the application should exit.
Parent links: SRS-027 ML-Based Anomaly Detection
Child links: TRP-016 TCER: ADBox use case 3 without a Wazuh connection
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.1 |
1.13 ADBox use case 4 with a Wazuh connection TST-013
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.0 - No existing container named
siem-mtad-gat-containershould be running. - An instance of a Wazuh distribution should be running.
- Wazuh indexer RESTful API should be listening on port 9200.
- Wazuh agent configured to read Suricata logs.
- "2024-03-*" not empty.
- TST-034 and TST-035 should succeed
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 4 parameters.
./adbox/adbox.sh -u 4
Expected outcome
- ADBox starts with
Running AD driver with user configuration uc_4.yaml. - The training should run for 10 epochs.
- Training response should be seen in the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with message
Predicting in historical mode. - Prediction response should be seen in the output console.
- Prediction outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}/predictionfolder.
Parent links: SRS-038 Joint Host-Network Training
Child links: TRP-012 TCER: ADBox use case 4 with a Wazuh connection
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.14 ADBox use case 4 without a Wazuh connection TST-014
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - No instance of Wazuh distribution running.
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 4 parameters.
./adbox/adbox.sh -u 4
Expected outcome
- ADBox starts with
Running AD driver with user configuration uc_4.yaml. - Output screen should show message
Could not establish a connection with OpenSearch. - And collect training data from default file with message
Returning data from file /home/root/siem-mtad-gat/siem_mtad_gat/assets/data/train/sample-alerts-train-2024-03.json. - The training should run for 10 epochs.
- Training response should be seen on the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with message
Predicting in historical mode. - Output screen should show message
Could not establish a connection with OpenSearch. - And collect training data from default file with message
The file '/home/root/siem-mtad-gat/siem_mtad_gat/assets/data/predict/wazuh-alerts-*.*-2024.07.22.json' does not exist, returning all default data., depending upon the date it was run. - Prediction response should be seen on the output console.
- Prediction outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}/predictionfolder.
Parent links: SRS-038 Joint Host-Network Training
Child links: TRP-015 TCER: ADBox use case 4 without a Wazuh connection
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.15 ADBox use case 5 with a Wazuh connection TST-015
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - An instance of a Wazuh distribution should be running.
- Wazuh indexer RESTful API should be listening on port 9200.
- Wazuh agent configured to read Suricata logs.
- TST-034 and TST-035 should succeed
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 5 parameters../adbox/adbox.sh -u 5
Expected outcome
- ADBox starts with
Running AD driver with user configuration uc_5.yaml. - The training should run for 10 epochs.
- Training response should be seen in the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with message
Predicting in historical mode. - Prediction response should be seen on the output console.
- Prediction outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}/predictionfolder.
Parent links: SRS-037 Anomaly-Based NIDS
Child links: TRP-013 TCER: ADBox use case 5 with a Wazuh connection
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.16 ADBox use case 5 without a Wazuh connection TST-016
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - No instance of Wazuh distribution running.
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with use case 5 parameters.
./adbox/adbox.sh -u 5
Expected outcome
- ADBox starts with
Running AD driver with user configuration uc_5.yaml. - Output screen should show message
Could not establish a connection with OpenSearch. - And collect training data from default file with message
Returning data from file /home/root/siem-mtad-gat/siem_mtad_gat/assets/data/train/sample-alerts-train-2024-03.json. - The training should run for 10 epochs.
- Training response should be seen in the console.
- Training outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder. - Prediction starts after training with message
Predicting in historical mode. - Output screen should show message
Could not establish a connection with OpenSearch. - And collect training data from default file with message
The file '/home/root/siem-mtad-gat/siem_mtad_gat/assets/data/predict/wazuh-alerts-*.*-2024.07.22.json' does not exist, returning all default data., depending upon the date it was run. - Prediction response should be seen in the output console.
- Prediction outputs and artifacts should be available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}/predictionfolder.
Parent links: SRS-037 Anomaly-Based NIDS
Child links: TRP-014 TCER: ADBox use case 5 without a Wazuh connection
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.17 ADBox shipping install TST-017
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - An instance of a Wazuh distribution should be running.
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox script with shipping flag.
./adbox/adbox.sh -s
Expected outcome
CLI:
IDPS-ESCAPE ADBox shipping on
ADBox Shipper establishing connection to Wazuh...
ADBox shipper connected to Wazuh
Template for mtad_gat initialized
Exit shipper installation. Check ADBox templates and policy correct installation from Wazuh Dashboard!
Wazuh Dashboard* :
- Indexer Management>Index Management>Templates check for presence of base templates
adbox_stream_template,adbox_stream_template_mtad_gat; - Indexer Management>Index Management>Templates>Component templates check for presence of base templates
component_template_mtad_gat; - Indexer Management>Index Management>State management policies check for presence of the policy
adbox_detectors_rollover.
Parent links: SRS-049 Anomaly Shipping to Indexer
Child links: TRP-022 TCER: ADBox shipping install
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.18 ADBox Create detector data stream TST-018
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running. - An instance of a Wazuh distribution should be running.
Test steps
- Run the container
siem-mtad-gat-containerby executing the adbox use case 12 with shipping flag.
./adbox/adbox.sh -u 12 -s
Expected outcome
CLI:
- Training model for 2 epochs
IDPS-ESCAPE ADBox shipping on
ADBox Shipper establishing connection to Wazuh...
IDPS-ESCAPE ADBox driver running use case scenario configuration uc_12.yaml.
Start training pipeline.
Init Data managers.
JSON file 'detector_input_parameters.json' saved at /home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/1bda6dd3-0947-43e3-9ca2-bd3c711ae69f/input/detector_input_parameters.json.
Data ingestion.
Wazuh data ingestor establishing connection to Wazuh...
- Historical prediction: the start time shall be the present day at '00:06:00Z' (notice window size is 6 and granularity 1min) and the end time/present timestamp rounded to the closest unit timestamp.
Start prediction pipeline. Detector: 1bda6dd3-0947-43e3-9ca2-bd3c711ae69f
Init Data managers.
Spot object 0 loaded.
Spot object 1 loaded.
...
Prediction response:
{'run_mode': 'HISTORICAL', 'detector_id': '1bda6dd3-0947-43e3-9ca2-bd3c711ae69f', 'start_time': '2024-11-25T00:06:00Z', 'end_time': '2024-11-25T16:58:00Z', 'results': []}
Prediction ended
Local storage:
- Training outputs and artifacts available in the
/home/root/siem-mtad-gat/siem_mtad_gat/assets/detector_models/{detector_id}folder.
Wazuh Dashboard:
- When verifying the output using the dashboard vizualisations, remember that time shift due to TimeZone may apply.
- Indexer Management>Index Management>Templates check if the template
adbox_detector_mtad_gat_{detector_id}is there; - Indexer Management>Index Management>Templates> Component templates check if the templates
component_template_{detector_id}is there; - Indexer Management>Data streams check if
adbox_detector_mtad_gat_{detector_id}is there and contains at least a document.TST-18-detector-stream.png" width="80%" />
Parent links: SRS-042 Prediction Shipping Feature
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.19 ADBox Wazuh integration Dashboard TST-033
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- An instance of CyFORT-Wazuh distribution should be running.
- A detector data stream
adbox_detector_mtad_gat_{detector_id}available in Wazuh indexer
Test steps
A detailed description of the integration procedure can be found at docs/manual/dashboard_tutorial.md
- Open Dashboard Management.
- Select Dashboard Management>Index patterns and create a new index.
- Add the data stream pattern using the.
- Select
timestampas time field. - Finally, the pattern is created. The field names correspond to the prediction outcome fields.
Expected outcome
- The pattern is created. The field names correspond to the prediction outcome fields.
- The data can be navigated using Discover dashboard.
Parent links: SRS-043 AD Data Visualization
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 4 |
| test_data | see referenced files |
| version | 0.2 |
1.20 ADBox set up indexer host address TST-034
Preconditions and setup actions
- ADBox repository
https://github.com/AbstractionsLab/idps-escape.gitcloned on the host. - Wazuh central component deployed.
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running.
Test steps
- Open the cloned ADBox repository
- Open the
/siem_mtad_gat/assets/secrets/wazuh_credentials.json - Set "host" as indexer's host address
- Set "port" as indexer's port
- Run
./adbox/adbox.sh -c
Expected outcome
- Succesful connection
IDPS-ESCAPE ADBox checking connection with Wazuh/OpenSearch...
Wazuh data ingestor establishing connection to Wazuh...
Connection with Wazuh established successfully!
Parent links: SRS-017 Custom Data Source
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.21 ADBox change indexer credentials TST-035
Preconditions and setup actions
- ADBox repository
https://github.com/AbstractionsLab/idps-escape.gitcloned on the host. - Wazuh central component deployed.
- User with root privileges
- Built image
siem-mtad-gat:v0.1.4 - No existing container named
siem-mtad-gat-containershould be running.
Test steps
- Open the cloned ADBox repository
- Open the
/siem_mtad_gat/assets/secrets/wazuh_credentials.json - Update "username" as indexer's username
- Update "password" as indexer's password
- Run
./adbox/adbox.sh -c
Expected outcome
- Succesful connection
IDPS-ESCAPE ADBox checking connection with Wazuh/OpenSearch...
Wazuh data ingestor establishing connection to Wazuh...
Connection with Wazuh established successfully!
Parent links: SRS-022 Indexer Credentials Update
| Attribute | Value |
|---|---|
| platform | MacOS, Windows, GNU/Linux |
| execution_type | M |
| verification_method | T |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.22 Open prediction file of training data TST-037
Preconditions and setup actions
- ADBox dev container running.
- Wazuh central component deployed.
- User with root privileges
- At lease a trained detector.
Test steps
- Open the cloned ADBox repository
- Choose one of the detectors avaliable in
siem_mtad_gat/assets/detector_models. E.g,siem_mtad_gat/assets/detector_models/9a447100-39d1-4e00-83fc-8c618444edf7. - Open
siem_mtad_gat/frontend/viznotebook/result_visualizer.ipynbwithin dev container - Insert dector id in Variables and path to be modified
- Run Notebook
- Go to Running ADBox with a use-case>Training>Training output table
Expected outcome
- Table showing prediction aver train data
Parent links: SRS-030 AD Results Visualization
| Attribute | Value |
|---|---|
| platform | MacOS, Windows, GNU/Linux |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
1.23 Visualize train losses TST-038
Preconditions and setup actions
- Wazuh central component deployed.
- ADBox deployed
- User with root privileges
- At lease a trained detector.
Test steps
- Open the cloned ADBox repository
- Choose one of the detectors avaliable in
siem_mtad_gat/assets/detector_models. - Open
siem_mtad_gat/assets/detector_models/uuid/training/train_losses.pngusing system default software.
Expected outcome
- Graph displaying train_losses.png
Parent links: SRS-031 Training Loss Visualization
| Attribute | Value |
|---|---|
| platform | MacOS, Windows, GNU/Linux |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 1 |
| test_data | see referenced files |
| version | 0.2 |
1.24 Open prediction raw outcome TST-039
Preconditions and setup actions
- Wazuh central component deployed.
- ADBox deployed
- User with root privileges
- At lease a trained detector used for running prediction at least once (i.e., stored prediction data).
Test steps
- Open the cloned ADBox repository
- Choose one of the detectors avaliable in
siem_mtad_gat/assets/detector_models. - Open
siem_mtad_gat/assets/detector_models/uuid/prediction - Open a prediction file of the
uc-x_predicted_anomalies_data-*.jsonusing system default software.
Expected outcome
-
Prediction info store using json format. E.g.
{ "run_mode": "REALTIME", "detector_id": "563394be-5079-424d-b2ba-cfda0812cf88", "start_time": "2024-10-25T08:51:00Z", "end_time": "2024-10-25T08:52:00Z", "results": [ { "timestamp": "2024-10-25T08:51:00Z", "is_anomaly": false, "anomaly_score": 0.029846280813217163, "threshold": 0.12186630221790373, "Forecast_data.5mins_loadAverage_average": 0.1334819793701172, "Recon_data.5mins_loadAverage_average": 0.11187170445919037, "True_data.5mins_loadAverage_average": 0.1077537015080452, "A_Score_data.5mins_loadAverage_average": 0.029846280813217163, "Thresh_data.5mins_loadAverage_average": 0.12186630221790373, "A_Pred_data.5mins_loadAverage_average": 0.0 } ] }
Parent links: SRS-032 Predicted Anomalies Visualization
| Attribute | Value |
|---|---|
| platform | MacOS, Windows, GNU/Linux |
| execution_type | Automated/Manual |
| verification_method | I |
| release | alpha |
| test_data | see referenced files |
| version | 0.2 |
2.0 IDPS-ESCAPE foundation test cases
2.1 Suricata installation in a containerized environment TST-019
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
Test steps
- Create a new directory for suricata docker deployment.
- In the directory download the
suricata.yamlconfiguration filedocs/manual/custom_deployments/suricata/suricata.yaml. - Make the required changes in the configuration file as per the network
settings of the respective system as explained in
docs/manual/custom_deployments/suricata/suricata_installation.md#suricata-configuration-file. - In the directory download the Dockerfile
docs/manual/custom_deployments/suricata/Dockerfile. - Pull the ubuntu docker base image.
sudo docker pull ubuntu - Build the docker image.
sudo docker build -t suricata-container .
- Run the docker container.
sudo docker run --network=host --hostname=suricata-instance --name=suricata-instance -it suricata-container
Expected outcome
- Container named
suricata-instanceis running. Verify it by checking the running docker container with this command. sudo docker ps -a - Upon running the
ps auxcommand inside the running container's bash, Suricata services can be seen as a running process. The container bash can be accessed by the following command.sudo docker exec -it suricata-instance bash - In the container's bash run the following command to read Suricata log files.
tail /var/log/suricata/suricata.log
Parent links: SRS-005 Network Monitoring Control, SRS-008 Dockerized NIDS Deployment
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.2 |
2.2 Wazuh installation in a containerized environment TST-020
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0
Note: this test installs the upstream
wazuh-dockersingle-node stack. The C&C deployment documented in this repository isradar/build-radar.sh --core-only(radar/docker-compose.core.yml, Wazuh 4.14.1), seedocs/manual/radar_docs/radar-getting-started.md.
Test steps
- Clone the Wazuh docker repository in the system as mentioned in section
git clone https://github.com/wazuh/wazuh-docker.git -b v4.8.1
- Navigate to the directory since it is a single node deployment.
cd wazuh-docker/single-node
-
Provide the group of certificates for secure communication.
sudo docker-compose -f generate-indexer-certs.yml run --rm generator -
Deploy Wazuh as single-node using docker-compose.
sudo docker-compose up -dThis could take some time since it would pull all the images.
Expected outcome
- The following output should be visible on the screen after deployment in the background (with -d option)
✔ Container single-node-wazuh.indexer-1 Started
0.1s
✔ Container single-node-wazuh.manager-1 Started
0.1s
✔ Container single-node-wazuh.dashboard-1 Started
-
Run the following command and you should see 3 containers running. By
sudo docker ps -ayou shall seewazuh/wazuh-dashboard:4.8.1,wazuh/wazuh-manager:4.8.1,wazuh-indexer:4.8.1. -
The Wazuh dashboard is accessible through any browser, on the IP address of the system that it is deployed on.
Parent links: SRS-001 Centralized C&C Deployment
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.2 |
2.3 Wazuh agent installation and enrollment: the local machine TST-021
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0
- Deployment of Wazuh Dashboard version 4.8.1 on the local monitoring machine inside a container
- Deployment of Wazuh Indexer version 4.8.1 on the local monitoring machine inside a container
- Deployment of Wazuh Manager version 4.8.1 on the local monitoring machine inside a container
- GNU bash, version 5.1.16
- No prior agent should already be running on the local monitoring machine
Note: this test enrolls the agent into a plain Wazuh stack (see TST-020). A manager deployed with
radar/build-radar.shrequires an enrollment password and keeps port 1515 closed outside an enrollment window; enroll there withradar/radar-agent/bootstrap-agent.shand a token minted withradar/radar.sh mint-token(seedocs/manual/radar_docs/radar-getting-started.md#3-onboard-an-endpoint).
Test steps
- On the Wazuh Dashboard, go to Endpoint Summary, and click on Deploy new agent.
- Select the package to download and install on the respective system i.e., Linux DEB amd64.
- Provide a server address and an optional name for the agent. The server address should be the IP address of the docker host address in the case of docker installation on the local monitoring machine. - The docker host address can be found by:
sudo docker network inspect bridge | grep Gateway
- Install the agent by running the command that should be provided on the dashboard after entering the above information. For example, - download
wget https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.8.1-1_arm64.deb && sudo WAZUH_MANAGER='172.17.0.1' WAZUH_AGENT_GROUP='default' WAZUH_AGENT_NAME='idps-escape-1' dpkg -i ./wazuh-agent_4.8.1-1_arm64.deb
- Start the agent by running the three commands that should also be provided on the dashboard, i.e.,
sudo systemctl daemon-reload
sudo systemctl enable wazuh-agent
sudo systemctl start wazuh-agent
Expected outcome
- The status of the agent should be “Started Wazuh agent.” Which is seen by running the command: sudo systemctl status wazuh-agent.
- On the Wazuh Dashboard the Agent should appear as active in the summary page.
Parent links: SRS-002 Endpoint Status Monitoring, SRS-003 HIDS Agent Deployment, SRS-009 Signature-Based HIDS, SRS-013 HIDS Agent Status Panel
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.2 |
2.4 Wazuh agent installation and enrollment: remote machine TST-022
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0
- Deployment of Wazuh Dashboard version 4.8.1 on the local monitoring machine inside a container
- Deployment of Wazuh Indexer version 4.8.1 on the local monitoring machine inside a container
- Deployment of Wazuh Manager version 4.8.1 on the local monitoring machine inside a container
- GNU bash, version 5.1.16
- No prior agent should already be running on a REMOTE monitoring machine
Note: this test enrolls the agent into a plain Wazuh stack (see TST-020). A manager deployed with
radar/build-radar.shrequires an enrollment password and keeps port 1515 closed outside an enrollment window; enroll there withradar/radar-agent/bootstrap-agent.shand a token minted withradar/radar.sh mint-token(seedocs/manual/radar_docs/radar-getting-started.md#3-onboard-an-endpoint).
Test steps
- On the Wazuh Dashboard, go to Endpoint Summary, and click on Deploy new agent.
- Select the package to download and install on the REMOTE MACHINE system i.e., Linux DEB amd64.
- Provide a server address (this should be the machine hosting the manager) and an optional name for the agent. - The docker host address can be found by:
sudo docker network inspect bridge | grep Gateway
- Install the agent by running the command in the REMOTE HOST that should be provided on the dashboard after entering the above information. For example, - download
wget https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.8.1-1_arm64.deb && sudo WAZUH_MANAGER='172.17.0.1' WAZUH_AGENT_GROUP='default' WAZUH_AGENT_NAME='idps-escape-1' dpkg -i ./wazuh-agent_4.8.1-1_arm64.deb
- Start the agent by running the three commands in the REMOTE HOST that should also be provided on the dashboard, i.e.,
sudo systemctl daemon-reload
sudo systemctl enable wazuh-agent
sudo systemctl start wazuh-agent
Expected outcome
- The status of the agent should be “Started Wazuh agent.” Which is seen by running the command: sudo systemctl status wazuh-agent.
- On the Wazuh Dashboard the Agent should appear as active in the summary page.
Parent links: SRS-002 Endpoint Status Monitoring, SRS-013 HIDS Agent Status Panel, SRS-023 Agent Registration Process, SRS-033 Remote Endpoint Deployment
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.2 |
2.5 Wazuh agent deletion and uninstallation TST-023
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0 curl version 7.81.0
- Wazuh agent installed and enrolled with the manager
- Wazuh API Token
- Deployment of Wazuh Dashboard on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Indexer on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Manager on the local monitoring machine inside a container (4.8.1)
Test steps
- Using the Wazuh API Token, send a DELETE request through the Wazuh API to the Wazuh manager. The request should also contain the IDs of the agents to be deleted.
curl -k -X DELETE "https://[Wazuh Server Address]:55000/agents?pretty=true&older_than=0s&agents_list=[Comma separated agent IDs]&status=all"
-H "Authorization: Bearer $TOKEN"
- Uninstall the agent by running the following commands.
sudo apt-get remove --purge wazuh-agent
sudo systemctl disable wazuh-agent
sudo systemctl daemon-reload
Expected outcome
- After deleting the agent, the agent should not be visible in the list of agents on the Wazuh Dashboard.
- The agent should also not be present in the list of available agents on the
machine, which can be checked by the following command.
sudo /var/ossec/bin/manage_agents -l - After uninstalling the agent, no command regarding the agent should work.
- The agent removal can also be verified from the Wazuh manager.
- Access the bash of the container which is running the Wazuh Manager.
sudo docker exec -it [Container name or ID of Wazuh Manager] bash - Run the command to access the Agent Manager.
/var/ossec/bin/manage_agents - The removal can be confirmed by entering
Land pressing ENTER to verify its absence from the Available Agents listing.
Parent links: SRS-004 HIDS Agent Management
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.2 |
2.6 Wazuh agent unenrollment TST-024
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0 curl version 7.81.0
- Wazuh agent installed and enrolled with the manager
- Deployment of Wazuh Dashboard on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Indexer on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Manager on the local monitoring machine inside a container (4.8.1)
Test steps
- Access the bash of the container which is running the Wazuh Manager.
sudo docker exec -it [Container name or ID of
Wazuh Manager] bash
- Run the command to access the Agent Manager.
/var/ossec/bin/manage_agents - Press
<R>which is the option for removing and agent and press enter. - Enter the ID of the agent to be removed and unenroll from the manager.
e. Confirm the removal action by pressing
<Y>and enter.
Expected outcome
- After confirming the output should be a confirmation message, "Agent
IDremoved". - After deleting the agent, the agent should not be visible in the list of agents on the Wazuh Dashboard.
- The agent should also not be present in the list of available agents on the
machine, which can be checked by the following command.
sudo /var/ossec/bin/manage_agents -l
Parent links: SRS-004 HIDS Agent Management
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
2.7 Suricata and Wazuh Integration TST-025
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0 curl version 7.81.0
- Wazuh agent installed and enrolled with the manager
- Deployment of Wazuh Dashboard on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Indexer on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Manager on the local monitoring machine inside a container (4.8.1)
- Deployment of Suricata version 7.0.3 on the local monitoring machine inside a container
- GNU nano, version 6.2
- curl version 7.81.0
Test steps
The procedure is documented in docs/manual/custom_deployments/integration.md.
- Edit the configuration file of the Wazuh agent to make it able to read
Suricata logs.
sudo nano /var/ossec/etc/ossec.conf - Add the suricata eve logs the end of the file, before the last
</ossec_config>closing tag.
<ossec_config>
...
<localfile>
<log_format>json</log_format>
<location>/var/log/suricata/eve.json</location>
</localfile>
</ossec_config>
- Remove the Suricata container.
sudo docker rm suricata-instance - Run the Suricata container again with adding arguments to create docker volumes.
sudo docker run -v /var/log/suricata:/var/log/suricata --network=host --hostname=suricata-instance --name=suricata-instance -d suricata-container
- Restart the Wazuh agent
sudo systemctl restart wazuh-agent
- Generate some malicious network traffic by sending a curl request to the following tool.
curl -sSL
https://raw.githubusercontent.com/3CORESec/testmynids.org/master/tmNIDS -o /tmp/tmNIDS && chmod +x /tmp/tmNIDS && /tmp/tmNIDS
- Enter any number from 1 to 11 to generate the respective traffic.
- On the Wazuh dashboard, filter the alerts to see the events particularly generated by Suricata. This is done by Threat Hunting > Add Filter. And to create the filter, in the Field dropdown, select rule.groups, in the operator dropdown, select is and in the Value, write suricata.
Expected outcome
-The alert generated by Suricata for the malicious traffic should be seen on the Wazuh Dashboard Threat Hunting. - After filter application, all alerts generated by suricata should be visible.
Parent links: SRS-010 Centralized Threat Management
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.2 |
2.8 Port mirroring for remote machines TST-026
Preconditions and setup actions
- Ubuntu 22.04.4 LTS (Machine 1, central monitoring host)
- Ubuntu 22.04.4 LTS (Machine 2, target host or the remote machine)
-
Prerequisites for Machine 1:
- tcpdump version 4.99.1
- User with root privileges
-
Prerequisites for Machine 2:
- User with root privileges
- ping from iputils 20211215
- GNU bash, version 5.1.16
- No existing tunnel is configured from machine 2 to machine 1
Test steps
- Create a GRE tunnel from machine 2 to machine 1 and mirror all the
ingress and egress (incoming and outgoing) network traffic generated on
machine 2 to machine 1. Using the procedure described in
docs/manual/custom_deployments/remote_monitoring/remote_monitoring.md(hybrid model), i.e., the scriptdocs/manual/custom_deployments/remote_monitoring/idps-escape-port-mirroring.sh.
- From machine 2, send some ICMP echo request packets to machine 1.
ping -c3 [IP of the capture interface of machine
1]
- On machine 1, use tcpdump to capture network traffic on the default interface.
sudo tcpdump -n -i [Capture interface of machine
1]
Expected outcome
tcpdump output should show that machine 1 receives both the ingress and egress ICMP packets from machine 2, encapsulated within GRE packets
Parent links: SRS-007 Raw Traffic Capture, SRS-033 Remote Endpoint Deployment
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | A |
| release | alpha |
| complexity | 4 |
| test_data | see referenced files |
| version | 0.2 |
2.9 Traffic monitoring on Wazuh (local) TST-027
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0 curl version 7.81.0
- Wazuh agent installed and enrolled with the manager
- Deployment of Wazuh Dashboard on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Indexer on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Manager on the local monitoring machine inside a container (4.8.1)
- Deployment of Suricata version 7.0.3 on the local monitoring machine inside a container
- GNU nano, version 6.2
- curl version 7.81.0
- Wazuh agent configured to integrate with Suricata
Test steps
- Generate some malicious network traffic on the monitored machine by sending a curl request to the following tool.
curl -sSL
https://raw.githubusercontent.com/3CORESec/testmynids.org/master/tmNIDS -o /tmp/tmNIDS && chmod +x /tmp/tmNIDS && /tmp/tmNIDS
- Enter any number from 1 to 11 to generate the respective traffic on the console.
Expected outcome
The alert generated by Suricata for the malicious traffic should be seen on the Wazuh Dashboard.
Parent links: SRS-005 Network Monitoring Control, SRS-011 Network Event Visualization
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 4 |
| test_data | see referenced files |
| version | 0.2 |
2.10 Traffic monitoring on Wazuh (remote) TST-028
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0 curl version 7.81.0
- Wazuh agent installed and enrolled with the manager in remote machine
- Deployment of Wazuh Dashboard on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Indexer on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Manager on the local monitoring machine inside a container (4.8.1)
- Deployment of Suricata version 7.0.3 on the remote monitoring machine inside a container
- GNU nano, version 6.2
- curl version 7.81.0
- Wazuh agent configured to integrate with Suricata
- GRE tunnel created from the remote machine to the local monitoring machine which mirrors all the ingress and egress network traffic from the remote machine to the local monitoring machine
Test steps
-
Generate some malicious network traffic on the remote monitored machine by sending a curl request to the following tool.
curl -sSL https://raw.githubusercontent.com/3CORESec/testmynids.org/master/tmNIDS -o /tmp/tmNIDS && chmod +x /tmp/tmNIDS && /tmp/tmNIDS -
Enter any number from 1 to 11 to generate the respective traffic on the console.
-
On the Wazuh dashboard, filter the alerts to see the events particularly related to the remote machine. This is done bya adding a filter. And to create the filter, in the Field dropdown, select
data.tunnel.src_ip, in the operator dropdown, selectisand in the Value, write the IP of the capture interface of the remote machine where the GRE tunnel was created.
Note that after creating the tunnel there could be a possible delay of some minutes between the creation of the tunnel and the display of the events on the Wazuh dashboard.
Expected outcome
Step 2.
The alert generated by Suricata for the malicious traffic should be seen on the Wazuh Dashboard.
Step 3.
- The alert generated by Suricata for the malicious traffic should be seen on the Wazuh Dashboard.
- The filter application should show the Suricata alert for the test traffic that was run.
Parent links: SRS-011 Network Event Visualization, SRS-033 Remote Endpoint Deployment
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 4 |
| test_data | see referenced files |
| version | 0.2 |
2.11 Changing password for Wazuh indexer users TST-029
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0 curl version 7.81.0
- Wazuh agent installed and enrolled with the manager
- Deployment of Wazuh Dashboard on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Indexer on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Manager on the local monitoring machine inside a container (4.8.1)
- Deployment of Suricata version 7.0.3 on the local monitoring machine inside a container
- GNU nano, version 6.2
Test steps
The change password procedure follows the upstream Wazuh guide Changing the default password of Wazuh users. For a stack deployed with radar/build-radar.sh, passwords are rotated with sudo radar/radar.sh rotate-credentials instead (see docs/manual/radar_docs/radar-operations.md#credentials).
Part 1: Genereate Hash
- Stop the deployment stack if it's running. From wazuh repository:
sudo docker-compose down
- Run the following command to generate the hash of the new password. Once the container launches, input the new password and press Enter.
sudo docker run --rm -ti wazuh/wazuh-indexer:4.8.1 bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/hash.sh
- Copy the generated hash.
- Open the
config/wazuh_indexer/internal_users.ymlfile. Locate the block for the user for whom the password is being changed for.
Part 2: Set the new password.
- In the
docker-compose.ymlfile, replace all instances of the old password with the new one.
Part 3: Apply changes
- Start the deployment stack.
sudo docker-compose up -d
- Enter the container bash.
sudo docker exec -it [Name or ID of the Wazuh Indexer container] bash
- Set the following variables:
export INSTALLATION_DIR=/usr/share/wazuh-indexer
CACERT=$INSTALLATION_DIR/certs/root-ca.pem
KEY=$INSTALLATION_DIR/certs/admin-key.pem
CERT=$INSTALLATION_DIR/certs/admin.pem
export JAVA_HOME=/usr/share/wazuh-indexer/jdk
- Wait for the Wazuh indexer to initialize properly. The waiting
time can vary from two to five minutes. It depends on the size of
the cluster, the assigned resources, and the speed of the
network. Then, run the
securityadmin.shscript to apply all changes.
bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh -cd /usr/share/wazuh-indexer/opensearch-security/ -nhnv -cacert $CACERT -cert $CERT -key $KEY -p 9200 -icl
- Exit the Wazuh indexer container and login with the new credentials on the Wazuh dashboard.
Expected outcome
-The Wazuh dashboard should show "Invalid username or password. Please try again." error while trying to login with the old password. - The Wazuh dashboard should be accessible through the new password.
Parent links: SRS-016 Indexer Credential Management
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | Automated/Manual |
| verification_method | I |
| release | alpha |
| complexity | 4 |
| test_data | see referenced files |
| version | 0.2 |
2.12 Changing password for Wazuh API users TST-030
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0 curl version 7.81.0
- Wazuh agent installed and enrolled with the manager
- Deployment of Wazuh Dashboard on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Indexer on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Manager on the local monitoring machine inside a container (4.8.1)
- Deployment of Suricata version 7.0.3 on the local monitoring machine inside a container
- GNU nano, version 6.2
Test steps
The change password procedure follows the upstream Wazuh guide Changing the default password of Wazuh users. For a stack deployed with radar/build-radar.sh, passwords are rotated with sudo radar/radar.sh rotate-credentials instead (see docs/manual/radar_docs/radar-operations.md#credentials).
Part 1: Genereate Hash
- Stop the deployment stack if it's running. From wazuh repository:
sudo docker-compose down
- Run the following command to generate the hash of the new password. Once the container launches, input the new password and press Enter.
sudo docker run --rm -ti wazuh/wazuh-indexer:4.8.1 bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/hash.sh
- Copy the generated hash.
- Open the
config/wazuh_indexer/internal_users.ymlfile. Locate the block for the user for whom the password is being changed for.
Part 2: Set the new password.
- In the
docker-compose.ymlfile, replace all instances of the old password with the new one atAPI_PASSWORDoccurrence.
Part 3: Apply changes
- Start the deployment stack.
sudo docker-compose up -d
Expected outcome
- Trying to obtain Wazuh API token using the old password, which can be done in the following way (make sure that the password is within inverted quotes).
TOKEN=$(curl -u wazuh-wui:"MyS3cr37P450r.*-" -k -X POST "https://172.17.0.1:55000 /security/user/authenticate?raw=true"); echo $TOKENThis hould return the following error.{"title": "Unauthorized", "detail": "Invalid credentials"} - The token can be successfully obtained using the new password.
Parent links: SRS-016 Indexer Credential Management
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I/T |
| release | alpha |
| complexity | 4 |
| test_data | see referenced files |
| version | 0.2 |
2.13 Wazuh filters using the RESTful API TST-031
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0 curl version 7.81.0
- Wazuh agent installed and enrolled with the manager in remote machine
- Wazuh agent installed and enrolled with the manager in local machine
- Deployment of Wazuh Dashboard on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Indexer on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Manager on the local monitoring machine inside a container (4.8.1)
- Deployment of Suricata version 7.0.3 on the remote monitoring machine inside a container
- GNU nano, version 6.2
- curl version 7.81.0
- Wazuh agent configured to integrate with Suricata
- GRE tunnel created from the remote machine to the local monitoring machine which mirrors all the ingress and egress network traffic from the remote machine to the local monitoring machine
Test steps
- Get the Wazuh API Token.
- Run the following query to apply the filter:
curl -G "q=data.tunnel.src_ip=[IP of the tunnel source interface]" -k -X GET "https://[Wazuh Manager IP address]:55000/manager/logs?limit=500&pretty=true" -H "Authorization: Bearer $TOKEN"
Expected outcome
- The output of the query should show JSON decoded logs and in the last there should be a success message. "message: Logs were successfully read, error: 0"
Parent links: SRS-024 Event Querying Capability
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 4 |
| test_data | see referenced files |
| version | 0.2 |
2.14 Wazuh filters using the Wazuh Dashboard TST-032
Preconditions and setup actions
- Docker version 26.0.0
- User with root privileges
- Docker Compose version v2.25.0 curl version 7.81.0
- Wazuh agent installed and enrolled with the manager in remote machine
- Wazuh agent installed and enrolled with the manager in local machine
- Deployment of Wazuh Dashboard on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Indexer on the local monitoring machine inside a container (4.8.1)
- Deployment of Wazuh Manager on the local monitoring machine inside a container (4.8.1)
- Wazuh agent configured to integrate with Suricata
- GRE tunnel created from the remote machine to the local monitoring machine which mirrors all the ingress and egress network traffic from the remote machine to the local monitoring machine
Test steps
- On the Wazuh dashboard navigate to Threat Hunting and filter by
data.tunnel.src_ip:[IP remote machine].
Expected outcome
- The filtered view should show the Suricata alerts for the traffic of the remote machine.
Parent links: SRS-011 Network Event Visualization
| Attribute | Value |
|---|---|
| platform | Ubuntu 22.04.4 LTS |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
2.15 Map a detected event to MITRE ATT&CK TST-036
Preconditions and setup actions
- Wazuh central component deployed.
- Presence of alerts collected in Wazuh indexer.
Test steps
- Open Wazuh Dashboard
- Go to Threat Hunting > Events> Add Filter and choose
rule.mitre.idexists. - Inspect filtered output (possibly extend time interval for more results).
Expected outcome
- In json
rule.mitre.idkey should include the matching MITRE ID. E.g. T1078, T1021
"mitre": {
"technique": [
"Valid Accounts",
"Remote Services"
],
"id": [
"T1078",
"T1021"
],
"tactic": [
"Defense Evasion",
"Persistence",
"Privilege Escalation",
"Initial Access",
"Lateral Movement"
]
},
"id": "5715",
"gpg13": [
"7.1",
"7.2"
]
}
Parent links: SRS-009 Signature-Based HIDS, SRS-012 Host Event Visualization, SRS-025 MITRE ATT&CK Mapping
| Attribute | Value |
|---|---|
| platform | MacOS, Windows, GNU/Linux |
| execution_type | Automated/Manual |
| verification_method | I |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.2 |
2.16 Visualize IDPS-ESCAPE high level architecture TST-040
Preconditions and setup actions
- A copy of the IDPS-ESCAPE repository
Test steps
- Open the
docs/traceability/HARC.htmlfile using the browser
Expected outcome
- Web page displaying IDPS-ESCAPE architecture diagrams
Parent links: SRS-045 High-Level Architecture Overview
| Attribute | Value |
|---|---|
| platform | MacOS, Windows, GNU/Linux |
| execution_type | M |
| verification_method | I |
| release | alpha |
| complexity | 1 |
| test_data | see referenced files |
| version | 0.2 |
2.17 Open-source licence inspection TST-085
This inspection confirms that the repository is distributed under the AGPL-3.0 and that the third-party code it includes keeps its original licence notices (SRS-082).
Preconditions and setup actions
- A clean checkout of the IDPS-ESCAPE repository at the release under test, with
gitavailable. - All commands are run from the repository root.
Test steps
- Inspect the licence file:
bash head -3 LICENSE grep -E '^[0-9]+\. ' LICENSE tail -1 LICENSERead the preamble and terms, and compare them with the AGPL-3.0 published at https://www.gnu.org/licenses/agpl-3.0.html. - Inspect the authors file and the package metadata:
bash cat AUTHORS grep '^authors' pyproject.toml - Inspect the licence section of the top-level README:
bash grep -n -A3 '^## License' README.md - List the source files that carry a licence notice of their own:
bash git grep -l -i -E "SPDX-License-Identifier|GNU General Public|MIT License|Apache License|BSD License" \ -- sonar radar adbox ':!adbox/mtad_gat_pytorch' ':!*.ipynb'Open each listed file and read its header. - Inspect the included MTAD-GAT component:
bash head -3 adbox/mtad_gat_pytorch/LICENSE ls adbox/mtad_gat_pytorch/licences/ head -3 adbox/mtad_gat_pytorch/licences/* grep -n -B5 'licences' adbox/mtad_gat_pytorch/README.md
Expected outcome
LICENSEstarts withGNU AFFERO GENERAL PUBLIC LICENSEandVersion 3, 19 November 2007, lists the 18 sections0. Definitions.to17. Interpretation of Sections 15 and 16., and ends withEND OF TERMS AND CONDITIONS. Its preamble and terms match the published AGPL-3.0 apart from layout.AUTHORSlists the developers and states that IDPS-ESCAPE is licensed under the GNU Affero General Public License version 3. Theauthorsentry ofpyproject.tomlnames the same developers.- The README licence section names the copyright holders (itrust Abstractions Lab and itrust consulting), states the GNU AGPL v3.0 and links to
LICENSEandAUTHORS. - Exactly the files of
adbox/ad_opensearch_extension/andadbox/data_ingestion/__init__.pyare listed, and each keeps theCopyright OpenSearch Contributorsnotice withSPDX-License-Identifier: Apache-2.0. No other source file carries a licence notice that conflicts with the AGPL-3.0. adbox/mtad_gat_pytorch/LICENSEis the MIT licence of the original MTAD-GAT authors;licences/containsLICENCE_OmniAnomaly,LICENCE_TelemAnomandLICENCE_pyGAT, one for each project credited in the component'sREADME.md.
The test passes when all five outcomes are observed.
LICENSEAUTHORSREADME.mdadbox/mtad_gat_pytorch/LICENSEadbox/mtad_gat_pytorch/README.md
Parent links: SRS-082 Open-source licensing
| Attribute | Value |
|---|---|
| platform | GNU/Linux (any host with git and a repository checkout) |
| execution_type | Manual |
| verification_method | I |
| release | alpha |
| complexity | 1 |
| test_data | the repository checkout itself |
| version | 0.1 |
2.18 RADAR credential rotation TST-086
No automated test covers credential generation or rotation; this test is run by hand on a stack RADAR deploys itself.
Preconditions and setup actions
- A RADAR host with Docker and
sudo, and no earlier RADAR stack:docker volume ls | grep wazuh-indexer-dataprints nothing. radar/.envcreated fromradar/env.example, withOS_PASS,WAZUH_AUTH_PASSandINDEXER_DASHBOARD_PASSWORDempty or set to the stock Wazuh values.- All commands run in
radar/. To use a value from.envin a command without printing it, read it withv() { python3 -m wazuh_api.envfile get "$1" .env; }(the RADAR scripts need the same Python modules). Defineos_ok() { curl -sk -o /dev/null -w '%{http_code}\n' -u "admin:$1" https://localhost:9200/_cluster/health; }andapi_ok() { curl -sk -o /dev/null -w '%{http_code}\n' -u "wazuh-wui:$1" -X POST https://localhost:55000/security/user/authenticate; }.
Test steps
- First deployment:
sudo ./build-radar.sh --core-only. Thenstat -c '%a' .env,stat -c '%a' .radar-generated,ls -a .radar-generated, and check that.radar-generated/internal_users.ymlcontains no value of.env. - Generated passwords in use:
os_ok "$(v OS_PASS)",os_ok SecretPassword,api_ok "$(v WAZUH_AUTH_PASS)",api_ok 'MyS3cr37P450r.*-',curl -sk -o /dev/null -w '%{http_code}\n' -u readall:readall https://localhost:9200/_cluster/health. Log in to the dashboard asadminwithOS_PASS. - Existing deployment kept:
sha256sum .env > env.sum;sudo ./stop-radar.sh;sudo ./build-radar.sh --core-only;sha256sum -c env.sum. - Deploy a scenario so that the manager has an
active_responses.env:sudo ./build-radar.sh log_volume. - Refusals:
sha256sum .env > env.sum;./radar.sh rotate-credentials(withoutsudo); thendocker stop wazuh.indexer,sudo ./radar.sh rotate-credentials,sha256sum -c env.sum,docker start wazuh.indexerand wait untilos_ok "$(v OS_PASS)"returns 200. - Rotation:
OLD_OS="$(v OS_PASS)"; OLD_API="$(v WAZUH_AUTH_PASS)";sudo ./radar.sh rotate-credentials; echo $?. - New passwords in use, old ones refused:
os_ok "$(v OS_PASS)",os_ok "$OLD_OS",api_ok "$(v WAZUH_AUTH_PASS)",api_ok "$OLD_API"; comparesudo sha256sum .radar-state/env.before-rotationwithenv.sum;sudo stat -c '%a' .radar-state/env.before-rotation. Log in to the dashboard asadminwith the newOS_PASS. - Active response environment:
docker exec wazuh.manager stat -c '%U:%G %a' /var/ossec/active-response/bin/active_responses.env;docker exec wazuh.manager grep -qxF "OS_PASS=$(v OS_PASS)" /var/ossec/active-response/bin/active_responses.env; echo $?. - Deployment still healthy:
./health-radar.sh --scenario log_volume. - Clean up:
unset OLD_OS OLD_API;rm env.sum.
Expected outcome
- The build reports
OK - generated unique credentials in .env: ...naming at leastINDEXER_DASHBOARD_PASSWORD,OS_PASSandWAZUH_AUTH_PASS, andOK - wrote .radar-generated/internal_users.yml and wazuh.yml, and ends with=== SUCCESS .....envhas mode 600 and.radar-generatedmode 700, holdinginternal_users.yml,wazuh.ymland.gitignore.internal_users.ymlholds bcrypt hashes only. - 200 for the generated
OS_PASS, 401 forSecretPassword, 200 for the generatedWAZUH_AUTH_PASS, 401 for the stock API password, 401 for the demo userreadall. The dashboard login succeeds. - The build reports
OK - existing deployment (..._wazuh-indexer-data found): passwords left unchanged;sha256sum -creportsOK. - The build completes without error.
- Without
sudo:ERROR: rotate-credentials needs root (docker compose, bind mounts). Re-run with sudo.and exit status 1. With the indexer stopped:[ERROR] container wazuh.indexer is not running; start the core stack first, a non-zero exit status, and.envunchanged (OK). - The output shows
OK - indexer users rotated; .env updated (previous copy: .radar-state/env.before-rotation), the stack being recreated, the Wazuh API and OpenSearch becoming reachable,Refreshing active_responses.env...and=== Credentials rotated. ...; exit status 0. - 200 for the new
OS_PASS, 401 for the old one; 200 for the newWAZUH_AUTH_PASS, 401 for the old one. The checksum of.radar-state/env.before-rotationequals the one inenv.sum, and its mode is 600. The dashboard login with the new password succeeds. root:wazuh 440, andgrepexits 0: the manager's active-response environment carries the new indexer password.- No line of the Wazuh API section reports
Authentication failed, the core daemons are reported running, and the OpenSearch check reportsOK - OpenSearch reachable (cluster: ...). AFAILfor agents inlog_volume's group is expected, as no endpoint is enrolled.
The test passes when every expected outcome is observed.
radar/radar_deploy/manager-rotate-credentials.shradar/wazuh_api/credentials.py
Parent links: SRS-016 Indexer Credential Management
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 3 |
| test_data | none (a fresh RADAR core stack) |
| version | 2.2 |
3.0 RADAR test case specifications
3.1 Setup RADAR foundation TST-041
This test brings up the RADAR foundation on a clean host: the Wazuh core stack (manager, indexer, dashboard) with per-deployment credentials and hardened agent enrollment, without any RADAR scenario applied. The scenario tests (TST-055 to TST-062) start from this state.
Preconditions and setup actions
- A RADAR host is available to the tester:
- OS: recent GNU/Linux distribution, preferably Ubuntu 22.04+.
- Docker Engine 20.10+ and the Docker Compose plugin are installed (
docker --version,docker compose version). - The tester has
sudoon the host, and enough disk is available under/srv/wazuh/for the indexer. - The repository is checked out on the host, and no Wazuh manager container is running yet.
- Targeted Wazuh manager and agent versions:
4.14.1. - SMTP credentials are available to the tester (
SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASS,EMAIL_TO). - The DECIPHER Stack (DECIPHER, FlowIntel and MISP) is deployed and reachable from the RADAR host. The validated version is available in the DECIPHER folder of the SATRAP-DL repository, tested against
v1.0of SATRAP-DL. Once deployed, its address is set asDECIPHER_BASE_URLin.env(step 2).
Test steps
- On the RADAR host, the working directory is required to be
radar:
cd radar
- Create
.envfrom the template and fill it in:
cp env.example .env
Each variable in env.example is commented. Set the addresses (OS_URL, DASHBOARD_URL, WAZUH_API_URL, WAZUH_MANAGER_ADDRESS, WEBHOOK_URL), the users, the SMTP values and DECIPHER_BASE_URL. Leave OS_PASS, DASHBOARD_PASS and WAZUH_AUTH_PASS empty: the first deployment generates them.
- Bring up the plain Wazuh stack:
sudo ./build-radar.sh --core-only
(Equivalent in the GUI: Deployment → Scenario Management → Deploy scenario with Plain Wazuh only.)
- Check the containers, certificates and generated credentials:
docker ps --format '{{.Names}}\t{{.Status}}'
ls config/wazuh_indexer_ssl_certs/
grep -E '^(OS_PASS|WAZUH_AUTH_PASS|DASHBOARD_PASS|WAZUH_CLUSTER_KEY)=' .env | cut -d= -f1
- Check that agent enrollment is hardened:
sudo ./radar.sh enrollment status
sudo grep -E '<use_password>|<purge>' /srv/wazuh/manager/etc/ossec.conf
- Load the generated indexer credentials and query the indexer:
for v in OS_URL OS_USER OS_PASS; do export "$v=$(PYTHONPATH=. python3 -m wazuh_api.envfile get "$v")"; done
curl -sk -u "$OS_USER:$OS_PASS" "$OS_URL/_cluster/health?pretty"
Expected outcome
-
The working directory is
radar. -
.envexists with the required variables set. -
The command completes with
=== SUCCESS: plain Wazuh manager/indexer/dashboard is up (no RADAR scenario applied) ===. -
Three items to verify:
wazuh.manager,wazuh.indexerandwazuh.dashboardare listed asUp.config/wazuh_indexer_ssl_certs/contains the generated.pemfiles.OS_PASS,WAZUH_AUTH_PASSandDASHBOARD_PASSare set in.env, with values other than the stock Wazuh demo passwords, andWAZUH_CLUSTER_KEYis set.
-
The window status is
CLOSED - port 1515 is blocked, andossec.confcontains<use_password>yes</use_password>and<purge>no</purge>. -
The indexer answers with the generated credentials, and its cluster
statusisgreenoryellow.
Parent links: SRS-001 Centralized C&C Deployment, SRS-067 Secure agent enrollment and automated onboarding, SRS-083 Authenticated and encrypted component channels, SRS-084 Alert and anomaly storage on the C&C host
Child links: TRP-030 TCER: Setup RADAR foundation
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.8 |
3.2 Build suspicious login TST-042
Preconditions and setup actions
- RADAR is set up according to TST-041:
radar/.envfilled in, Docker available on the controller host. - A Linux endpoint reachable from the manager, with
sudo.
Test steps
- On the controller host, the working directory is required to be
radar:
cd radar
- Build RADAR with the
suspicious_loginscenario (prefix withsudoif your user cannot run Docker):
./build-radar.sh suspicious_login
This brings up the core stack (indexer, manager, dashboard) and the webhook container, then deploys the scenario's manager-side files, agent group configuration, decoders, rules and lists.
- Onboard the endpoint (see docs/manual/radar_docs/radar-getting-started.md, Onboard an endpoint):
sudo ./radar.sh mint-token default,suspicious_login,radar_shared 60
Copy the whole radar/radar-agent/ folder to the endpoint and, from inside it, run the printed command, e.g.:
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,suspicious_login,radar_shared
- To clean up the test environment only after a successful test execution AND a successful execution of TST-046:
- On the controller host:
./stop-radar.sh(add--purgeto also remove the volumes). - On the endpoint, from the
radar-agentfolder:sudo ./uninstall-agent.sh.
Expected outcome
2. Check the setup
In Wazuh Manager
Connect to the Wazuh manager to be able to perform the following verifications:
docker exec -it wazuh.manager bash
- 2.1 The RADAR-aware SSH decoders and the AD decoder are deployed:
ls -l /var/ossec/etc/decoders/0310-ssh.xml /var/ossec/etc/decoders/0001-ad-common.xml
grep -c 'with-radar' /var/ossec/etc/decoders/0310-ssh.xml
to ensure both files exist and 0310-ssh.xml contains the sshd-success-with-radar, ssh-failed-with-radar and ssh-invfailed-with-radar decoders.
- 2.2 The stock SSH decoder file is excluded in
ossec.conf:
grep '<decoder_exclude>0310-ssh_decoders.xml</decoder_exclude>' /var/ossec/etc/ossec.conf
to ensure the line appears once under <ruleset>.
- 2.3 The suspicious login rules are deployed:
grep -o 'rule id="[0-9]*"' /var/ossec/etc/rules/a3-suspicious-login.xml
to ensure rules 210013, 210020, 210021, 210022, 210030, 210031, 210039, 210040 and 210041 are present.
- 2.4 The rules are bound to the RADAR active response:
grep -A20 'RADAR: suspicious_login BEGIN' /var/ossec/etc/ossec.conf
to ensure the radar_ar_suspicious_login command runs radar_ar.py with <location>server</location> for <rules_id>210013,210020,210021,210022,210030,210031,210040,210041</rules_id>, and lock_user_linux.sh is declared.
- 2.5 The manager-side enrichment is installed and wired:
ls -l /var/ossec/integrations/custom-radar-enrich /var/ossec/integrations/radar_enrichment/
grep -A3 'custom-radar-enrich' /var/ossec/etc/ossec.conf
ls -l /var/ossec/etc/radar/
to ensure the integration script and its modules (geoip.py, state_store.py, enrichment.py) exist, the integration is declared for authentication_success,authentication_failed with a localfile for /var/ossec/logs/radar/enriched_auth.log, and GeoLite2-City.mmdb and GeoLite2-ASN.mmdb are present (downloaded when MAXMIND_LICENSE_KEY is set).
- 2.6 The agent group configuration is in place:
cat /var/ossec/etc/shared/radar_shared/agent.conf
to ensure it collects /var/log/auth.log as syslog.
- 2.7 The off-hours step is in the Filebeat archives pipeline:
grep -c 'radar-off-hours' /usr/share/filebeat/module/wazuh/archives/ingest/pipeline.json
to ensure the count is at least 1.
- 2.8 Active response files are in place:
ls -l /var/ossec/active-response/bin/radar_ar.py /var/ossec/active-response/bin/ar.yaml /var/ossec/active-response/bin/active_responses.env
to ensure all three exist.
- 2.9 The agent is registered with the manager:
/var/ossec/bin/agent_control -l
to ensure an active entry exists for the endpoint (and one for the webhook agent, ad-webhook).
- 2.10 Wazuh Manager is running after the deployment:
/var/ossec/bin/wazuh-control status
to ensure the status output indicates the manager is running with no error messages.
In endpoints running agents
- 2.11 The Wazuh agent is active and the RADAR active response scripts are installed:
systemctl status wazuh-agent
ls -l /var/ossec/active-response/bin/lock_user_linux.sh /var/ossec/active-response/bin/terminate_service.sh
to ensure the agent service is active and both scripts exist.
Post-test cleanup
- 3 Check the cleanup after successful validations, the command output should not list
wazuh.manager,wazuh.indexer,wazuh.dashboardor the webhook container:
docker ps
Parent links: SRS-051 RADAR scenario: suspicious login
Child links: TRP-031 TCER: Build suspicious login
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.8 |
3.3 Build non-whitelist GeoIP detection TST-043
Preconditions and setup actions
- RADAR is set up according to TST-041:
radar/.envfilled in, Docker available on the controller host. - A Linux endpoint reachable from the manager, with
sudo.
Test steps
- On the controller host, the working directory is required to be
radar:
cd radar
- Build RADAR with the
geoip_detectionscenario (prefix withsudoif your user cannot run Docker):
./build-radar.sh geoip_detection
This brings up the core stack (indexer, manager, dashboard) and the webhook container, then deploys the scenario's manager-side files, agent group configuration, decoders, rules and lists.
- Onboard the endpoint (see docs/manual/radar_docs/radar-getting-started.md, Onboard an endpoint):
sudo ./radar.sh mint-token default,geoip_detection,radar_shared 60
Copy the whole radar/radar-agent/ folder to the endpoint and, from inside it, run the printed command, e.g.:
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,geoip_detection,radar_shared
- To clean up the test environment only after a successful test execution AND a successful execution of TST-047:
- On the controller host:
./stop-radar.sh(add--purgeto also remove the volumes). - On the endpoint, from the
radar-agentfolder:sudo ./uninstall-agent.sh.
Expected outcome
2. Check the setup
In Wazuh Manager
Connect to the Wazuh manager to be able to perform the following verifications:
docker exec -it wazuh.manager bash
- 2.1 The whitelist is deployed and declared:
cat /var/ossec/etc/lists/whitelist_countries
grep -n 'whitelist_countries' /var/ossec/etc/ossec.conf
to ensure the list holds the scenario's entries (LU:, DE:, FR:, BE: as shipped) and ossec.conf has a <list>etc/lists/whitelist_countries</list> entry under <ruleset>.
- 2.2 The RADAR-aware SSH and web access log decoders are deployed:
ls -l /var/ossec/etc/decoders/0310-ssh.xml /var/ossec/etc/decoders/0375-web-accesslog.xml
to ensure both files exist.
- 2.3 The stock decoder files they replace are excluded in
ossec.conf:
grep 'decoder_exclude' /var/ossec/etc/ossec.conf
to ensure 0310-ssh_decoders.xml and 0375-web-accesslog_decoders.xml are each excluded once under <ruleset>.
- 2.4 The GeoIP rules are deployed:
grep -o 'rule id="[0-9]*"' /var/ossec/etc/rules/a2-geoip-detection.xml
to ensure rules 100900, 100901, 100902 and 100903 are present.
- 2.5 The rules are bound to the RADAR active response:
grep -A20 'RADAR: geoip_detection BEGIN' /var/ossec/etc/ossec.conf
to ensure the radar_ar_geoip command runs radar_ar.py with <location>server</location> for <rules_id>100900,100901,100903</rules_id>.
- 2.6 Both enrichment integrations are installed and wired:
ls -l /var/ossec/integrations/custom-radar-enrich /var/ossec/integrations/custom-radar-web-enrich /var/ossec/integrations/radar_enrichment/
grep -B1 -A3 'custom-radar' /var/ossec/etc/ossec.conf
ls -l /var/ossec/etc/radar/
to ensure both scripts and their modules exist, custom-radar-web-enrich is declared for the accesslog group and custom-radar-enrich for authentication_success,authentication_failed, their enriched log files are read back as localfile, and the GeoLite2 databases are present.
- 2.7 The agent group configurations are in place:
cat /var/ossec/etc/shared/geoip_detection/agent.conf /var/ossec/etc/shared/radar_shared/agent.conf
to ensure they collect the Apache access logs and /var/log/auth.log.
- 2.8 Active response files are in place:
ls -l /var/ossec/active-response/bin/radar_ar.py /var/ossec/active-response/bin/ar.yaml /var/ossec/active-response/bin/active_responses.env
to ensure all three exist.
- 2.9 The agent is registered with the manager:
/var/ossec/bin/agent_control -l
to ensure an active entry exists for the endpoint (and one for the webhook agent, ad-webhook).
- 2.10 Wazuh Manager is running after the deployment:
/var/ossec/bin/wazuh-control status
to ensure the status output indicates the manager is running with no error messages.
In endpoints running agents
- 2.11 The Wazuh agent is active and the RADAR active response scripts are installed:
systemctl status wazuh-agent
ls -l /var/ossec/active-response/bin/lock_user_linux.sh /var/ossec/active-response/bin/terminate_service.sh
to ensure the agent service is active and both scripts exist.
Post-test cleanup
- 3 Check the cleanup after successful validations, the command output should not list
wazuh.manager,wazuh.indexer,wazuh.dashboardor the webhook container:
docker ps
Parent links: SRS-055 RADAR scenario: Geo-IP AC via whitelisting, SRS-068 Manager-side enrichment
Child links: TRP-032 TCER: Build non-whitelist GeoIP detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.8 |
3.4 Build log volume abnormal growth TST-044
Preconditions and setup actions
- RADAR is set up according to TST-041:
radar/.envfilled in, Docker available on the controller host. - A Linux endpoint reachable from the manager, with
sudo.
Test steps
- On the controller host, the working directory is required to be
radar:
cd radar
- Build RADAR with the
log_volumescenario (prefix withsudoif your user cannot run Docker):
./build-radar.sh log_volume
This brings up the core stack (indexer, manager, dashboard) and the webhook container, then deploys the scenario's manager-side files, agent group configuration, decoders, rules and lists.
- Onboard the endpoint (see docs/manual/radar_docs/radar-getting-started.md, Onboard an endpoint):
sudo ./radar.sh mint-token default,log_volume 60
Copy the whole radar/radar-agent/ folder to the endpoint and, from inside it, run the printed command, e.g.:
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,log_volume --allow-service <service>
- To clean up the test environment only after a successful test execution AND a successful execution of TST-048:
- On the controller host:
./stop-radar.sh(add--purgeto also remove the volumes). - On the endpoint, from the
radar-agentfolder:sudo ./uninstall-agent.sh.
--allow-service is optional: it lists the systemd services terminate_service.sh may stop on this endpoint; without it no service can be stopped.
Expected outcome
2. Check the setup
In Wazuh Manager
Connect to the Wazuh manager to be able to perform the following verifications:
docker exec -it wazuh.manager bash
- 2.1 The RADAR snippet for log_volume is present in ossec.conf:
grep -A15 'RADAR: log_volume BEGIN' /var/ossec/etc/ossec.conf
to ensure the radar_ar_log_volume command runs radar_ar.py with <location>server</location> for <rules_id>100309</rules_id>, and terminate_service.sh is declared.
- 2.2 The log volume and AD decoders are deployed:
ls -l /var/ossec/etc/decoders/0001-log-volume.xml /var/ossec/etc/decoders/0001-ad-common.xml
to ensure both files exist.
- 2.3 The log volume rules are deployed:
grep -o 'rule id="[0-9]*"' /var/ossec/etc/rules/a1-log-volume.xml
to ensure rules 100300 and 100309 are present.
- 2.4 The Filebeat archives pipeline routes the metric to its own index:
grep -c 'log_volume_metric' /usr/share/filebeat/module/wazuh/archives/ingest/pipeline.json
to ensure the count is at least 1.
- 2.5 The agent group configuration is in place:
cat /var/ossec/etc/shared/log_volume/agent.conf
to ensure it collects /var/log/radar/log_volume_metric.log.
- 2.6 From the controller host, the OpenSearch index template
radar-log-volumeis present:
curl -u "$OS_USER:$OS_PASS" -k "$OS_URL/_index_template/radar-log-volume?pretty"
to ensure HTTP status 200 and mappings with data.log_bytes as long and agent.name as keyword.
- 2.7 Active response files are in place:
ls -l /var/ossec/active-response/bin/radar_ar.py /var/ossec/active-response/bin/ar.yaml /var/ossec/active-response/bin/active_responses.env
to ensure all three exist.
- 2.8 The agent is registered with the manager:
/var/ossec/bin/agent_control -l
to ensure an active entry exists for the endpoint (and one for the webhook agent, ad-webhook).
- 2.9 Wazuh Manager is running after the deployment:
/var/ossec/bin/wazuh-control status
to ensure the status output indicates the manager is running with no error messages.
In endpoints running agents
- 2.10 The Wazuh agent is active and the RADAR active response scripts are installed:
systemctl status wazuh-agent
ls -l /var/ossec/active-response/bin/lock_user_linux.sh /var/ossec/active-response/bin/terminate_service.sh
to ensure the agent service is active and both scripts exist.
- 2.11 The log volume collector is running:
systemctl status radar-log-volume.timer
tail -3 /var/log/radar/log_volume_metric.log
to ensure the timer is active and a new log_volume_metric: /var/log <bytes> line is appended about every 30 seconds.
Post-test cleanup
- 3 Check the cleanup after successful validations, the command output should not list
wazuh.manager,wazuh.indexer,wazuh.dashboardor the webhook container:
docker ps
Parent links: SRS-056 RADAR scenario: log size change
Child links: TRP-033 TCER: Build log volume abnormal growth
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 0.8 |
3.5 Run RADAR for log volume abnormal growth TST-045
Preconditions and setup actions
- RADAR is built according to the scenario TST-044, and the endpoint's collector has been writing for a few minutes, so that
wazuh-ad-log-volume-*holds documents.
Test steps
- The working directory is required to be
radar:
cd radar
- Run RADAR with SCENARIO_NAME log_volume. Add
--ingest trueto seed a synthetic history for the agent named inscenarios.log_volume.ingest.agent_nameofconfig.yaml, so that the detector has a baseline at once:
./run-radar.sh log_volume
Expected outcome
-
The command prints the detector ID and the monitor ID. In the Wazuh Dashboard:
2.1. In the Anomaly Detection menu, the detector
LOG_VOLUME_DETECTORis listed, started, with the configuration oflog_volumeinconfig.yaml: indexwazuh-ad-log-volume-*, featurelog_volume_max, category fieldagent.name, interval 1 minute.2.2. In the Alerting menu, the monitor
LogVolume-Monitoris listed under Monitors, enabled, with the triggerLogVolume-Growth-Detectedand an action to theRADAR Webhooknotification channel.2.3. Running the command a second time creates no second detector or monitor.
Parent links: SRS-056 RADAR scenario: log size change
Child links: TRP-034 TCER: Run RADAR for log volume abnormal growth
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 0.8 |
3.6 DECIPHER-RADAR detection validation for Suspicious login TST-046
Preconditions and setup actions
- RADAR is set up according to TST-042, with DECIPHER reachable (
DECIPHER_BASE_URL) and SMTP configured inradar/.env.
Test steps
- Copy
radar/radar-test-framework/simulate/scenarios/suspicious_login.pyto the endpoint. Edit itsCONFIGif needed (log_path, default/var/log/auth.log;hostname). - On the endpoint, run every case (
burst,travel,failed_travel,composite,benign):bash sudo python3 suspicious_login.pyor one case, e.g.sudo python3 suspicious_login.py burst.
Expected outcome
2.1. The script prints, for each case, the rules it expects and ends with suspicious_login simulation completed.
2.2. In the Wazuh Dashboard Discover page, for the endpoint: burst raises 210013 (level 8), travel 210021 (level 10), failed_travel 210020 (level 10), composite 210022 (level 12), and benign none of these rules.
2.3. In the Wazuh manager, check each decision:
docker exec wazuh.manager grep -E "Scenario identified|Risk computed|Actions planned|Wazuh Active Response dispatched" /var/ossec/logs/active-responses.log | tail -20
- Each alert is identified as scenario
suspicious_login, detectionsignature. - Expected
risk_scorerange is between 0.0 and 1.0, and the tier follows thetiersboundaries ofsuspicious_logininar.yaml. - If tier is:
- Tier 0:
- No email is received at
EMAIL_TO. - No FlowIntel case is created.
- No mitigation is dispatched (no
Wazuh Active Response dispatchedline for the decision).
- No email is received at
- Tier 1:
- The email address specified in
EMAIL_TO(from.env) receives a RADAR alert notification containing the risk score, its components and the tier. - A FlowIntel case is created (DECIPHER reachable) and can be opened from the URL in the email. Its description contains the scenario, the alert, the risk score with its components and tier, the IOCs, and the MISP events DECIPHER found (
misp_events). - The FlowIntel case is tagged with low priority.
- No mitigation is dispatched.
- The email address specified in
- Tier 2:
- Email and FlowIntel case as for Tier 1; the case is tagged with medium priority.
- If
allow_mitigationis true forsuspicious_login, each command ofmitigations_tier2is dispatched (Wazuh Active Response dispatched); otherwiseActions plannedshows them underwould_be_mitigationswithwithheld_reason: mitigation_disabled.
- Tier 3:
- Email and FlowIntel case as for Tier 1; the case is tagged with high priority.
- If
allow_mitigationis true forsuspicious_login, each command ofmitigations_tier3is dispatched; otherwise it is withheld as above.
- Tier 0:
- With the shipped
ar.yaml, a signature alert alone scores at most 0.468 and never reaches Tier 3: Tier 2 needs a CTI score of at least 0.54 (210013, 210022) or 0.73 (210020, 210021). Tier 3 with fusion is covered by TST-075. - Mitigation targets are only the alert's own source IP and users.
- Mitigation check on the agent:
firewall-drop: the alert's source IP is blocked.lock_user_linux.sh: the alert's user is locked (neverrootor a protected user).terminate_service.sh: the allowlisted service is stopped.
Parent links: SRS-051 RADAR scenario: suspicious login, SRS-059 RADAR scenario simulation framework, SRS-061 RADAR: Tiered active response logic
Child links: TRP-035 TCER: DECIPHER-RADAR detection validation for suspicious login
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 1 |
| test_data | see referenced files |
| version | 0.8 |
3.7 Detection validation for GeoIP detection TST-047
Preconditions and setup actions
- RADAR is set up according to TST-043; the GeoLite2 databases are installed on the manager. The endpoint runs Apache (or has
/var/log/apache2/access.logmonitored).
Test steps
- Copy
radar/radar-test-framework/simulate/scenarios/geoip_detection.pyto the endpoint. Edit itsCONFIGif needed (auth_log_path,web_log_path,hostname). - On the endpoint, run every case:
bash sudo python3 geoip_detection.pyor one case, e.g.sudo python3 geoip_detection.py ssh_non_whitelisted.
Expected outcome
2.1. The script prints, for each case, the rule it expects and ends with geoip_detection simulation completed.
2.2. In the Wazuh Dashboard Discover page, for the endpoint: ssh_non_whitelisted raises 100900 (level 10); web_ip, web_domain, web_domainport and web_ip_ip each raise 100902 (level 10) with data.radar_country decoded; ssh_whitelisted, ssh_private, web_ip_whitelisted and web_private raise none of them. 100902 requires the stock web rules to have raised a base alert for the request (the simulated status is 404).
2.3. In the Wazuh manager, check the decision for 100900:
docker exec wazuh.manager grep -E "Scenario identified|Risk computed|Actions planned|Wazuh Active Response dispatched" /var/ossec/logs/active-responses.log | tail -20
- The alert is identified as scenario
geoip_detection, detectionsignature. 100902 alerts produce no decision (not bound to the active response). - With the shipped
ar.yamlthe risk score is 0.54 (w_sig1.0 × likelihood 0.9 × impact 0.6, no CTI) and the tier is 2. - Expected
risk_scorerange is between 0.0 and 1.0, and the tier follows thetiersboundaries ofgeoip_detectioninar.yaml. - If tier is:
- Tier 0:
- No email is received at
EMAIL_TO. - No FlowIntel case is created.
- No mitigation is dispatched (no
Wazuh Active Response dispatchedline for the decision).
- No email is received at
- Tier 1:
- The email address specified in
EMAIL_TO(from.env) receives a RADAR alert notification containing the risk score, its components and the tier. - A FlowIntel case is created when DECIPHER is reachable; its URL is in the email.
- The FlowIntel case is tagged with low priority.
- No mitigation is dispatched.
- The email address specified in
- Tier 2:
- Email and FlowIntel case as for Tier 1; the case is tagged with medium priority.
- If
allow_mitigationis true forgeoip_detection, each command ofmitigations_tier2is dispatched (Wazuh Active Response dispatched); otherwiseActions plannedshows them underwould_be_mitigationswithwithheld_reason: mitigation_disabled.
- Tier 3:
- Email and FlowIntel case as for Tier 1; the case is tagged with high priority.
- If
allow_mitigationis true forgeoip_detection, each command ofmitigations_tier3is dispatched; otherwise it is withheld as above.
- Tier 0:
- Mitigation check on the agent:
firewall-drop: the alert's source IP is blocked.lock_user_linux.sh: the alert's user is locked (neverrootor a protected user).terminate_service.sh: the allowlisted service is stopped.
Parent links: SRS-055 RADAR scenario: Geo-IP AC via whitelisting, SRS-059 RADAR scenario simulation framework, SRS-061 RADAR: Tiered active response logic
Child links: TRP-036 TCER: Detection validation for GeoIP detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 1 |
| test_data | see referenced files |
| version | 0.8 |
3.8 Detection validation for Log volume abnormal growth TST-048
Preconditions and setup actions
- RADAR is set up and run according to TST-045, and the detector has been running long enough to have a baseline for the endpoint (or history was seeded with
--ingest true).
Test steps
- Copy
radar/radar-test-framework/simulate/scenarios/log_volume.pyto the endpoint. Edit itsCONFIGif needed:target_dir(default/var/log), the growth (start_bytes,growth_factor,steps) andcleanup_minutes. The growth must be large enough to pass the detector's rules inconfig.yaml(deviations that are too small are ignored). - On the endpoint, run:
sudo python3 log_volume.py
Expected outcome
2.1. The script ends with log_volume simulation completed.
2.2. The spike is visible on the endpoint:
tail -3 /var/log/radar/log_volume_metric.log
2.3. Within a few detector intervals, a line for the endpoint with trigger LogVolume-Growth-Detected is written to /var/log/ad_alerts.log in the webhook container, and in the Wazuh Dashboard Discover page rule 100309 is raised with data.entity_keyword set to the endpoint's agent name.
2.4. In the Wazuh manager, check the decision:
docker exec wazuh.manager grep -E "Scenario identified|Risk computed|Actions planned|Wazuh Active Response dispatched" /var/ossec/logs/active-responses.log | tail -20
- The alert is identified as scenario
log_volume, detectionad; the risk score is 0.9 × grade × confidence (no CTI source). - Expected
risk_scorerange is between 0.0 and 1.0, and the tier follows thetiersboundaries oflog_volumeinar.yaml. - If tier is:
- Tier 0:
- No email is received at
EMAIL_TO. - No FlowIntel case is created.
- No mitigation is dispatched (no
Wazuh Active Response dispatchedline for the decision).
- No email is received at
- Tier 1:
- The email address specified in
EMAIL_TO(from.env) receives a RADAR alert notification containing the risk score, its components and the tier. - A FlowIntel case is created when DECIPHER is reachable; its URL is in the email.
- The FlowIntel case is tagged with low priority.
- No mitigation is dispatched.
- The email address specified in
- Tier 2:
- Email and FlowIntel case as for Tier 1; the case is tagged with medium priority.
- If
allow_mitigationis true forlog_volume, each command ofmitigations_tier2is dispatched (Wazuh Active Response dispatched); otherwiseActions plannedshows them underwould_be_mitigationswithwithheld_reason: mitigation_disabled.
- Tier 3:
- Email and FlowIntel case as for Tier 1; the case is tagged with high priority.
- If
allow_mitigationis true forlog_volume, each command ofmitigations_tier3is dispatched; otherwise it is withheld as above.
- Tier 0:
- Mitigation check on the agent:
firewall-drop: the alert's source IP is blocked.lock_user_linux.sh: the alert's user is locked (neverrootor a protected user).terminate_service.sh: the allowlisted service is stopped.
2.5. Verify that the spike file (target_dir / spike_filename) is removed after cleanup_minutes have elapsed (if cleanup_minutes > 0), or remove it manually if cleanup_minutes is set to 0.
Parent links: SRS-056 RADAR scenario: log size change, SRS-059 RADAR scenario simulation framework, SRS-061 RADAR: Tiered active response logic
Child links: TRP-037 TCER: Detection validation for log volume abnormal growth
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 1 |
| test_data | see referenced files |
| version | 0.8 |
3.9 RADAR deployment integrity verification TST-049
Preconditions and setup actions
- Wazuh host (
vm-cyfort-radar):
- A Wazuh multi-node Docker stack (master + worker + indexer + dashboard + nginx) is deployed from the Wazuh docker repository. All containers are running (
Upstatus indocker ps). - The
docker-compose.yml(or its override) uses host bind-mount directories for all Wazuh container volumes with separate volumes for master and worker nodes. The bind-mount root used in this test run is/srv/docker-data/wazuh/. All bind-mount paths must exist on the host filesystem before the containers are started. - An NFS snapshot of historical Wazuh data is accessible and mountable at
/mnt/snapshotsinside the indexer container. The snapshot data is restored into multi-node Wazuh and the Opensearch cluster isgreen. - The user has
sudoprivileges on the Wazuh host.
- RADAR on the Wazuh host: RADAR's manager-side scripts write on the host side of the manager's bind mounts and use
docker exec, so RADAR runs on the Wazuh host itself; there is no separate controller host and no SSH access to the manager.
- The RADAR repository (v2.2.0) is checked out on the Wazuh host.
- The existing components are registered in the GUI's Infrastructure page (
radar/infra.yaml): the master and worker containers as manager nodes (master first, so it is the primary), the indexer, and the dashboard, each with its real container name (multi-node-wazuh.master-1,multi-node-wazuh.worker-1, ...), host, port and scheme. volumes.ymlmaps, for each registered manager container name, the container paths RADAR needs to their real host bind-mount paths. RADAR resolves every manager file it writes from this file. If it does not match the real bind mounts, deployment aborts or writes to the wrong place. The following container paths must be mapped for both nodes:/var/ossec/etc,/var/ossec/logs,/var/ossec/integrations,/var/ossec/active-response/bin,/etc/filebeat,/usr/share/filebeat/module/wazuh/archives/ingest/pipeline.json.
services:
multi-node-wazuh.master-1:
volumes:
- /srv/docker-data/wazuh/manager/var/ossec/etc:/var/ossec/etc
- /srv/docker-data/wazuh/manager/var/ossec/logs:/var/ossec/logs
- /srv/docker-data/wazuh/manager/var/ossec/integrations:/var/ossec/integrations
- /srv/docker-data/wazuh/manager/var/ossec/active-response/bin:/var/ossec/active-response/bin
- /srv/docker-data/wazuh/manager/etc/filebeat:/etc/filebeat
- <host path of the archives pipeline.json>:/usr/share/filebeat/module/wazuh/archives/ingest/pipeline.json
multi-node-wazuh.worker-1:
volumes:
- /srv/docker-data/wazuh/worker/var/ossec/etc:/var/ossec/etc
- ... # same container paths, worker host paths
.env(fromenv.example) points at the existing stack and holds the runtime secrets used by the deployment scripts and, copied into the manager asactive_responses.env, by the active response: OpenSearch (OS_URL,OS_USER,OS_PASS), Wazuh API (WAZUH_API_URL,WAZUH_AUTH_USER,WAZUH_AUTH_PASS),WAZUH_MANAGER_ADDRESS, the webhook (WEBHOOK_URL), SMTP settings,MAXMIND_LICENSE_KEY, and the active-response paths (AR_LOG_FILE,AR_RISK_CONFIG). Use the existing installation's own credentials; RADAR generates passwords only for a stack it deploys itself.- At least one Linux endpoint is enrolled with
radar-agent/bootstrap-agent.shfor the deployed scenarios (see TST-055).
Test steps
1. Set session variables (Wazuh host)
Set these variables in your shell before running any pre-deployment or post-deployment check commands. They must remain set for the entire session.
SNAPSHOT_DIR=/srv/radar-integrity-snapshots
mkdir -p $SNAPSHOT_DIR
DATE=$(date +%Y%m%d_%H%M%S)
INDEX_PATTERN="wazuh-alerts-4.x-2026.*,wazuh-archives-4.x-2026.*"
TOKEN=$(curl -sk -u "WAZUH_AUTH_USER:WAZUH_AUTH_PASS" \
-X POST "https://localhost:55000/security/user/authenticate?raw=true")
sudo chown $USER:$USER $SNAPSHOT_DIR
Choose a value for FINGERPRINT_CUTOFF. This timestamp defines the upper time boundary for all OpenSearch aggregation queries used in the index integrity check (Pre-05 and Post-06). It must be a UTC timestamp in the format YYYY-MM-DDTHH:MM:SS.000Z.
The value must fall within the restored snapshot data range — that is, before the most recent document in the restored snapshot — so that the query window is entirely frozen historical data. Choosing a time that lies before any live agent activity begins ensures that new alerts written after the restore cannot enter the query window and cause a false mismatch between the pre-deployment and post-deployment fingerprints. The same value must be passed identically to both Pre-05 and Post-06:
FINGERPRINT_CUTOFF="<chosen_cutoff>" # e.g. 2026-03-12T23:59:59.000Z
echo "Session: DATE=$DATE CUTOFF=$FINGERPRINT_CUTOFF"
2. Pre-deployment snapshot (Wazuh host)
Run each check in order. Do not run any build-radar.sh command until all pre-deployment checks are complete.
Pre-01: Wazuh configuration backup
sudo cp /srv/docker-data/wazuh/manager/var/ossec/etc/ossec.conf \
$SNAPSHOT_DIR/manager_ossec.conf_${DATE}.bak
sudo cp /srv/docker-data/wazuh/worker/var/ossec/etc/ossec.conf \
$SNAPSHOT_DIR/worker_ossec.conf_${DATE}.bak
ls -lh $SNAPSHOT_DIR/*ossec.conf*${DATE}*
Pre-02: Active response scripts backup
sudo find /srv/docker-data/wazuh/manager/var/ossec/active-response/bin -type f \
| sort | sudo xargs sha256sum \
> $SNAPSHOT_DIR/manager_ar_hashes_${DATE}.sha256
echo "AR baseline files: $(wc -l < $SNAPSHOT_DIR/manager_ar_hashes_${DATE}.sha256)"
Pre-03: Wazuh config file hashes
sudo find /srv/docker-data/wazuh/manager/var/ossec/etc -type f \
| sort | sudo xargs sha256sum \
> $SNAPSHOT_DIR/manager_hashes_${DATE}.sha256
sudo find /srv/docker-data/wazuh/worker/var/ossec/etc -type f \
| sort | sudo xargs sha256sum \
> $SNAPSHOT_DIR/worker_hashes_${DATE}.sha256
echo "Manager: $(wc -l < $SNAPSHOT_DIR/manager_hashes_${DATE}.sha256) files"
echo "Worker: $(wc -l < $SNAPSHOT_DIR/worker_hashes_${DATE}.sha256) files"
Pre-04: File permissions snapshot
sudo find /srv/docker-data/wazuh/manager/var/ossec/etc -type f \
-printf "%m %u %g %p\n" | sort \
> $SNAPSHOT_DIR/manager_permissions_${DATE}.txt
sudo find /srv/docker-data/wazuh/worker/var/ossec/etc -type f \
-printf "%m %u %g %p\n" | sort \
> $SNAPSHOT_DIR/worker_permissions_${DATE}.txt
echo "Permission entries: $(wc -l < $SNAPSHOT_DIR/manager_permissions_${DATE}.txt)"
Pre-05: Indexer document fingerprint
FINGERPRINT_FILE=$SNAPSHOT_DIR/index_fingerprint_${DATE}.txt
echo "Time range: 2026-01-01T00:00:00Z to ${FINGERPRINT_CUTOFF}" > $FINGERPRINT_FILE
echo "---" >> $FINGERPRINT_FILE
for INDEX in $(curl -sk -u admin:SecretPassword \
"https://localhost:9200/_cat/indices/${INDEX_PATTERN}?h=index" | sort); do
echo "=== $INDEX ===" >> $FINGERPRINT_FILE
curl -sk -u admin:SecretPassword \
"https://localhost:9200/$INDEX/_search" \
-H "Content-Type: application/json" \
-d "{
\"size\": 0,
\"query\": {\"range\": {\"timestamp\": {
\"gte\": \"2026-01-01T00:00:00.000Z\",
\"lte\": \"${FINGERPRINT_CUTOFF}\"
}}},
\"aggs\": {
\"total_docs\": {\"value_count\": {\"field\": \"timestamp\"}},
\"min_timestamp\": {\"min\": {\"field\": \"timestamp\"}},
\"max_timestamp\": {\"max\": {\"field\": \"timestamp\"}},
\"rule_id_distribution\": {
\"terms\": {\"field\": \"rule.id\", \"size\": 2000, \"order\": {\"_key\": \"asc\"}},
\"aggs\": {\"count\": {\"value_count\": {\"field\": \"timestamp\"}}}
}
}
}" | python3 -c "
import json, sys
data = json.load(sys.stdin)
aggs = data.get('aggregations', {})
total = aggs.get('total_docs', {}).get('value', 0)
min_ts = aggs.get('min_timestamp', {}).get('value_as_string', 'N/A')
max_ts = aggs.get('max_timestamp', {}).get('value_as_string', 'N/A')
print(f' total_docs: {total}')
print(f' min_timestamp: {min_ts}')
print(f' max_timestamp: {max_ts}')
buckets = aggs.get('rule_id_distribution', {}).get('buckets', [])
print(f' rule_id_count: {len(buckets)}')
for b in buckets:
print(f' rule:{b[\"key\"]} count:{b[\"doc_count\"]}')
" >> $FINGERPRINT_FILE
echo "---" >> $FINGERPRINT_FILE
done
echo "Fingerprint file: $(wc -l < $FINGERPRINT_FILE) lines written"
FILTER_PY=$(mktemp /tmp/radar_filter_XXXXXX.py)
python3 -c "
code = [
'import sys, hashlib',
'def filter_file(path):',
' with open(path) as f:',
' lines = f.read().splitlines()',
' out = []',
' i = 0',
' while i < len(lines):',
' line = lines[i]',
' if line.startswith(\"Time range:\"):',
' i += 1',
' continue',
' if line.startswith(\"=== \") and line.endswith(\" ===\"):',
' block = [line]',
' j = i + 1',
' while j < len(lines) and not (lines[j].startswith(\"=== \") and lines[j].endswith(\" ===\")):',
' block.append(lines[j])',
' j += 1',
' total_line = next((l for l in block if \"total_docs:\" in l), \"\")',
' total = total_line.split(\":\")[-1].strip() if total_line else \"?\"',
' if total != \"0\":',
' out.extend(block)',
' i = j',
' else:',
' out.append(line)',
' i += 1',
' return chr(10).join(out)',
'import hashlib',
'text = filter_file(sys.argv[1])',
'print(hashlib.sha256(text.encode()).hexdigest())',
]
with open('$FILTER_PY', 'w') as fh:
fh.write(chr(10).join(code) + chr(10))
"
python3 "$FILTER_PY" "$FINGERPRINT_FILE" > $SNAPSHOT_DIR/index_fingerprint_${DATE}.sha256
rm -f "$FILTER_PY"
echo "Fingerprint hash: $(cat $SNAPSHOT_DIR/index_fingerprint_${DATE}.sha256)"
Pre-06: Cluster health
curl -sk -H "Authorization: Bearer $TOKEN" \
"https://localhost:55000/cluster/nodes" > /tmp/cluster_raw.json
python3 -c "
import json
with open('/tmp/cluster_raw.json') as f:
data = json.load(f)
for n in data.get('data', {}).get('affected_items', []):
print(n.get('name','?'), n.get('type','?'), n.get('status','?'))
" | sort > $SNAPSHOT_DIR/cluster_${DATE}.txt
cat $SNAPSHOT_DIR/cluster_${DATE}.txt
Pre-07: Agent connectivity
curl -sk -H "Authorization: Bearer $TOKEN" \
"https://localhost:55000/agents?limit=100" \
| python3 -c "
import json, sys
data = json.load(sys.stdin)
for a in data['data']['affected_items']:
print(f\"{a['id']} {a['name']} {a['status']}\")
" | sort > $SNAPSHOT_DIR/agents_${DATE}.txt
cat $SNAPSHOT_DIR/agents_${DATE}.txt
Pre-08: Wazuh API health
curl -sk -H "Authorization: Bearer $TOKEN" \
"https://localhost:55000/manager/info" \
| python3 -c "
import json, sys
data = json.load(sys.stdin)
info = data['data']['affected_items'][0]
print(f\"version: {info['version']}\")
print(f\"uuid: {info['uuid']}\")
print(f\"type: {info['type']}\")
" > $SNAPSHOT_DIR/api_info_${DATE}.txt
cat $SNAPSHOT_DIR/api_info_${DATE}.txt
Pre-09: Existing detection test
Run a known log line through wazuh-logtest on both master and worker before any RADAR deployment. This records the baseline decoder and rule match to compare against after deployment.
docker exec -it multi-node-wazuh.master-1 bash -c \
'echo "2026-03-26T13:43:53.668837+01:00 vm-cyfort-testing-2 sudo: pam_unix(sudo:session): session closed for user root" \
| /var/ossec/bin/wazuh-logtest 2>&1 \
| grep -E "Phase|name:|id:|level:|description:|groups:"'
docker exec -it multi-node-wazuh.worker-1 bash -c \
'echo "2026-03-26T13:43:53.668837+01:00 vm-cyfort-testing-2 sudo: pam_unix(sudo:session): session closed for user root" \
| /var/ossec/bin/wazuh-logtest 2>&1 \
| grep -E "Phase|name:|id:|level:|description:|groups:"'
Pre-10: Filebeat pipeline state
curl -sk -u admin:SecretPassword \
"https://localhost:9200/_ingest/pipeline/filebeat-7.10.2-wazuh-archives-pipeline" \
> $SNAPSHOT_DIR/filebeat_pipeline_${DATE}.json
echo "Pipeline captured: $(wc -c < $SNAPSHOT_DIR/filebeat_pipeline_${DATE}.json) bytes"
Pre-11: Wazuh manager service state
docker exec multi-node-wazuh.master-1 \
/var/ossec/bin/wazuh-control status \
> $SNAPSHOT_DIR/wazuh_status_${DATE}.txt
cat $SNAPSHOT_DIR/wazuh_status_${DATE}.txt
Save snapshot date:
echo "PRE_DATE=$DATE" > $SNAPSHOT_DIR/latest.env
echo "Pre-deployment snapshot complete: $DATE"
ls -lh $SNAPSHOT_DIR/
3. RADAR deployment (Wazuh host)
Before running build-radar.sh, verify that the configuration described in the preconditions is correct and up to date:
infra.yaml— the manager nodes, indexer and dashboard are registered with their real container names (GUI Infrastructure page, Test link).volumes.yml— bind-mount paths match the actual Docker volume configuration of both manager containers..env— all credentials, addresses, and paths are set correctly for this environment.
Deploy all three scenarios sequentially:
cd ~/radar
sudo ./build-radar.sh geoip_detection
sudo ./build-radar.sh suspicious_login
sudo ./build-radar.sh log_volume
Verify each run exits with status 0 and reports no [ERROR] or [WARN] scenario apply failed line for either manager node.
4. Post-deployment checks (Wazuh host)
Load baseline and refresh token. Use the same FINGERPRINT_CUTOFF value set in step 1:
source /srv/radar-integrity-snapshots/latest.env
SNAPSHOT_DIR=/srv/radar-integrity-snapshots
FINGERPRINT_CUTOFF="<same value as step 2>"
INDEX_PATTERN="wazuh-alerts-4.x-2026.*,wazuh-archives-4.x-2026.*"
TOKEN=$(curl -sk -u "WAZUH_AUTH_USER:WAZUH_AUTH_PASS" \
-X POST "https://localhost:55000/security/user/authenticate?raw=true")
echo "PRE_DATE=$PRE_DATE"
In case of errors in the following commands, reset these variables again.
Post-01: Wazuh index file hashes
sudo find /srv/docker-data/wazuh/manager/var/ossec/etc -type f \
| sort | sudo xargs sha256sum > /tmp/manager_hashes_now.sha256
MODIFIED=$(diff $SNAPSHOT_DIR/manager_hashes_${PRE_DATE}.sha256 \
/tmp/manager_hashes_now.sha256 \
| grep "^<" | awk '{print $NF}' \
| grep -v "decoders\|rules\|lists\|active-response\|ossec.conf\|shared/\|client.keys\|sslmanager")
[ -z "$MODIFIED" ] \
&& echo "PASS - No unexpected file modifications (manager)" \
|| { echo "FAIL - Modified files outside RADAR scope (manager):"; echo "$MODIFIED"; }
echo "New files (manager):"
diff $SNAPSHOT_DIR/manager_hashes_${PRE_DATE}.sha256 /tmp/manager_hashes_now.sha256 \
| grep "^>" | awk '{print $NF}'
sudo find /srv/docker-data/wazuh/worker/var/ossec/etc -type f \
| sort | sudo xargs sha256sum > /tmp/worker_hashes_now.sha256
MODIFIED=$(diff $SNAPSHOT_DIR/worker_hashes_${PRE_DATE}.sha256 \
/tmp/worker_hashes_now.sha256 \
| grep "^<" | awk '{print $NF}' \
| grep -v "decoders\|rules\|lists\|active-response\|ossec.conf\|shared/\|client.keys\|sslmanager")
[ -z "$MODIFIED" ] \
&& echo "PASS - No unexpected file modifications (worker)" \
|| { echo "FAIL - Modified files outside RADAR scope (worker):"; echo "$MODIFIED"; }
Post-02: File permissions
sudo find /srv/docker-data/wazuh/manager/var/ossec/etc -type f \
-printf "%m %u %g %p\n" | sort > /tmp/manager_permissions_now.txt
PERM_DIFF=$(diff $SNAPSHOT_DIR/manager_permissions_${PRE_DATE}.txt \
/tmp/manager_permissions_now.txt \
| grep "^<" \
| grep -v "decoders\|rules\|lists\|active-response\|ossec.conf\|shared/\|client.keys\|sslmanager")
[ -z "$PERM_DIFF" ] \
&& echo "PASS - No unexpected permission changes" \
|| { echo "FAIL - Permission changes outside RADAR scope:"; echo "$PERM_DIFF"; }
Post-03: Existing detection test
Re-run the identical log line through wazuh-logtest on both master and worker after RADAR deployment. The decoder name, rule ID, level, description, and groups must be identical to the pre-deployment baseline recorded in Pre-09:
docker exec -it multi-node-wazuh.master-1 bash -c \
'echo "2026-03-26T13:43:53.668837+01:00 vm-cyfort-testing-2 sudo: pam_unix(sudo:session): session closed for user root" \
| /var/ossec/bin/wazuh-logtest 2>&1 \
| grep -E "Phase|name:|id:|level:|description:|groups:"'
docker exec -it multi-node-wazuh.worker-1 bash -c \
'echo "2026-03-26T13:43:53.668837+01:00 vm-cyfort-testing-2 sudo: pam_unix(sudo:session): session closed for user root" \
| /var/ossec/bin/wazuh-logtest 2>&1 \
| grep -E "Phase|name:|id:|level:|description:|groups:"'
Post-04: Agent connectivity
curl -sk -H "Authorization: Bearer $TOKEN" \
"https://localhost:55000/agents?limit=100" \
| python3 -c "
import json, sys
data = json.load(sys.stdin)
for a in data['data']['affected_items']:
print(f\"{a['id']} {a['name']} {a['status']}\")
" | sort > /tmp/agents_now.txt
PRE_AGENTS=$(cat $SNAPSHOT_DIR/agents_${PRE_DATE}.txt)
POST_AGENTS=$(cat /tmp/agents_now.txt)
[ "$PRE_AGENTS" = "$POST_AGENTS" ] \
&& { echo "PASS - All agents unchanged"; cat /tmp/agents_now.txt; } \
|| { echo "CHECK - Agent changes (webhook enrollment expected):"; \
diff <(echo "$PRE_AGENTS") <(echo "$POST_AGENTS") || true; }
Post-05: Cluster health
curl -sk -H "Authorization: Bearer $TOKEN" \
"https://localhost:55000/cluster/nodes" > /tmp/cluster_raw_now.json
python3 -c "
import json
with open('/tmp/cluster_raw_now.json') as f:
data = json.load(f)
for n in data.get('data', {}).get('affected_items', []):
print(n.get('name','?'), n.get('type','?'), n.get('status','?'))
" | sort > /tmp/cluster_now.txt
[ "$(cat $SNAPSHOT_DIR/cluster_${PRE_DATE}.txt)" = "$(cat /tmp/cluster_now.txt)" ] \
&& { echo "PASS - Cluster nodes unchanged"; cat /tmp/cluster_now.txt; } \
|| { echo "CHECK - Cluster changes:"; \
diff $SNAPSHOT_DIR/cluster_${PRE_DATE}.txt /tmp/cluster_now.txt || true; }
Post-06: Indexer document fingerprint
DATE_POST=$(date +%Y%m%d_%H%M%S)
FINGERPRINT_POST=/tmp/index_fingerprint_post_${DATE_POST}.txt
echo "Time range: 2026-01-01T00:00:00Z to ${FINGERPRINT_CUTOFF}" > $FINGERPRINT_POST
echo "---" >> $FINGERPRINT_POST
for INDEX in $(curl -sk -u admin:SecretPassword \
"https://localhost:9200/_cat/indices/${INDEX_PATTERN}?h=index" | sort); do
echo "=== $INDEX ===" >> $FINGERPRINT_POST
curl -sk -u admin:SecretPassword \
"https://localhost:9200/$INDEX/_search" \
-H "Content-Type: application/json" \
-d "{
\"size\": 0,
\"query\": {\"range\": {\"timestamp\": {
\"gte\": \"2026-01-01T00:00:00.000Z\",
\"lte\": \"${FINGERPRINT_CUTOFF}\"
}}},
\"aggs\": {
\"total_docs\": {\"value_count\": {\"field\": \"timestamp\"}},
\"min_timestamp\": {\"min\": {\"field\": \"timestamp\"}},
\"max_timestamp\": {\"max\": {\"field\": \"timestamp\"}},
\"rule_id_distribution\": {
\"terms\": {\"field\": \"rule.id\", \"size\": 2000, \"order\": {\"_key\": \"asc\"}},
\"aggs\": {\"count\": {\"value_count\": {\"field\": \"timestamp\"}}}
}
}
}" | python3 -c "
import json, sys
data = json.load(sys.stdin)
aggs = data.get('aggregations', {})
total = aggs.get('total_docs', {}).get('value', 0)
min_ts = aggs.get('min_timestamp', {}).get('value_as_string', 'N/A')
max_ts = aggs.get('max_timestamp', {}).get('value_as_string', 'N/A')
print(f' total_docs: {total}')
print(f' min_timestamp: {min_ts}')
print(f' max_timestamp: {max_ts}')
buckets = aggs.get('rule_id_distribution', {}).get('buckets', [])
print(f' rule_id_count: {len(buckets)}')
for b in buckets:
print(f' rule:{b[\"key\"]} count:{b[\"doc_count\"]}')
" >> $FINGERPRINT_POST
echo "---" >> $FINGERPRINT_POST
done
echo "Fingerprint file: $(wc -l < $FINGERPRINT_POST) lines written"
FILTER_PY=$(mktemp /tmp/radar_filter_XXXXXX.py)
python3 -c "
code = [
'import sys, hashlib',
'def filter_file(path):',
' with open(path) as f:',
' lines = f.read().splitlines()',
' out = []',
' i = 0',
' while i < len(lines):',
' line = lines[i]',
' if line.startswith(\"Time range:\"):',
' i += 1',
' continue',
' if line.startswith(\"=== \") and line.endswith(\" ===\"):',
' block = [line]',
' j = i + 1',
' while j < len(lines) and not (lines[j].startswith(\"=== \") and lines[j].endswith(\" ===\")):',
' block.append(lines[j])',
' j += 1',
' total_line = next((l for l in block if \"total_docs:\" in l), \"\")',
' total = total_line.split(\":\")[-1].strip() if total_line else \"?\"',
' if total != \"0\":',
' out.extend(block)',
' i = j',
' else:',
' out.append(line)',
' i += 1',
' return chr(10).join(out)',
'print(filter_file(sys.argv[1]))',
]
with open('$FILTER_PY', 'w') as fh:
fh.write(chr(10).join(code) + chr(10))
"
PRE_HASH=$(python3 "$FILTER_PY" "$SNAPSHOT_DIR/index_fingerprint_${PRE_DATE}.txt" \
| sha256sum | awk '{print $1}')
POST_HASH=$(python3 "$FILTER_PY" "$FINGERPRINT_POST" \
| sha256sum | awk '{print $1}')
rm -f "$FILTER_PY"
echo "Pre-RADAR: $PRE_HASH"
echo "Post-RADAR: $POST_HASH"
[ "$PRE_HASH" = "$POST_HASH" ] \
&& echo "PASS - Index data fingerprint identical" \
|| { echo "FAIL - Fingerprint changed:"; \
diff <(grep -v "^Time range:" $SNAPSHOT_DIR/index_fingerprint_${PRE_DATE}.txt) \
<(grep -v "^Time range:" $FINGERPRINT_POST) \
| grep "^[<>]" | head -30 || true; }
Post-07: Wazuh API
curl -sk -H "Authorization: Bearer $TOKEN" \
"https://localhost:55000/manager/info" \
| python3 -c "
import json, sys
data = json.load(sys.stdin)
info = data['data']['affected_items'][0]
print(f\"version: {info['version']}\")
print(f\"uuid: {info['uuid']}\")
print(f\"type: {info['type']}\")
" > /tmp/api_info_now.txt
[ "$(cat $SNAPSHOT_DIR/api_info_${PRE_DATE}.txt)" = "$(cat /tmp/api_info_now.txt)" ] \
&& { echo "PASS - API info unchanged"; cat /tmp/api_info_now.txt; } \
|| { echo "CHECK - API info changed:"; \
diff $SNAPSHOT_DIR/api_info_${PRE_DATE}.txt /tmp/api_info_now.txt || true; }
Post-08: No new errors in ossec.log
docker exec multi-node-wazuh.master-1 bash -c \
'grep -c "ERROR\|CRITICAL" /var/ossec/logs/ossec.log 2>/dev/null || echo 0'
echo "--- Last 10 ERROR/CRITICAL entries ---"
docker exec multi-node-wazuh.master-1 bash -c \
'grep "ERROR\|CRITICAL" /var/ossec/logs/ossec.log 2>/dev/null | tail -10 || echo "none"'
Post-09: Webhook service
docker inspect ad-webhook --format '{{.State.Status}}' 2>/dev/null \
&& echo "Webhook container: running" \
|| echo "FAIL - Webhook container not found or not running"
code=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/notify)
case "$code" in 200|401|404|405) echo "PASS - Webhook HTTP endpoint responding ($code)";;
*) echo "FAIL - Webhook not responding on port 8080 ($code)";; esac
Post-10: Active response wiring
echo "--- radar_ar_geoip ---"
docker exec multi-node-wazuh.master-1 bash -c \
'grep -c "radar_ar_geoip" /var/ossec/etc/ossec.conf' \
&& echo "PASS - radar_ar_geoip present" || echo "FAIL"
echo "--- radar_ar_log_volume ---"
docker exec multi-node-wazuh.master-1 bash -c \
'grep -c "radar_ar_log_volume" /var/ossec/etc/ossec.conf' \
&& echo "PASS - radar_ar_log_volume present" || echo "FAIL"
echo "--- suspicious_login AR scripts ---"
docker exec multi-node-wazuh.master-1 bash -c \
'grep -c "terminate_service\|lock_user_linux" /var/ossec/etc/ossec.conf' \
&& echo "PASS - suspicious_login AR blocks present" || echo "FAIL"
Post-11: Decoder and rule deployment
echo "--- Decoders ---"
docker exec multi-node-wazuh.master-1 bash -c \
'for f in 0310-ssh.xml 0375-web-accesslog.xml 0001-ad-common.xml 0001-log-volume.xml; do
path="/var/ossec/etc/decoders/$f"
if [ -f "$path" ]; then
stat -c "PASS %n owner=%U:%G mode=%a" "$path"
else
echo "FAIL $f not found"
fi
done'
echo "--- Rules ---"
docker exec multi-node-wazuh.master-1 bash -c \
'for f in a2-geoip-detection.xml a3-suspicious-login.xml a1-log-volume.xml; do
path="/var/ossec/etc/rules/$f"
if [ -f "$path" ]; then
stat -c "PASS %n owner=%U:%G mode=%a" "$path"
else
echo "FAIL $f not found"
fi
done'
Post-12: Python dependencies
docker exec multi-node-wazuh.master-1 python3 -c \
"import yaml, requests; print('PASS - pyyaml and requests importable')" \
|| echo "FAIL - Python dependency missing in container"
docker exec multi-node-wazuh.master-1 /var/ossec/framework/python/bin/python3 -c \
"import maxminddb; print('PASS - maxminddb importable')" \
|| echo "FAIL - maxminddb missing in the Wazuh framework Python"
Post-13: GeoIP databases on the managers
Enrichment runs on the manager, so the GeoLite2 databases are on each manager node, not on the agents:
for c in multi-node-wazuh.master-1 multi-node-wazuh.worker-1; do
for db in GeoLite2-City.mmdb GeoLite2-ASN.mmdb; do
docker exec "$c" stat -c "PASS $c %n size=%s bytes" "/var/ossec/etc/radar/$db" \
|| echo "FAIL $c $db not found"
done
done
Post-14: Existing rules unmodified
UNCHANGED=$(diff $SNAPSHOT_DIR/manager_hashes_${PRE_DATE}.sha256 \
/tmp/manager_hashes_now.sha256 \
| grep "^<" | awk '{print $NF}' \
| grep -v "decoders\|rules\|lists\|active-response\|ossec.conf\|shared/\|client.keys\|sslmanager")
[ -z "$UNCHANGED" ] \
&& echo "PASS - All pre-existing files byte-for-byte unmodified" \
|| { echo "FAIL - Pre-existing files changed outside RADAR scope:"; echo "$UNCHANGED"; }
Post-15: Filebeat pipeline integrity
curl -sk -u admin:SecretPassword \
"https://localhost:9200/_ingest/pipeline/filebeat-7.10.2-wazuh-archives-pipeline" \
| python3 -c "
import json, sys
content = sys.stdin.read()
print('PASS - log_volume patch in OpenSearch pipeline' if 'log_volume_metric' in content \
else 'FAIL - patch not in OpenSearch pipeline')
"
Post-16: OpenSearch index mappings
echo "--- Existing wazuh-alerts-* template ---"
curl -sk -u admin:SecretPassword \
"https://localhost:9200/_index_template/wazuh" \
| python3 -c "
import json, sys
data = json.load(sys.stdin)
for t in data.get('index_templates', []):
print(t.get('name'), '->', t.get('index_template', {}).get('index_patterns'))
"
echo "--- RADAR-specific templates (log_volume) ---"
curl -sk -u admin:SecretPassword \
"https://localhost:9200/_index_template/radar*" \
| python3 -c "
import json, sys
data = json.load(sys.stdin)
templates = data.get('index_templates', [])
if templates:
for t in templates:
print('PRESENT:', t.get('name'), t.get('index_template', {}).get('index_patterns'))
else:
print('No RADAR templates (expected unless log_volume deployed)')
"
5. Cleanup
cd ~/wazuh-docker/multi-node
docker compose down -v
docker stop ad-webhook 2>/dev/null || true
sudo rm -rf /srv/docker-data/wazuh/
rm -f /tmp/cluster_raw.json /tmp/*_now.sha256 /tmp/*_now.txt
Expected outcome
Step 2 — Pre-deployment: All baseline files created. And all commands run without any error and permission issues.
Step 3 — Deployment: All three build-radar.sh runs exit with status 0, with the scenario applied to both manager nodes.
Step 3 — Post-deployment:
- Post-01:
PASS - No unexpected file modifications (manager)and(worker). - Post-02:
PASS - No unexpected permission changes. - Post-03: On both master and worker: decoder
pam, rule5502, level3, descriptionPAM: Login session closed., groupspam, syslog. Must be identical before and after deployment. - Post-04: Existing agents unchanged. Webhook agent enrollment expected and labelled.
- Post-05:
PASS - Cluster nodes unchanged. - Post-06:
PASS - Index data fingerprint identical. - Post-07:
PASS - API info unchanged. - Post-08: No ERROR/CRITICAL entries attributable to RADAR in ossec.log.
- Post-09: Webhook container running and HTTP endpoint responding.
- Post-10: All three scenario AR command blocks confirmed present in
ossec.conf. - Post-11: All six decoder and rule files present with
root:wazuhownership. - Post-12:
PASS - pyyaml and requests importableandPASS - maxminddb importable. - Post-13: Both GeoLite2
.mmdbfiles present on both manager nodes. - Post-14:
PASS - All pre-existing files byte-for-byte unmodified. - Post-15:
log_volume_metricpatch present in container pipeline file (2 matches). OpenSearch pipelinefilebeat-7.10.2-wazuh-archives-pipelinealso contains the patch. - Post-16: No changes to
wazuh-alerts-*template.wazuh-ad-log-volume-*template present afterlog_volumedeployment.
Parent links: SRS-002 Endpoint Status Monitoring, SRS-013 HIDS Agent Status Panel, SRS-014 Event Decoding & Transformation, SRS-069 Scenario-scoped agent group configuration delivery, SRS-085 Monitoring a fleet of endpoints
Child links: TRP-038 TCER: RADAR deployment integrity verification
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 4 |
| test_data | see referenced files |
| version | 0.8.2 |
3.10 Build scanning detection TST-051
Preconditions and setup actions
- RADAR is set up according to TST-041:
radar/.envfilled in, Docker available on the controller host. - A Linux endpoint reachable from the manager, with
sudo.
Test steps
- On the controller host, the working directory is required to be
radar:
cd radar
- Build RADAR with the
scanning_detectionscenario (prefix withsudoif your user cannot run Docker):
./build-radar.sh scanning_detection
This brings up the core stack (indexer, manager, dashboard) and the webhook container, then deploys the scenario's manager-side files, agent group configuration, decoders, rules and lists.
- Onboard the endpoint (see docs/manual/radar_docs/radar-getting-started.md, Onboard an endpoint):
sudo ./radar.sh mint-token default,scanning_detection 60
Copy the whole radar/radar-agent/ folder to the endpoint and, from inside it, run the printed command, e.g.:
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,scanning_detection
- To clean up the test environment only after a successful test execution AND a successful execution of TST-052:
- On the controller host:
./stop-radar.sh(add--purgeto also remove the volumes). - On the endpoint, from the
radar-agentfolder:sudo ./uninstall-agent.sh.
Expected outcome
2. Check the setup
In Wazuh Manager
Connect to the Wazuh manager to be able to perform the following verifications:
docker exec -it wazuh.manager bash
- 2.1 The scanning detection rules are deployed:
grep -o 'rule id="[0-9]*"' /var/ossec/etc/rules/a4-scanning-detection.xml
to ensure rules 100810, 100815, 100820, 100821, 100825, 100826, 100827, 100828, 100829, 100830, 100831, 100832, 100835 and 100840 are present.
- 2.2 The scenario's lists are deployed and declared:
ls -l /var/ossec/etc/lists/radar_scanning_allowlist /var/ossec/etc/lists/radar_webdav_apps
grep -n 'radar_scanning_allowlist\|radar_webdav_apps' /var/ossec/etc/ossec.conf
to ensure both lists exist and are declared under <ruleset>.
- 2.3 Only the confirmation rule is bound to the RADAR active response:
grep -A15 'RADAR: scanning_detection BEGIN' /var/ossec/etc/ossec.conf
to ensure the radar_ar_scanning command runs radar_ar.py with <location>server</location> for <rules_id>100830</rules_id> only.
- 2.4 The agent group configuration is in place:
cat /var/ossec/etc/shared/scanning_detection/agent.conf
to ensure it collects /var/log/suricata/eve.json as json and the Apache and Nginx access logs as apache.
- 2.5 Active response files are in place:
ls -l /var/ossec/active-response/bin/radar_ar.py /var/ossec/active-response/bin/ar.yaml /var/ossec/active-response/bin/active_responses.env
to ensure all three exist.
- 2.6 The agent is registered with the manager:
/var/ossec/bin/agent_control -l
to ensure an active entry exists for the endpoint (and one for the webhook agent, ad-webhook).
- 2.7 Wazuh Manager is running after the deployment:
/var/ossec/bin/wazuh-control status
to ensure the status output indicates the manager is running with no error messages.
In endpoints running agents
- 2.8 The Wazuh agent is active and the RADAR active response scripts are installed:
systemctl status wazuh-agent
ls -l /var/ossec/active-response/bin/lock_user_linux.sh /var/ossec/active-response/bin/terminate_service.sh
to ensure the agent service is active and both scripts exist.
- 2.9 Suricata is running and writes HTTP events:
systemctl status suricata
tail -5 /var/log/suricata/eve.json | grep '"event_type":"http"'
to ensure Suricata is active and eve.json contains recent http events (with http.status, http.http_method and http.http_user_agent) for the web server's traffic.
Post-test cleanup
- 3 Check the cleanup after successful validations, the command output should not list
wazuh.manager,wazuh.indexer,wazuh.dashboardor the webhook container:
docker ps
Parent links: SRS-015 Custom Rule Support, SRS-066 RADAR scenario: web scanning detection
Child links: TRP-041 TCER: Build scanning detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 1.1 |
3.11 Detection validation for scanning detection TST-052
Preconditions and setup actions
- RADAR is set up according to TST-051.
Test steps
- Copy
radar/radar-test-framework/simulate/scenarios/scanning_detection.pyto the endpoint. Edit itsCONFIGif needed:log_path(default/var/log/suricata/eve.json),host,webdav_host(a virtual host listed inradar_webdav_apps) andfail_threshold(must equal thefrequencyof rule 100825). - On the endpoint, run every case (they are spaced so that alerts stay attributable):
sudo python3 scanning_detection.py
or one case, e.g. sudo python3 scanning_detection.py confirm_1_3.
Expected outcome
2.1. The script prints, for each case, the rules it expects and ends with scanning_detection simulation completed.
2.2. In the Wazuh Dashboard Discover page:
i1_onlyraises 100810 (level 3);i2_only100825 (level 10);i2_belowonly 100815;i3_only100820 and 100821 (level 6); none of them raises 100830.i2_spread,i3_excluded,webdav_appandlegitraise nothing above level 3.confirm_1_2,confirm_1_3andconfirm_2_3each raise 100830 (level 12) with the source IP;confirm_splitdoes not.
2.3. In the Wazuh manager, check the decisions for 100830:
docker exec wazuh.manager grep -E "Scenario identified|Risk computed|Actions planned|Wazuh Active Response dispatched" /var/ossec/logs/active-responses.log | tail -20
- Each 100830 alert is identified as scenario
scanning_detection, detectionsignature; no other rule of the scenario produces a decision. - With the shipped
ar.yamlthe risk score is 0.378 + 0.3 × CTI score, so Tier 2 at least. - A source listed in
radar_scanning_allowlistis still alerted, but its mitigation is declined: the audit entry in/var/ossec/logs/active-responses.loghas"result":"declined","reason":"allowlist". - Expected
risk_scorerange is between 0.0 and 1.0, and the tier follows thetiersboundaries ofscanning_detectioninar.yaml. - If tier is:
- Tier 0:
- No email is received at
EMAIL_TO. - No FlowIntel case is created.
- No mitigation is dispatched (no
Wazuh Active Response dispatchedline for the decision).
- No email is received at
- Tier 1:
- The email address specified in
EMAIL_TO(from.env) receives a RADAR alert notification containing the risk score, its components and the tier. - A FlowIntel case is created (DECIPHER reachable) and can be opened from the URL in the email. Its description contains the scenario, the alert, the risk score with its components and tier, the IOCs, and the MISP events DECIPHER found (
misp_events). - The FlowIntel case is tagged with low priority.
- No mitigation is dispatched.
- The email address specified in
- Tier 2:
- Email and FlowIntel case as for Tier 1; the case is tagged with medium priority.
- If
allow_mitigationis true forscanning_detection, each command ofmitigations_tier2is dispatched (Wazuh Active Response dispatched); otherwiseActions plannedshows them underwould_be_mitigationswithwithheld_reason: mitigation_disabled.
- Tier 3:
- Email and FlowIntel case as for Tier 1; the case is tagged with high priority.
- If
allow_mitigationis true forscanning_detection, each command ofmitigations_tier3is dispatched; otherwise it is withheld as above.
- Tier 0:
- Mitigation check on the agent:
firewall-drop: the alert's source IP is blocked.lock_user_linux.sh: the alert's user is locked (neverrootor a protected user).terminate_service.sh: the allowlisted service is stopped.
Parent links: SRS-061 RADAR: Tiered active response logic, SRS-066 RADAR scenario: web scanning detection
Child links: TRP-042 TCER: Detection validation for scanning detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | see referenced files |
| version | 1.1 |
3.12 Validate default scenario rules deployment TST-053
Preconditions and setup actions
- RADAR is set up according to TST-041:
radar/.envfilled in, Docker available on the controller host. - A Linux endpoint reachable from the manager, with
sudo.
Test steps
- On the controller host, the working directory is required to be
radar:
cd radar
- Build RADAR with any scenario; the
defaultrules and response binding are deployed with every scenario. For example, thesuspicious_loginscenario (prefix withsudoif your user cannot run Docker):
./build-radar.sh suspicious_login
This brings up the core stack (indexer, manager, dashboard) and the webhook container, then deploys the scenario's manager-side files, agent group configuration, decoders, rules and lists.
- Onboard the endpoint (see docs/manual/radar_docs/radar-getting-started.md, Onboard an endpoint):
sudo ./radar.sh mint-token default,suspicious_login,radar_shared 60
Copy the whole radar/radar-agent/ folder to the endpoint and, from inside it, run the printed command, e.g.:
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,suspicious_login,radar_shared
- To clean up the test environment only after a successful test execution AND a successful execution of TST-054:
- On the controller host:
./stop-radar.sh(add--purgeto also remove the volumes). - On the endpoint, from the
radar-agentfolder:sudo ./uninstall-agent.sh.
Expected outcome
In Wazuh Manager
Connect to the Wazuh manager:
docker exec -it wazuh.manager bash
- 2.1 The RADAR rules of the default scenario are deployed:
grep -o 'rule id="[0-9]*"' /var/ossec/etc/rules/radar_rules.xml
to ensure rule IDs 100400 to 100405 are present.
- 2.2
ar.yamlmaps the default scenario:
grep -A12 "^ default:" /var/ossec/active-response/bin/ar.yaml
to ensure signature.rule_ids lists 100401, 100402, 100404, 100405, 23503, 23504, 23505 and rule_groups lists authentication_failures.
- 2.3 The active-response binding in
ossec.confincludes both the exact IDs and the group:
grep -A12 'radar_ar_default' /var/ossec/etc/ossec.conf
to ensure one <active-response> lists <rules_id>100401,100402,100404,100405,23503,23504,23505</rules_id> and another <rules_group>authentication_failures,</rules_group>, both with <location>server</location>.
- 2.4 Wazuh Manager is running after the deployment:
/var/ossec/bin/wazuh-control status
to ensure status output indicates running with no error messages.
Post-test cleanup
- 3 Check the cleanup after successful validations, the command output should not list
wazuh.manager,wazuh.indexer,wazuh.dashboardor the webhook container:
docker ps
Parent links: SRS-009 Signature-Based HIDS, SRS-015 Custom Rule Support, SRS-088 RADAR default baseline rules
Child links: TRP-043 TCER: Validate default scenario rules detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Manual |
| verification_method | Test (T) |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 1.2 |
3.13 DECIPHER-RADAR detection validation for default rules TST-054
Preconditions and setup actions
- RADAR is set up according to TST-053, with the endpoint's Wazuh vulnerability detection enabled (the manager default) and packages with known vulnerabilities installed on it.
Test steps
- Wait for the endpoint's package inventory to be collected and scanned (up to about 60 minutes after enrollment, depending on the syscollector and vulnerability detection intervals).
- Optionally, on the endpoint, make repeated failed SSH logins for an existing user until a stock rule of the
authentication_failuresgroup fires.
Expected outcome
1.1. At least one alert of rule IDs 23503, 23504 or 23505 is raised for the endpoint (step 2: an alert in the authentication_failures group).
1.2. In the Wazuh manager, check the decisions:
docker exec wazuh.manager grep -E "Scenario identified|Risk computed|Actions planned|Wazuh Active Response dispatched" /var/ossec/logs/active-responses.log | tail -20
- Each alert is identified as scenario
default(matched by rule ID, or by the groupauthentication_failures), detectionsignature, unless its rule ID is mapped to another scenario (rule-ID matches take precedence over group matches). - The
defaultscenario has no DECIPHER analysis endpoint, so the CTI score is 0 and, with the shippedar.yaml, the risk score isw_sig0.7 × likelihood × impact 0.5: 0.00035 (23503), 0.00175 (23504), 0.0035 (23505) and 0.105 (authentication_failures), all belowtier1_min0.15, so Tier 0. Only the PowerShell and command-shell rules 100401–100405 (Windows endpoints with Sysmon) score 0.21, Tier 1. No mitigation is configured. - Tier 0: no email, no FlowIntel case.
- Tier 1: the email address specified in
EMAIL_TOreceives a RADAR alert notification with the risk score and tier; when DECIPHER is reachable, a FlowIntel case tagged with low priority is created and its URL is in the email.
Parent links: SRS-026 TIP Data Export, SRS-088 RADAR default baseline rules
Child links: TRP-044 TCER: DECIPHER-RADAR detection validation for default rules
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Manual |
| verification_method | Test (T) |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 1.2 |
3.14 GUI: Build & validate suspicious_login TST-055
Preconditions and setup actions
- A controller host/node is available:
- A Linux machine/VM is available to the tester.
- OS: recent GNU/Linux distribution, preferably an Ubuntu distribution (22.04+).
- A second test node (accessible via the controller node) is available: GNU/Linux distro e.g. Debian GNU/Linux 13 (trixie).
- Python must be installed on this node.
- Targeted Wazuh manager and agent versions:
4.14.1. - The values needed for
.envare available. Seeenv.example— each variable has a comment explaining what it's for and exactly what format/value it needs. At minimum for this scenario:OS_URL/OS_USER/OS_PASS,WAZUH_API_URL/WAZUH_AUTH_USER/WAZUH_AUTH_PASS,WAZUH_MANAGER_ADDRESS, andMAXMIND_LICENSE_KEY(see below). - A MaxMind GeoLite2 license key is available (used by the manager to download the GeoIP databases needed for this scenario's own enrichment — country, region, city, ASN, velocity):
- Create a free MaxMind account at MaxMind GeoLite2 sign-up.
- Once logged in, go to the account's My License Key page and generate a new license key.
- Keep this key ready to paste into
.envasMAXMIND_LICENSE_KEYin the test steps below. Note that MaxMind's own sign-up flow may change over time — if the linked page doesn't match, use MaxMind's current account/license-key management page instead.
- The DECIPHER Stack (DECIPHER, FlowIntel and MISP) is deployed and reachable from the Wazuh manager. The validated version is available in the DECIPHER folder of the SATRAP-DL repository, tested against
v1.0of SATRAP-DL. Once deployed, configure theDECIPHER_BASE_URLvariable in.envto point to the running DECIPHER instance. -
Shell commands in the expected outcomes use
$OS_URL,$OS_USERand$OS_PASS. The first deployment generatesOS_PASS, so load these from.envafter the scenario is deployed (step 3), in the shell where you run the checks:bash cd radar for v in OS_URL OS_USER OS_PASS; do export "$v=$(PYTHONPATH=. python3 -m wazuh_api.envfile get "$v")"; doneConfirm with
env | grep OS_. Do not use the stockSecretPassword: the indexer rejects it withUnauthorized.
Optional: test the full pipeline including integration with DECIPHER
- Bring the DECIPHER stack up following the corresponding steps in DECIPHER TST-021
- Configure the DECIPHER setting as per the setup actions in DECIPHER TST-022
Test steps
- On the controller host, prepare
.env:
cd radar
cp env.example .env
Edit it with the values described in Preconditions above. Leave OS_PASS, DASHBOARD_PASS and WAZUH_AUTH_PASS empty: the first deployment generates them and saves them in .env.
- Start the GUI:
./radar.sh gui
This creates a Python virtual environment and installs dependencies automatically on first run. Open the login URL printed in the terminal (http://127.0.0.1:5000/?token=…). If the browser runs on another machine, first open an SSH tunnel to the controller: ssh -L 5000:127.0.0.1:5000 <user>@<controller>.
-
In the GUI, go to Deployment → Scenario Management (default Deploy scenario sub-tab), select scenario
suspicious_login, and click Deploy. If prompted for the sudo password, enter it. -
In the GUI, go to Deployment → Agent Management (default Onboard agent sub-tab). Select scenario
suspicious_login, click Mint token, and copy the printedbootstrap-agent.shcommand. -
Copy the whole
radar-agentfolder to the agent host, then, on the agent host and from inside that folder, run the copied command exactly as printed, or by adding an--agent-nameargument (the script reads its active-response scripts, collectors and helpers from the folder):
scp -r radar-agent <user>@<agent-host>:~/
ssh <user>@<agent-host>
cd radar-agent
-
In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario
suspicious_login, and click Assign group. -
Check health of manager: in Deployment → Status, choose the Suspicious Login scenario and press Run health check.
-
Copy the simulation script to the agent host and run it directly there:
scp radar-test-framework/simulate/scenarios/suspicious_login.py <user>@<agent-host>:~/
ssh <user>@<agent-host>
sudo python3 suspicious_login.py
This script is fully standalone. It runs interactively by default: after each case it prints the expected rule IDs (present and absent), then waits for [y]es / [n]o / [q]uit; check the dashboard for that case before answering. Add -b to run all cases unattended.
Expected outcome
-
.envexists in the controller with the required variables set, includingMAXMIND_LICENSE_KEY. -
The GUI is reachable in a browser, and the Deployment page shows Scenario Management, Agent Management, and Group Management tabs all present. On first run, a
.venvdirectory is created under the RADAR root. -
Two items to verify:
-
(a) The command completes with
=== SUCCESSin its output. -
(b) Confirm the GeoLite databases were downloaded:
-
docker exec -it wazuh.manager bash -c 'ls -l /var/ossec/etc/radar/GeoLite2-*'
Both GeoLite2-City.mmdb and GeoLite2-ASN.mmdb should be present.
-
A ready-to-run command of the form
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,suspicious_login,radar_sharedis printed. -
The command completes with
=== SUCCESS ===in its output. -
On the Wazuh Dashboard, open Agents management → Summary. The agent should be assigned groups
suspicious_loginandradar_shared. -
No
FAILlines should be present in the health check. -
Three items to verify:
-
(a)
suspicious_login.pyis copied and runs on the agent host without error, printing "suspicious_login simulation completed". -
(b) Tail manager logs in a separate terminal (within 1 minute, confirm authentication events enriched with RADAR columns appear in the log):
docker exec -it wazuh.manager bash -c 'tail -F /var/ossec/logs/radar/enriched_auth.log' -
(c) A Wazuh rule for suspicious login
210***appears in Wazuh Dashboard (Discovery).
-
Cleanup
- After finishing tests, clean up using Deployment → Teardown in the GUI. In the event that the GUI teardown fails, you can use the following command on the server host:
docker compose -f docker-compose.core.yml -f docker-compose.webhook.yml -f volumes.yml down -v --remove-orphans
- To clean agent host:
ssh <user>@<agent-host>
cd radar-agent
sudo ./uninstall-agent.sh --purge-data
Parent links: SRS-051 RADAR scenario: suspicious login, SRS-061 RADAR: Tiered active response logic, SRS-064 RADAR SOAR web interface: frontend, SRS-067 Secure agent enrollment and automated onboarding, SRS-070 RADAR GUI deployment interface
Child links: TRP-045 TCER: GUI: Build & validate suspicious_login
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 2 |
| version | 2.0 |
3.15 GUI: Build & validate geoip_detection TST-056
Preconditions and setup actions
- Same as TST-055 (including the MaxMind GeoLite2 license key precondition —
geoip_detectionneeds it too).
Test steps
- On the controller host, prepare
.env:
cd radar
cp env.example .env
Edit it with the values described in Preconditions (see TST-055).
- Start the GUI:
./radar.sh gui
This creates a Python virtual environment and installs dependencies automatically on first run. Open the login URL printed in the terminal (http://127.0.0.1:5000/?token=…). If the browser runs on another machine, first open an SSH tunnel to the controller: ssh -L 5000:127.0.0.1:5000 <user>@<controller>.
-
In the GUI, go to Deployment → Scenario Management (default Deploy scenario sub-tab), select scenario
geoip_detection, and click Deploy. If prompted for the sudo password, enter it. -
In the GUI, go to Deployment → Agent Management (default Onboard agent sub-tab). Select scenario
geoip_detection, click Mint token, and copy the printedbootstrap-agent.shcommand. -
Copy the whole
radar-agentfolder to the agent host, then, on the agent host and from inside that folder, run the copied command exactly as printed, or by adding an--agent-nameargument (the script reads its active-response scripts, collectors and helpers from the folder):
scp -r radar-agent <user>@<agent-host>:~/
ssh <user>@<agent-host>
cd radar-agent
-
In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario
geoip_detection, and click Assign group. -
Check health of manager: in Deployment → Status, choose the GeoIP Detection scenario and press Run health check.
-
Copy the simulation script to the agent host and run it directly there:
scp radar-test-framework/simulate/scenarios/geoip_detection.py <user>@<agent-host>:~/
ssh <user>@<agent-host>
sudo python3 geoip_detection.py
This script is fully standalone. It runs interactively by default: after each case it prints the expected rule IDs (present and absent), then waits for [y]es / [n]o / [q]uit; check the dashboard for that case before answering. Add -b to run all cases unattended.
- (Optional) If DECIPHER is configured, open Flowintel in browser.
Expected outcome
-
.envexists in the controller with the required variables set, includingMAXMIND_LICENSE_KEY. -
The GUI is reachable in a browser, and the Deployment page shows Scenario Management, Agent Management, and Group Management tabs all present.
-
Two items to verify:
-
(a) The command completes with
=== SUCCESSin its output. -
(b) Confirm the GeoLite databases were downloaded:
docker exec -it wazuh.manager bash -c 'ls -l /var/ossec/etc/radar/GeoLite2-*'
Both GeoLite2-City.mmdb and GeoLite2-ASN.mmdb should be present.
-
A ready-to-run command of the form
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,geoip_detection,radar_sharedis printed. -
The command completes with
=== SUCCESS ===in its output. -
On the Wazuh Dashboard, open Agents management → Summary. The agent should be assigned groups
geoip_detectionandradar_shared. -
No
FAILlines should be present in the health check. -
Two items to verify:
-
(a)
geoip_detection.pyis copied and runs on the agent host without error, printing "geoip_detection simulation completed". -
(b) Tail manager logs in a separate terminal:
docker exec -it wazuh.manager bash -c 'tail -F /var/ossec/logs/ossec.log /var/ossec/logs/active-responses.log /var/ossec/logs/radar/enrichment_errors.log'
Within 2 minutes, confirm:
- Rule
100900(SSH case) and rule100902(web cases) appear in Wazuh Dashboard (Discovery), and no rule fires for the whitelisted and private-address cases. radar_ar.pywrote an active-response entry toactive-responses.log.- An email notification is delivered (check the SMTP relay logs or destination inbox).
enrichment_errors.loghas no new entries.
-
(Optional) Items to verify:
-
(a) A FlowIntel case is created and can be accessed at the Flowintel URL included in the email notification.
-
(b) The FlowIntel case contains relevant information about the event, related events found in MISP, and a breakdown of the risk score including the assigned tier.
-
Cleanup
-
After finishing tests, clean up using Deployment → Teardown in the GUI.
-
To clean agent host:
ssh <user>@<agent-host>
cd radar-agent # the folder copied for bootstrap-agent.sh
sudo ./uninstall-agent.sh --purge-data
Parent links: SRS-055 RADAR scenario: Geo-IP AC via whitelisting, SRS-061 RADAR: Tiered active response logic, SRS-064 RADAR SOAR web interface: frontend, SRS-067 Secure agent enrollment and automated onboarding, SRS-070 RADAR GUI deployment interface
Child links: TRP-046 TCER: GUI: Build & validate geoip_detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 2 |
| version | 2.0 |
3.16 GUI: Build & validate scanning_detection TST-057
Preconditions and setup actions
- Same as TST-055. No MaxMind key is needed for this scenario. The simulation writes Suricata
eve.jsonrecords to/var/log/suricata/eve.jsonon the agent host (the directory is created if missing); thescanning_detectionagent configuration collects that file together with the Apache and Nginx access logs.
Optional: test the full pipeline including integration with DECIPHER
- Bring the DECIPHER stack up following the corresponding steps in DECIPHER TST-021
- Configure the DECIPHER setting as per the setup actions in DECIPHER TST-022
Test steps
- On the controller host, prepare
.env:
cd radar
cp env.example .env
Edit it with the values described in Preconditions (see TST-055).
- Start the GUI:
./radar.sh gui
This creates a Python virtual environment and installs dependencies automatically on first run. Open the login URL printed in the terminal (http://127.0.0.1:5000/?token=…). If the browser runs on another machine, first open an SSH tunnel to the controller: ssh -L 5000:127.0.0.1:5000 <user>@<controller>.
-
In the GUI, go to Deployment → Scenario Management (default Deploy scenario sub-tab), select scenario
scanning_detection, and click Deploy. If prompted for the sudo password, enter it. -
In the GUI, go to Deployment → Agent Management (default Onboard agent sub-tab). Select scenario
scanning_detection, click Mint token, and copy the printedbootstrap-agent.shcommand. -
Copy the whole
radar-agentfolder to the agent host, then, on the agent host and from inside that folder, run the copied command exactly as printed, or by adding an--agent-nameargument (the script reads its active-response scripts, collectors and helpers from the folder):
scp -r radar-agent <user>@<agent-host>:~/
ssh <user>@<agent-host>
cd radar-agent
-
In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario
scanning_detection, and click Assign group. -
Check health of manager: in Deployment → Status, choose the Scanning Detection scenario and press Run health check.
-
Copy the simulation script to the agent host and run it directly there:
scp radar-test-framework/simulate/scenarios/scanning_detection.py <user>@<agent-host>:~/
ssh <user>@<agent-host>
sudo python3 scanning_detection.py
This script is fully standalone. It runs interactively by default: after each case it prints a hint block (source IP, time window, and the exact rule IDs expected present/absent), then pauses and waits for [y]es / [n]ot yet / [q]uit before moving to the next case, check the dashboard for that case before answering.
To check what the script actually sent for a given case, use the wazuh-archives-* index in Discover. It captures every analyzed event, alert or not, which is useful for confirming an "expect absent" line in the hint. If that index pattern does not exist yet, create it once via Dashboards Management → Index Patterns → Create index pattern, matching wazuh-archives-* in Wazuh Dashboard.
- (Optional) If DECIPHER is configured, open Flowintel in browser.
Expected outcome
-
.envexists in the controller with the required variables set. -
The GUI is reachable in a browser, and the Deployment page shows Scenario Management, Agent Management, and Group Management tabs all present. On first run, a
.venvdirectory is created under the RADAR root. -
Two items to verify:
-
(a) The command completes with
=== SUCCESSin its output. -
(b) Confirm the manager applied the scanning_detection config:
-
docker exec -it wazuh.manager cat /var/ossec/etc/ossec.conf | grep -A3 "RADAR: scanning_detection"
The marked block should be present.
-
A ready-to-run command of the form
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,scanning_detectionis printed. -
The command completes with
=== SUCCESS ===in its output. -
On the Wazuh Dashboard, open Agents management → Summary. The agent should be assigned group
scanning_detection. -
No
FAILlines should be present in the health check. -
Three items to verify:
-
(a)
scanning_detection.pyis copied and runs on the agent host without error. It pauses after each case for confirmation — answeryfor every case (after checking the dashboard) to reach the end; it then prints "scanning_detection simulation completed". -
(b) Within 2 minutes, scanning rules appear in Wazuh Dashboard (Discovery) for each case's
presentrule IDs. -
(c) For cases with an
absentexpectation, cross-checkwazuh-archives-*in Discover (create the index pattern first via Dashboards Management → Index Patterns if it is not there yet), confirm the raw event was received by the manager but the listed rule ID(s) genuinely never fired. -
(d) Receive an email notification in cases where rule ID
100830is expected to be triggered. The body includes, among other fields:Context events(the count of correlated indicator events found for this specific source IP within the confirmation window — should be 2 or more, not 0, for aconfirm_*case),Scenario details(the scanning-specificscan_src_ip/uri/http_method/user_agentextracted from those events, not the genericIOCsline above it),CTI score (T),CTI labels, andIdentified scanners.
-
-
(Optional) Items to verify:
-
(a) One or two FlowIntel cases may be created per confirmed scan: RADAR's own incident (tier ≥ 1, linked in the email's
FlowIntel case/Case URL). -
(b) Open the case linked in the email and confirm its description contains: source metadata (
source,decision_id, scenario/detection type, originating rule); a risk breakdown matching the email'sComponentsline (score, tier, anomaly/signature/CTI sub-components); aniocssection plus, forscanning_detection, anextrassection (scan_src_ip/uri/http_method/user_agent) matching the email'sScenario details;misp_events. -
(c) The description also contains the elements
misp_eventsandidentified_scanners, either carrying information or an empty value. -
(d) If the value for
misp_eventsis a non-empty list, theCTI score (T)is non-zero.
-
Cleanup
-
After finishing tests, clean up using Deployment → Teardown in the GUI.
-
To clean agent host:
ssh <user>@<agent-host>
cd radar-agent # the folder copied for bootstrap-agent.sh
sudo ./uninstall-agent.sh --purge-data
Parent links: SRS-061 RADAR: Tiered active response logic, SRS-064 RADAR SOAR web interface: frontend, SRS-066 RADAR scenario: web scanning detection, SRS-067 Secure agent enrollment and automated onboarding, SRS-070 RADAR GUI deployment interface
Child links: TRP-047 TCER: GUI: Build & validate scanning_detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 2 |
| version | 2.0 |
3.17 GUI: Build & validate log_volume TST-058
Preconditions and setup actions
- Same generic preconditions as TST-055.
Test steps
- On the controller host, prepare
.env:
cd radar
cp env.example .env
Edit it with the values described in Preconditions (see TST-055).
- Start the GUI:
./radar.sh gui
This creates a Python virtual environment and installs dependencies automatically on first run. Open the login URL printed in the terminal (http://127.0.0.1:5000/?token=…). If the browser runs on another machine, first open an SSH tunnel to the controller: ssh -L 5000:127.0.0.1:5000 <user>@<controller>.
-
In the GUI, go to Deployment → Scenario Management (default Deploy scenario sub-tab), select scenario
log_volume, and click Deploy. If prompted for the sudo password, enter it. -
In the GUI, go to Deployment → Agent Management (default Onboard agent sub-tab). Select scenario
log_volume, click Mint token, and copy the printedbootstrap-agent.shcommand. -
Copy the whole
radar-agentfolder to the agent host, then, on the agent host and from inside that folder, run the copied command exactly as printed, or by adding an--agent-nameargument (the script reads its active-response scripts, collectors and helpers from the folder):
scp -r radar-agent <user>@<agent-host>:~/
ssh <user>@<agent-host>
cd radar-agent
-
In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario
log_volume, and click Assign group. -
On controller host, adjust the agent name
agent_nameunder ingest variablesingestoflog_volumepart inradar/config.yaml. The agent name should be the same as the agent name represented in Wazuh Dashboard. -
In the GUI, go to Deployment → Anomaly Detector (card: Run Anomaly Detector), choose
Log Volume Growth, check the ingest option, and press Run. -
Check health of manager: in Deployment → Status, choose the Log Volume Growth scenario and press Run health check.
-
Wait 30 minutes for detector training, then copy the simulation script to the agent host and run it directly there:
scp radar-test-framework/simulate/scenarios/log_volume.py <user>@<agent-host>:~/
ssh <user>@<agent-host>
sudo python3 log_volume.py
This script is fully standalone.
- (Optional) If DECIPHER is configured, open Flowintel in browser.
Expected outcome
-
.envexists in the controller with the required variables set. -
The GUI is reachable in a browser, and the Deployment page shows Scenario Management, Agent Management, Group Management, and Anomaly Detector tabs all present. On first run, a
.venvdirectory is created under the RADAR root. -
Two items to verify:
-
(a) The command completes with
=== SUCCESSin its output. -
(b) On the manager side (i.e. server node), confirm the index template was applied. Load
OS_URL,OS_USERandOS_PASSfrom.envfirst, as described in the preconditions of TST-055:
-
curl -u "$OS_USER:$OS_PASS" -k "$OS_URL/_index_template/radar-log-volume?pretty"
The template should be returned, not a 404.
-
A ready-to-run command of the form
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,log_volumeis printed. -
The command completes with
=== SUCCESS ===in its output. -
On the Wazuh Dashboard, open Agents management → Summary. The agent should be assigned group
log_volume. -
N/A
-
Two items to verify:
-
(a) The streamed output completes without an
[ERROR]line, and reports the detector was created and started. Checking the ingest option is required here — without it, the underlying index has no documents yet, and detector creation fails with an OpenSearch "Timestamp field... not found in index mapping" error. -
(b) Confirm the index now has data:
-
curl -u "$OS_USER:$OS_PASS" -k "$OS_URL/_cat/indices/wazuh-ad-log-volume-*?v"
docs.count should be greater than 0.
-
No
FAILlines should be present in the health check. -
Three items to verify:
-
(a)
log_volume.pyis copied and runs on the agent host without error, printing "log_volume simulation completed". -
(b) A spike or anomaly event is detected and visible on the log volume detector page of the Anomaly Detection dashboard of Wazuh.
-
(c) Active-response mitigation commands are logged in
active-responses.log:docker exec -it wazuh.manager bash -c 'tail -F /var/ossec/logs/ossec.log /var/ossec/logs/active-responses.log' -
(d) Confirm that rule
100309(LogVolume-Growth-Detected) fires in Wazuh Dashboard (Discovery). And email notification is received.
-
-
(Optional) Items to verify:
-
(a) A FlowIntel case is created and can be accessed at the Flowintel URL included in the email notification.
-
(b) The FlowIntel case contains relevant information about the event, related events found in MISP, and a breakdown of the risk score including the assigned tier.
-
Cleanup
-
After finishing tests, clean up using Deployment → Teardown in the GUI.
-
To clean agent host:
ssh <user>@<agent-host>
cd radar-agent # the folder copied for bootstrap-agent.sh
sudo ./uninstall-agent.sh --purge-data
Parent links: SRS-054 RADAR automated test framework, SRS-056 RADAR scenario: log size change, SRS-061 RADAR: Tiered active response logic, SRS-064 RADAR SOAR web interface: frontend, SRS-067 Secure agent enrollment and automated onboarding, SRS-070 RADAR GUI deployment interface
Child links: TRP-048 TCER: GUI: Build & validate log_volume
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 2 |
| version | 2.0 |
3.18 GUI: Unenroll, undeploy, and deregister log_volume TST-059
Preconditions and setup actions
- Requires TST-058.
Test steps
- On the controller host, start the GUI (if not already running):
cd radar
./radar.sh gui
Open the GUI in a browser at the printed host:port.
-
On the Wazuh Dashboard, open Agents management → Summary and note the agent's current group membership before making any changes.
-
In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario 'Log Volume Growth', and click Unenroll from groups.
-
On the Wazuh Dashboard, open Agents management → Summary again and check the agent's group membership.
-
In the GUI, go to Deployment → Group Management again. Enter the agent's IP/name, select scenario 'Log Volume Growth', and click Assign group, to re-enroll it before the next step.
-
In the GUI, go to Deployment → Scenario Management, open the Undeploy scenario sub-tab, select scenario 'Log Volume Growth', and click Undeploy.
-
In the GUI, open Deployment → Status, select scenario 'Log Volume Growth', and click Run health check.
-
On the manager host, confirm directly that the scenario's
ossec.confblock is gone:
docker exec wazuh.manager grep -c "RADAR: log_volume" /var/ossec/etc/ossec.conf
-
On the Wazuh Dashboard, open Agents management → Summary once more and check the agent's group membership.
-
In the GUI, go to Deployment → Agent Management, open the Deregister agent sub-tab, enter the agent's name, and click Deregister agent.
-
On the Wazuh Dashboard, open Agents management → Summary and check whether the agent is still listed.
Expected outcome
-
The GUI is reachable in a browser, with Scenario Management, Agent Management, Group Management, and Status tabs all present under Deployment.
-
The agent shows both the
defaultandlog_volumegroups. -
The streamed output ends with a JSON result and a success line, of the form:
=== SUCCESS: group unassignment for 'log_volume' completed ===
-
The agent now shows only the
defaultgroup —log_volumehas been removed, anddefaultis untouched. -
The streamed output ends with a JSON result and a success line, of the form:
=== SUCCESS: group assignment for 'log_volume' completed ===
and the agent is re-assigned to both default and log_volume.
- The streamed output ends with:
=== SUCCESS: undo for 'log_volume' completed ===
with no error key present in either printed result.
- Two items to verify:
- (a) The four
wazuh-*daemon checks, and the OpenSearch/Webhook checks at the bottom, all still reportOK. - (b) The
log_volumechecks for active-response wiring, group configuration, the three decoder/rule files, and the agents assigned to the scenario's group now reportFAIL.
-
The command returns
0. -
The agent shows only the
defaultgroup. -
The streamed output ends with JSON result followed by success message:
=== SUCCESS: deregistration for '<agent-name>' completed ===
- The agent no longer appears in the agents list at all.
Cleanup
-
After finishing tests, clean up using the Teardown tab in the GUI.
-
The agent host is cleaned using the script:
ssh <user>@<agent-host>
cd radar-agent # the folder copied for bootstrap-agent.sh
sudo ./uninstall-agent.sh --purge-data
Parent links: SRS-004 HIDS Agent Management, SRS-069 Scenario-scoped agent group configuration delivery, SRS-070 RADAR GUI deployment interface
Child links: TRP-049 TCER: GUI: Unenroll, undeploy, and deregister log_volume
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 2.0 |
3.19 GUI: Deploy scenario on pre-existing SN Wazuh TST-060
This test verifies the correct deployment of scenarios on a pre-existing single node Wazuh instance.
Preconditions and setup actions
- Same generic preconditions as TST-055.
- A single-node Wazuh v4.14 manager, indexer, and dashboard must already be running in Docker containers, independently of RADAR, before any RADAR step below is taken. RADAR runs on the same host as these containers (its manager-side scripts write to the manager's bind mounts and use
docker exec), so the controller host and the Wazuh host are the same machine. If you don't already have one, bring up a single-node stack using Wazuh's own official docker-compose files.
Test steps
-
On the controller host, prepare
.envpointing it at the existing Wazuh stack's addresses. -
Start the GUI:
./radar.sh gui
-
In the GUI, go to Infrastructure. Register the existing stack's components with their real container names:
- Manager: host address, port
55000, schemehttps, container name matchingdocker pson the Wazuh host (e.g.<project>-wazuh.manager-1). - Indexer: host address, port
9200, schemehttps, its real container name (e.g.<project>-wazuh.indexer-1). - Dashboard: host address, port
443, schemehttps, its real container name.
- Manager: host address, port
-
On the Infrastructure page, use Test link to check reachability between the components.
-
On the Wazuh host, confirm
volumes.ymlhas an entry keyed by the manager's exact container name (from step 3). Each line has the form<host path>:<container path>. The left side is wherever the data actually lives on disk; the right side is the fixed path RADAR needs inside the container — the six right-hand paths below must all be present under your container's key:/var/ossec/etc/var/ossec/logs/var/ossec/integrations/var/ossec/active-response/bin/etc/filebeat/usr/share/filebeat/module/wazuh/archives/ingest/pipeline.json
If any mapping is missing, add it under the manager's container-name key, pointing at the actual host paths bind-mounted into that container (docker inspect <manager_container> --format '{{json .Mounts}}' on the Wazuh host shows the real paths in use).
-
In the GUI, go to Deployment → Scenario Management, select the scenario under test, and click Deploy. If prompted for the sudo password, enter it.
-
In the GUI, go to Deployment → Agent Management. Select the same scenario, click Mint token, and copy the printed
bootstrap-agent.shcommand. -
Copy the whole
radar-agentfolder to the agent host, then, on the agent host and from inside that folder, run the copied command exactly as printed:
scp -r radar-agent <user>@<agent-host>:~/
ssh <user>@<agent-host>
cd radar-agent
-
In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select the scenario under test, and click Assign group.
-
Continue with the remaining steps of the matching scenario's own test, run against the container names registered in step 3 above instead of the default names those tests use:
Expected outcome
-
.envexists in the controller with the required variables set, pointing at the existing Wazuh stack. -
The GUI is reachable in a browser.
-
Infrastructure page shows the manager, indexer, and dashboard registered with the existing stack's real container names.
3a. WEBHOOK_INTERNAL_PORT's port is confirmed free before use, or a free alternative is chosen and both WEBHOOK_INTERNAL_PORT/WEBHOOK_URL and the registered webhook port match it.
-
Test link reports components are reachable.
-
volumes.ymlhas a complete entry for the manager's container name; none of the six required container paths are missing. -
The Deploy command completes with
=== SUCCESSin its output. -
A ready-to-run
bootstrap-agent.shcommand is printed, carrying the group(s) for the scenario under test. -
The command completes with
=== SUCCESS ===in its output. -
On the Wazuh Dashboard, open Agents management → Summary. The agent is assigned the scenario's group(s).
-
The remaining expected outcomes match those listed under the same step numbers of the matching scenario's own test referenced in step 10 above (no
FAILlines in the health check; the simulation script completes; and that scenario's rule, log, email, and optional FlowIntel checks all pass), read against the container names registered in step 3 above rather than the default ones those tests use.
Cleanup
-
After finishing tests, clean up using Deployment → Teardown in the GUI, without the data-removal option: the pre-existing stack runs outside RADAR's compose project, so only RADAR's own containers (the webhook) are stopped. Do not select data removal, which deletes the host directories listed in
volumes.ymlfor the manager. -
To clean the agent host:
ssh <user>@<agent-host>
cd radar-agent # the folder copied for bootstrap-agent.sh
sudo ./uninstall-agent.sh --purge-data
- If the pre-existing Wazuh stack itself should also be torn down, that is done independently of RADAR, using whatever process was used to bring it up.
Parent links: SRS-069 Scenario-scoped agent group configuration delivery, SRS-070 RADAR GUI deployment interface
Child links: TRP-050 TCER: GUI: Deploy scenario on pre-existing SN Wazuh
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 3 |
| test_data | see referenced files |
| version | 2.1.0 |
3.20 GUI: Build and deploy linux_resource_utilization TST-061
This test checks that the linux_resource_utilization scenario can be deployed on the manager, that a Linux agent can be onboarded into it, that the agent's CPU and memory metrics reach OpenSearch, and that everything can be removed again.
Preconditions and setup actions
- Same generic preconditions as TST-055. No MaxMind key is needed for this scenario.
- The
linux_resource_utilizationscenario is not deployed on the manager, and the agent host has no Wazuh agent installed.
Test steps
- On the controller host, prepare
.env:
cd radar
cp env.example .env
Edit it with the values described in the preconditions of TST-055.
- Start the GUI:
./radar.sh gui
Open the login URL printed in the terminal (http://127.0.0.1:5000/?token=…). If the browser runs on another machine, first open an SSH tunnel to the controller: ssh -L 5000:127.0.0.1:5000 <user>@<controller>.
-
In the GUI, go to Deployment → Scenario Management → Deploy scenario, select scenario
Linux Resource Utilization, and click Deploy. If prompted for the sudo password, enter it. -
In the GUI, go to Deployment → Agent Management → Onboard agent. Select scenario
Linux Resource Utilization, click Mint token, and copy the printedbootstrap-agent.shcommand. -
Copy the whole
radar-agentfolder to the agent host:
scp -r radar-agent <user>@<agent-host>:~/
ssh <user>@<agent-host>
cd radar-agent
Then, on the agent host and from inside that folder, run the command copied in step 4, exactly as printed or with an added --agent-name argument.
-
In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario
Linux Resource Utilization, and click Assign group. Optional, this step is only required if bootstrap is run not the first time. -
On the agent host, check the metric collector:
systemctl list-timers | grep radar-linux-resource-utilization
tail -n 3 /var/log/radar/resource_usage_metric.log
-
In the GUI, go to Deployment → Anomaly Detector → Run Anomaly Detector, choose
Linux Resource Utilization, check the ingest option box, and press Run. -
On the controller, count the agent's metric events in OpenSearch (replace
<agent-name>):
(set -a; source .env; set +a; curl -s -k -u "$OS_USER:$OS_PASS" "$OS_URL/wazuh-archives-*/_count?q=agent.name:<agent-name>+AND+_exists_:data.mem_usage_pct&pretty")
-
Check the health of the manager: in Deployment → Status, choose the
Linux Resource Utilizationscenario and press Run health check. -
Run the steps in Cleanup.
Cleanup
-
In the GUI, bring down and remove the Wazuh stack from Deployment → Teardown.
-
Uninstall the agent from its host with:
ssh <user>@<agent-host>
cd radar-agent # the folder copied for bootstrap-agent.sh
sudo ./uninstall-agent.sh --purge-data
Afterwards, verify that:
systemctl list-timers | grep radar-linux-resource-utilizationprints nothing/usr/local/bin/radar-linux-resource-utilization-metric.shno longer existsdpkg -l wazuh-agentreports nothing.
Expected outcome
-
.envexists on the controller with the required variables set. -
The GUI is reachable in a browser, and the Deployment page shows the Scenario Management, Agent Management, Group Management, and Anomaly Detector tabs.
-
Linux Resource Utilizationis listed in the scenario dropbox lists and is indicated as "not deployed". The streamed output completes with=== SUCCESSand no[ERROR]line. -
A ready-to-run command of the form
sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,linux_resource_utilizationis printed. -
The command completes with
=== SUCCESS ===, and its output containsOK - installed and started radar-linux-resource-utilization.timer. On the Wazuh Dashboard, Agents management → Summary shows the agent in grouplinux_resource_utilization. -
On the Wazuh Dashboard, Agents management → Summary shows the agent in group
linux_resource_utilization. -
The timer
radar-linux-resource-utilization.timeris listed, and the log shows lines of the form<timestamp> <hostname> resource_usage_metric: cpu=<cpu_pct> mem=<mem_pct>, about 30 seconds apart. -
The streamed output shows
Doneand contains the messages[+] Created detector 'LINUX_RESOURCE_UTILIZATION_DETECTOR'and[✓] Started detector. The "Output" screen does not show any errors. -
countis greater than0. -
No
FAILline is present, and all checks reportOK. -
The cleanup completes as described in Cleanup.
Parent links: SRS-064 RADAR SOAR web interface: frontend, SRS-067 Secure agent enrollment and automated onboarding, SRS-070 RADAR GUI deployment interface, SRS-071 RADAR scenario: Linux resource utilization detection
Child links: TRP-051 TCER: GUI - Build and deploy linux_resource_utilization
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 2 |
| test_data | see referenced files |
| version | 2.2 |
3.21 Validate detection of linux_resource_utilization TST-062
This test checks that RADAR raises an anomaly when CPU usage on a Linux agent goes far above its normal level. The detector is trained on baseline data that matches the agent's normal CPU and memory usage. A CPU load of 90% is then applied while memory stays at its normal level. The test passes if the detector reports an anomaly during the CPU load and the anomaly is caused only by CPU.
The detector LINUX_RESOURCE_UTILIZATION_DETECTOR checks each agent every minute, using four values: cpu_usage_avg, cpu_usage_max, memory_usage_avg and memory_usage_max. It raises an alert when anomaly_grade ≥ 0.01 and confidence ≥ 0.01.
Deployment and onboarding are validated by TST-061. This test repeats those steps in every run only to start from a clean state; the outcomes are not validated again.
Preconditions and setup actions
- Same preconditions as TST-061.
- Successful execution of TST-061 with the same controller and agent host to be used in this test.
stress-ngat least v0.19.02 is installed on the agent host (sudo apt-get install -y stress-ng).- For the optional step, Flowintel is correctly configured and reachable from the controller host.
Setup
The following steps are executed only once, before the first run of this test.
- From the root of the project, copy the simulation script and the
radar-agentfolder (which holdsbootstrap-agent.shanduninstall-agent.sh) to the agent's host, and make the simulation script executable:
scp radar/radar-test-framework/simulate/scenarios/linux_resource_utilization.sh <user>@<agent-host>:~/
scp -r radar/radar-agent <user>@<agent-host>:~/
ssh <user>@<agent-host>
chmod +x linux_resource_utilization.sh
- Run the following on the agent host while it is idle. It uses the same calculation as the RADAR collector
radar-linux-resource-utilization-metric.sh, takes 5 samples 60 seconds apart, and prints their average:
for i in $(seq 1 5); do
read -r t1 i1 < <(awk '/^cpu / {t=0; for(k=2;k<=NF;k++) t+=$k; print t, $5}' /proc/stat); sleep 1
read -r t2 i2 < <(awk '/^cpu / {t=0; for(k=2;k<=NF;k++) t+=$k; print t, $5}' /proc/stat)
awk -v dt=$((t2-t1)) -v di=$((i2-i1)) \
'/^MemTotal:/{t=$2} /^MemAvailable:/{a=$2}
END{printf "cpu=%.2f mem=%.2f\n", (1-di/dt)*100, (1-a/t)*100}' /proc/meminfo
[ "$i" -lt 5 ] && sleep 59
done | tee /dev/stderr | awk -F'[= ]' '{c+=$2; m+=$4; n++} END{printf "average: cpu=%.2f mem=%.2f\n", c/n, m/n}'
-
On the controller host, set
baseline_cpu_pctandbaseline_mem_pctin theingestpart of thelinux_resource_utilizationsection ofradar/config.yamlto the printed averages. The other ingest values stay as they are. -
On the controller host, prepare
.envand start the GUI of RADAR as in steps 1-2 of TST-061.
Assumptions
- The baseline values in
config.yamlhave been set according to the agent's host normal usage metrics, as described in the Setup section. - Nothing runs on the agent's host other than the operating system, the Wazuh agent and the stress script.
- Installing the agent causes a short CPU spike, which the detector may report as an anomaly.
- Each run starts from a clean state, using the steps in Cleanup.
Acceptance criteria
The test is run 10 times. It passes if, in every run:
- An anomaly with
cpu_usage_max≥ 80% is reported. - That anomaly has
anomaly_grade≥ 0.8 andconfidence≥ 0.3.
In addition, the expected outcome of step 5 holds in the first run.
Test steps
-
Deploy the scenario and onboard the agent, following steps 3-5 of TST-061:
- In the GUI, go to Deployment → Scenario Management → Deploy scenario, select
Linux Resource Utilization, and click Deploy. - In Deployment → Agent Management → Onboard agent, select
Linux Resource Utilization, click Mint token, and run the printedbootstrap-agent.shcommand on the agent host from inside~/radar-agent.
- In the GUI, go to Deployment → Scenario Management → Deploy scenario, select
-
On the agent's host, start generating CPU stress (target CPU load 90%):
./linux_resource_utilization.sh --mode=cpu
-
Immediately after step 2 (while the CPU stress process is still running), go to the GUI's Deployment → Anomaly Detector → Run Anomaly Detector page, choose
Linux Resource Utilization, check the ingest option box, and press Run. By selecting the ingest option, a sample of baseline data is generated based on the reference values added toconfig.yamlduring the setup; the sample simulates logs received every 30 seconds during 240 minutes. -
On the Wazuh dashboard, open Explore → Anomaly Detection → Detectors → LINUX_RESOURCE_UTILIZATION_DETECTOR. Wait up to 5 minutes, then record the
anomaly_gradeandconfidenceof the reported anomaly, along with the expected and observed values of thecpu_usage_max. -
First run only: check the response to the anomaly.
- On the controller, follow the active response log:
docker exec -it wazuh.manager bash -c 'tail -F /var/ossec/logs/active-responses.log' - Check the inbox of the email address configured in
.env. - (Optional) If DECIPHER is configured, open FlowIntel in the browser.
- On the controller, follow the active response log:
-
Run the steps in Cleanup.
Cleanup
-
Bring down and remove the Wazuh stack from the GUI, using Deployment → Teardown.
-
Uninstall the agent from its host with:
cd ~/radar-agent
sudo ./uninstall-agent.sh --purge-data
Afterwards, verify that:
systemctl list-timers | grep radar-linux-resource-utilizationprints nothing/usr/local/bin/radar-linux-resource-utilization-metric.shno longer existsdpkg -l wazuh-agentreports nothing.
Expected outcome
-
Not checked in this test. If deployment or onboarding fails, the run is not counted: fix the setup and repeat TST-061.
-
The script runs without error, printing the CPU and memory lines and then
linux_resource_utilization simulation completed. Load released. -
The streamed output shows
Doneand contains the messages[+] Created detector 'LINUX_RESOURCE_UTILIZATION_DETECTOR'and[✓] Started detector. The "Output" screen does not show any errors. -
Within 5 minutes, an anomaly meeting the Acceptance criteria is visible on the
LINUX_RESOURCE_UTILIZATION_DETECTORpage of the Anomaly Detection dashboard of Wazuh. -
Validate the following:
-
a. Active response messages are logged, including
Scenario identified {"scenario":"linux_resource_utilization","detection":"ad","rule_id":"100321","matched_by":"rule_id"}and a computedrisk_scoreof at least 0.21 (0.9 × 0.8 × 0.3, when DECIPHER returns no match). -
b. An email with subject "[RADAR] linux_resource_utilization" is received at the email configured in
.env; the email contains details about the alert and a link to a Flowintel case, if configured. -
c. (Optional) A FlowIntel case titled
RADAR: abnormal CPU/memory utilizationis created and can be opened from the URL included in the email notification. The case contains the event, related MISP lookups, and the breakdown of the risk score including the assigned tier.
-
-
The cleanup validations described in "Cleanup" succeed.
Parent links: SRS-054 RADAR automated test framework, SRS-071 RADAR scenario: Linux resource utilization detection
Child links: TRP-052 TCER: Validation of linux_resource_utilization detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 3 |
| test_data | see referenced files |
| version | 2.2 |
3.22 RADAR: signature and anomaly fusion in the risk engine TST-073
Preconditions and setup actions
- RADAR test dependencies installed (
pytest,responses,pyyaml).
Test steps
- From the repository root, run the RADAR suite:
radar/tests/run-tests.shor only these tests:cd radar && PYTHONPATH="$PWD/anomaly_detector:$PWD" pytest tests/py/test_radar_ar_fusion.py tests/py/test_radar_ar.py -v
Expected outcome
- Fusion is off unless a scenario enables it and has anomaly and signature rules with non-zero
w_adandw_sig. In the shippedar.yamlonlysuspicious_loginenables it, and no other shipped scenario queries the indexer for a counterpart. - Without a counterpart, an alert's risk score and components are exactly its single-alert ones. A counterpart raises only the component the alert does not carry and never lowers one.
- A signature alert matches a trusted anomaly alert for the same user: weight 1 inside the anomaly's data window extended back by the lead, decreasing linearly to 0 at the window edge, falling back to the monitor period without a data window. Only the strongest counterpart counts. Anomaly alerts not written by the webhook agent from its log, and alerts for another user, are ignored.
- An anomaly alert matches the scenario's signature alerts for the same user, with each rule's own likelihood, and never itself. Hybrid alerts are not fused.
- A failing fusion lookup leaves the decision to proceed on the alert's own score; a match is reported in the decision's extras.
- An anomaly alert yields no
firewall-droporlock_user_linux.shtarget;lock_user_linux.shtargets only the users named in the alert, never context users. Hybrid alerts get their anomaly scores. - With the shipped calibration,
geoip_detectionrules 100900/100901/100903 reach T2 and 100902 stays T1; asuspicious_loginsignature alert alone keeps the tier it had withtier2_max0.66, and reaches T3 only with a fused anomaly.
radar/tests/py/test_radar_ar_fusion.pyradar/tests/py/test_radar_ar.py
Parent links: SRS-061 RADAR: Tiered active response logic
Child links: TRP-067 TCER: RADAR: signature and anomaly fusion in the risk engine
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | stable |
| complexity | 3 |
| test_data | alerts and ar.yaml configurations built in the tests, and the shipped radar/scenarios/active_responses/ar.yaml |
| version | 2.2 |
3.23 RADAR: anomaly monitor, webhook and decoder contract TST-074
Preconditions and setup actions
- RADAR test dependencies installed (
pytest,responses,flask,pyyaml). - RADAR's
radar/anomaly_detectoris importable asanomaly_detector:run-tests.shsets this up. In an environment where anotheranomaly_detectorpackage is installed (for example the SONAR dependency group), run the RADAR suite from an environment without it.
Test steps
- From the repository root, run:
radar/tests/run-tests.sh
Expected outcome
- The monitor query returns up to
monitor_max_entitiesresults whose grade and confidence are both above their thresholds. Its message template renders to valid JSON carrying the top hit's keys (includingdataStart/dataEnd) and ananomalieslist with one entry per hit. - A deployed monitor whose stored payload fingerprint or detector differs is updated; one whose fingerprint matches is left alone. The detector ID is read from a stored monitor's nested query.
- The webhook writes one line per entity, keeping the highest-graded hit, appends
data_start/data_endin ISO UTC only when both are usable, still writes one line for a body withoutanomalies, skips invalid entries, and rejects a body whose entries are all invalid. Injection attempts in any field are rejected. - All copies of
0001-ad-common.xmlare identical, and both of itsopensearch_ad_detectorregexes match the line the webhook writes. - The trigger rules 100309, 210040, 210041 and 100321 attach to every AD catch-all rule (100300, 210039, 100320) through
if_group radar_ad_received, and none usesif_sid. - The body built by
inject_ad_alert.pyis accepted by the webhook and produces a line for rule 210040.
radar/tests/py/test_monitor.pyradar/tests/py/test_ad_alerts_webhook.pyradar/tests/py/test_radar_ar.py
Parent links: SRS-056 RADAR scenario: log size change, SRS-061 RADAR: Tiered active response logic, SRS-071 RADAR scenario: Linux resource utilization detection, SRS-089 RADAR anomaly alert relay contract
Child links: TRP-068 TCER: RADAR: anomaly monitor, webhook and decoder contract
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | stable |
| complexity | 2 |
| test_data | monitor payloads and webhook bodies built in the tests, mocked OpenSearch responses, and the shipped decoder and rule files |
| version | 2.2 |
3.24 RADAR: suspicious_login signature and anomaly fusion end to end TST-075
Preconditions and setup actions
- Same generic preconditions as TST-055.
suspicious_logindeployed (rules, decoders including0001-ad-common.xml, active response), its off-hours monitors and detector created (./radar.sh run suspicious_login), and the agent bootstrapped with thesuspicious_logingroup.- The webhook running and reachable from the manager host (
http://127.0.0.1:8080/notifyby default),WEBHOOK_SHARED_SECRETset inradar/.env. suspicious_login.pyandinject_ad_alert.pycopied fromradar/radar-test-framework/simulate/scenarios/to the agent host and the manager host respectively.
Test data: simulated SSH logins for users test01 and test02, and injected off-hour anomalies
Test steps
- Anomaly first: on the manager host run
python3 inject_ad_alert.py(entitytest01). Within 30 minutes, on the agent runsudo python3 suspicious_login.py burst. - Wait at least 30 minutes. Signature first: on the agent run
sudo python3 suspicious_login.py burst, then within 5 minutes on the manager host runpython3 inject_ad_alert.py. - Wait at least 30 minutes. Other user: set
entitytotest02ininject_ad_alert.py'sCONFIG, run it, then on the agent runsudo python3 suspicious_login.py burst(usertest01). - For each step, inspect
/var/ossec/logs/active-responses.logon the manager, the email, and (if DECIPHER is configured) the Flowintel case.
Expected outcome
- Rule 210040 fires for
test01and its decision runs. The 210013 decision then logsFusion: counterpart matchedwithcounterpart: adand the 210040 alert ID, and its risk score is higher than the 210013 score of step 3. With no CTI score: 0.168 alone, up to 0.384 with the default injected anomaly (grade 0.8 × confidence 0.9), less the further the burst is from the injected data window. - The 210040 decision logs
Fusion: counterpart matchedwithcounterpart: signatureand a 210013 alert ID. It dispatches nofirewall-dropand nolock_user_linux.sh(no source IP or Linux user in an anomaly alert), whatever its tier. - The 210013 decision logs
Fusion: no counterpart in windowand its risk score equals the single-alert score. - In steps 1 and 2, the email's scenario details and the case show the
fusionmatch (alert ID, rule, gap, weight). Any mitigation of the 210013 decision targets only that alert's source IP and usertest01.
Cleanup
- Restore
entity: "test01"ininject_ad_alert.py. - If a mitigation ran, remove the firewall block and unlock
test01on the agent.
radar/radar-test-framework/simulate/scenarios/inject_ad_alert.pyradar/radar-test-framework/simulate/scenarios/suspicious_login.py
Parent links: SRS-061 RADAR: Tiered active response logic
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 4 |
| version | 2.2 |
3.25 RADAR: anomaly scenarios deployed together TST-076
Preconditions and setup actions
- Same generic preconditions as TST-055.
log_volumeandlinux_resource_utilizationboth deployed on the same manager, their detectors and monitors created, and an agent in both groups (optionallysuspicious_logindeployed as well).
Test data: log_volume and linux_resource_utilization simulations (inject mode for linux_resource_utilization)
Test steps
- Through the Wazuh server API, test a webhook line for each trigger with the location the rules require:
PUT /logtest {"event": "<webhook line>", "log_format": "syslog", "location": "/var/log/ad_alerts.log"}once withOpenSearchAD LinuxResourceUtilization-Anomaly-Detected: entity="<agent>", …and once withOpenSearchAD LogVolume-Growth-Detected: entity="<agent>", …. - Run the
linux_resource_utilizationsimulation in inject mode on the agent, then thelog_volumesimulation, as in their own test specifications. - Inspect the alerts in the Wazuh dashboard and
/var/ossec/logs/active-responses.log.
Expected outcome
- The resource-utilization line ends in rule 100321 and the log-volume line in rule 100309, each under the AD catch-all rule that matched first (100300 when
log_volumeis deployed). - Both simulations raise their trigger rule.
- Both scenarios' active responses run and identify their own scenario (
linux_resource_utilizationfor 100321,log_volumefor 100309).
radar/scenarios/rules/log_volume/a1-log-volume.xmlradar/scenarios/rules/linux_resource_utilization/a5-linux-resource-utilization.xml
Parent links: SRS-014 Event Decoding & Transformation, SRS-056 RADAR scenario: log size change, SRS-061 RADAR: Tiered active response logic, SRS-071 RADAR scenario: Linux resource utilization detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 3 |
| version | 2.2 |
3.26 RADAR: off-hours marking, configuration and deployment logic TST-077
Preconditions and setup actions
- Same generic preconditions as TST-055.
poetry install --with radar,test.- For step 3, a running Wazuh indexer reachable as
OS_URL(credentials inradar/.env).
Test steps
- From
radar/, runtests/run-tests.sh, or onlyPYTHONPATH=anomaly_detector:. poetry run pytest tests/py/test_off_hours.py tests/py/test_suspicious_login_ingest.py tests/py/test_ad_alerts_webhook.py tests/py/test_filebeat_pipeline.py. - From
radar/anomaly_detector/, runpoetry run python off_hours.py validate --config ../config.yaml. - From
radar/, runpoetry run python radar-test-framework/checks/off_hours_simulate.py --env .env.
Expected outcome
- All tests pass. In particular:
- every case of the shared table gives the expected flag, group and user (including midnight-crossing shifts, summer time, upper-case names, unknown and ignored users, and unreadable times);
- each invalid input of SRS-062 requirement 1 is rejected with a message naming it;
- the rule-mode query reports a long session once and again after the quiet period;
- the rendered rule-mode message gives a webhook line with
off_hours_countandschedule_group, while other AD lines are unchanged; - the model-mode detector uses only model-mode groups,sum(radar.off_hours)and no imputation; - redeploying replaces stale monitors and detectors in place and stops the previous detectors; - the synthetic history marks no shift event as off hours except trent's evenings and burst. - The command logs
validwith the rule-mode and model-mode groups. - The script prints
PASSfor every case and ends with[ok]: the Painless pipeline and the Python implementation agree on the deployed cluster.
radar/tests/py/test_off_hours.pyradar/tests/py/test_suspicious_login_ingest.pyradar/tests/py/fixtures/off_hours_cases.yamlradar/radar-test-framework/checks/off_hours_simulate.py
Parent links: SRS-062 RADAR scenario: off-hours activity detection
Child links: TRP-069 TCER: RADAR: off-hours marking, configuration and deployment logic
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Automated |
| verification_method | T |
| release | stable |
| complexity | 2 |
| test_data | the shared case table radar/tests/py/fixtures/off_hours_cases.yaml (18 specification cases plus live findings) and generated synthetic history |
| version | 2.2 |
3.27 RADAR: off-hours rule mode end to end TST-078
Preconditions and setup actions
- Same generic preconditions as TST-055.
suspicious_logindeployed with./radar.sh run suspicious_login, the webhook running, and an agent bootstrapped with thesuspicious_logingroup.- For step 2, a test account on the agent listed in
scenarios.suspicious_login.off_hours.usersunder a rule-mode group whose hours exclude the current time, deployed again after the change, and with no off-hours event in the lastquiet_minutes.
Test data: test users test_off_user and test_on_user, the reference event for bob (2026-09-18T02:05:00Z), and an SSH login of a listed user
Test steps
- From
radar/, runpoetry run python radar-test-framework/checks/off_hours_rule_e2e.py --env .env. - Log in to the agent over SSH as the test account. After
delay_minutesplus up to oneinterval_minutes, runoff_hours.py status --mode rule(see the manual, Off-hours activity). - Log in again within
quiet_minutesand wait one more interval. - Run
docker exec wazuh.manager grep '"id":"210041"' /var/ossec/logs/alerts/alerts.json | tail -2on the manager host and inspect/var/ossec/logs/active-responses.log.
Expected outcome
- The script prints
PASSfor: - one report fortest_off_userwith count 1 and grouptest_always_off; - none fortest_on_user, whose event is flagged 0; - no second report one interval later; - a new report after the quiet period; -bobreported with count 1 and first event at 02:05; - an inline run of the monitor that fires and renders a webhook item with user, count and group.
It ends with [ok] and removes its temporary index and pipeline.
2. status shows one monitor alert, then one webhook line for the account whose decoded data has off_hours_count and schedule_group, matched by rule 210041.
3. No second webhook line or 210041 alert for the account.
4. One 210041 alert for the account; radar_ar.py decides it as suspicious_login with detection ad.
Cleanup
- Remove the test account from
scenarios.suspicious_login.off_hours.usersand redeploy.
radar/radar-test-framework/checks/off_hours_rule_e2e.pyradar/anomaly_detector/off_hours.pyradar/scenarios/rules/suspicious_login/a3-suspicious-login.xml
Parent links: SRS-062 RADAR scenario: off-hours activity detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Automated/Manual |
| verification_method | T |
| release | stable |
| complexity | 4 |
| version | 2.2 |
3.28 RADAR: off-hours model mode on synthetic history TST-079
Preconditions and setup actions
- Same generic preconditions as TST-055.
./radar.sh run suspicious_login --ingest truecompleted with the shipped configuration: synthetic history written and marked,SUSPICIOUS_LOGIN_OFF_HOURS_DETECTORcreated and started.
Test data: synthetic history written by run-radar.sh suspicious_login --ingest true (alice, bob, oscar in rule mode; trent in model mode with evening work and one 30-event burst at about 02:00 Luxembourg time)
Test steps
- From
radar/, runpoetry run python radar-test-framework/checks/off_hours_model_history.py --env .env. It runs a historical analysis of the detector over the last 45 days and waits for it. - Run
./radar.sh run suspicious_logina second time, then list the detectors and monitors in Anomaly Detection and Alerting.
Expected outcome
- The script prints:
-
PASSfor trent's burst, with an anomaly grade above 0 in an interval overlapping it; - the number of anomalous intervals on trent's ordinary evenings, with their grades (target 0; recorded in the test result, not enforced); -PASSfor no results for alice, bob and oscar.
It ends with [ok].
2. One SUSPICIOUS_LOGIN_OFF_HOURS_DETECTOR, one SuspiciousLogin-OffHours-ModelMode-Monitor and one SuspiciousLogin-OffHours-RuleMode-Monitor exist. SUSPICIOUS_LOGIN_DETECTOR, if present, is stopped, and SuspiciousLogin-OffHour-Monitor is disabled.
radar/radar-test-framework/checks/off_hours_model_history.pyradar/scenarios/ingest_scripts/suspicious_login/wazuh_ingest.py
Parent links: SRS-062 RADAR scenario: off-hours activity detection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Automated |
| verification_method | T |
| release | stable |
| complexity | 4 |
| version | 2.2 |
3.29 RADAR manager-side enrichment TST-080
Preconditions and setup actions
Automated part (steps 1–2):
poetry install --with radar,test. No network access, Wazuh manager, GeoLite2 database or MaxMind licence key is needed: the tests replace the MaxMind readers with in-memory fakes and use temporary SQLite files.
Live part (steps 3–7, optional):
- RADAR built with the
suspicious_loginscenario, and for step 6 alsogeoip_detection, as in TST-043, withMAXMIND_LICENSE_KEYset inradar/.envso that deployment downloads the GeoLite2 City and ASN databases. - A Linux endpoint onboarded into the groups
default,suspicious_loginandradar_shared(plusgeoip_detectionfor step 6), with the simulation scripts ofradar/radar-test-framework/simulate/scenarios/copied to it.
Test steps
- From the repository root, run the enrichment unit tests:
poetry run pytest radar/tests/py/test_manager_enrichment.py -vThey also run as part of the whole RADAR suite,radar/tests/run-tests.sh. - From the repository root, check that no GeoIP database is under version control:
git ls-files | grep -i '\.mmdb$' - On the controller host, from
radar/, run the health check:./radar.sh health --scenario suspicious_login - On the endpoint, write the SSH cases of the
suspicious_loginsimulation, then on the controller host read the enriched lines:sudo python3 suspicious_login.py -batch travel benign docker exec wazuh.manager tail -n 20 /var/ossec/logs/radar/enriched_auth.log - On the controller host, make the City database unavailable, run the health check again, then restore the database and run it once more:
docker exec wazuh.manager mv /var/ossec/etc/radar/GeoLite2-City.mmdb /var/ossec/etc/radar/GeoLite2-City.mmdb.bak ./radar.sh health --scenario suspicious_login docker exec wazuh.manager mv /var/ossec/etc/radar/GeoLite2-City.mmdb.bak /var/ossec/etc/radar/GeoLite2-City.mmdb ./radar.sh health --scenario suspicious_login - With
geoip_detectiondeployed, on the endpoint write the web cases, then read the enriched web lines:sudo python3 geoip_detection.py -batch web_ip web_private docker exec wazuh.manager tail -n 20 /var/ossec/logs/radar/enriched_web_access.log - Read the enrichment error log:
docker exec wazuh.manager cat /var/ossec/logs/radar/enrichment_errors.log
Expected outcome
- All 25 tests pass. In particular:
- the GeoIP lookup returns the ISO country code, region, city, coordinates and ASN, returns empty fields for an unknown address, and survives a failing reader;
- accepted, failed and invalid-user
sshdlines are parsed into time, user, source address and outcome; any other line, or a line without a syslog header, is ignored; - a user's first login has velocity 0 and no country change; a second login from another country sets the country change; two logins about 3,900 km apart one hour apart give a velocity above 900 km/h; - ASN novelty is kept per user, ASN history older than 90 days is dropped, and a missing ASN sets the placeholder flag; - two logins of the same user enriched for two different endpoints are evaluated against one shared history (country change, velocity above 900 km/h); - the state database survives a new store instance (restart), is created group-writable (0660), and an unknown user gets an empty state; - the appended tail is matched by the success, failure and invalid-user decoder expressions of0310-ssh.xml, which the tests reproduce. - The command prints nothing (exit status 1): no
.mmdbfile is tracked. - The health check reports
OKfor the integration files, both GeoLite2 databases andmaxminddb,OKor, before any login has been enriched,WARNforuser_state.sqlite3, andOK - enrichment_errors.log empty/absent. - Each simulated SSH line appears in
enriched_auth.logfollowed by aRADAR outcome='…' asn='…' … country='…' … geo_velocity_kmh='…' country_change_i='…' asn_novelty_i='…'tail; for thetravelcase the second and third logins havecountry_change_i='1'and a velocity above 900 km/h, and forbenignthe second login has no country change. The corresponding rules of SRS-051 fire on the enriched lines. - With the City database missing, the health check reports
FAILforGeoLite2-City.mmdb; after restoring it,OKagain. - The
web_ipline appears inenriched_web_access.logwith aRADAR country="…" region="…" city="…" lat="…" lon="…"tail; theweb_privateline is not enriched. - The error log has no entry written during the test, except for logins processed while the database was missing in step 5.
The web-access enrichment (radar/manager-enrichment/web_enrichment.py, custom-radar-web-enrich) has no automated test; step 6 is its only verification.
radar/tests/py/test_manager_enrichment.pyradar/radar_deploy/manager-health.shradar/radar-test-framework/simulate/scenarios/suspicious_login.pyradar/radar-test-framework/simulate/scenarios/geoip_detection.py
Parent links: SRS-068 Manager-side enrichment
Child links: TRP-070 TCER: RADAR manager-side enrichment
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated/Manual |
| verification_method | T |
| release | stable |
| complexity | 2 |
| test_data | GeoIP and ASN records from fake MaxMind readers and temporary SQLite state databases built in the tests; for the live part, the SSH and web access lines written by the simulation scripts |
| version | 2.2 |
3.30 RADAR GUI REST API contract TST-081
Preconditions and setup actions
- Automated part (step 1): a repository checkout with
poetry install --with radar,test. No RADAR stack, network or Docker is needed. - Manual part (steps 2 to 10), on the RADAR host:
radar/.envexists and the user can runsudo. A deployed scenario is not needed except for step 9.- Back up
radar/scenarios/active_responses/ar.yamlandradar/.env; restore both at the end. - Start the GUI from
radar/with a short sudo idle period:RADAR_SUDO_IDLE_MINUTES=1 ./radar.sh gui. In a second shell, setGUI=http://127.0.0.1:5000,TOKEN=<token part of ./radar.sh gui-url>andJ='Content-Type: application/json'. Everycurlafter step 3 uses the cookie jar:curl -s -b jar -c jar ....
Test steps
- From
radar/, run:PYTHONPATH=anomaly_detector:. poetry run pytest tests/py/test_gui_ar_config.py -v - Host allowlist:
curl -s -w ' %{http_code}\n' -H 'Host: evil.example:5000' "$GUI/api/scenarios". - Login token: request
$GUI/api/scenarioswithout a cookie; then$GUI/?token=wrong; then log in withcurl -s -c jar -o /dev/null -w '%{http_code}\n' "$GUI/?token=$TOKEN"and inspectjar; then request$GUI/api/scenarioswith the jar. - CSRF checks: send
-X PUT -d '{}' $GUI/api/scenarios/suspicious_login/ar-configthree times: without-H "$J"(curl then sends a form content type); with-H "$J" -H 'Sec-Fetch-Site: cross-site'; with-H "$J" -H 'Origin: http://evil.example'. - Scenarios:
GET /api/scenarios;GET /api/scenarios/default;GET /api/scenarios/no_such_scenario;GET /api/scenarios/deploy-status. - Active-response partial update: note
GET /api/scenarios/suspicious_login/ar-config;PUTit with{"delta_signature_minutes": 7}; read it again. ThenPUTit with{"mitigations_tier2": ["nope.sh"]}. ThenPOST /api/scenarios/default/bindwith{}. - Connectors:
GET /api/connectors;POST /api/connectors/revealwith{"key": "OS_PASS"}; with{"key": "WEBHOOK_SHARED_SECRET"};PUT /api/connectors/opensearchwith{"os-url": "https://198.51.100.1:9200"};POST /api/connectors/opensearch/testandPOST /api/connectors/wazuh-api/test. - Sudo session:
POST /api/sudo/unlockwith a wrong password, thenGET /api/sudo/status; unlock with the correct password,GET /api/sudo/status, repeat the two reveal requests of step 7; wait two minutes without further requests andGET /api/sudo/statusagain. - Streaming and preview:
POST /api/deploy/previewwith{"action": "health", "scenario": "all"}; thencurl -N -b jar -X POST -H "$J" -d '{"scenario": "all"}' "$GUI/api/deploy/health"and watch the output arrive;POST /api/deploy/runwith{"scenario": "no_such_scenario", "ingest": false};POST /api/deploy/mint-tokenwith{"groups": "default"}while no sudo password is held. - Logout: unlock sudo again, then
POST /api/logoutwith{}; check the response cookies, the GUI process, and./radar.sh gui-url.
Expected outcome
- All tests pass: the mitigation names offered and accepted are
firewall-dropplus the catalog names; a partialPUT .../ar-configand abindstore normalised names; an unknown mitigation or a non-list value is refused with HTTP 400 and a message naming it, and leavesar.yamlunchanged; a broken catalog is reported on the page; the GUI never writes the catalog. - HTTP 403 with
{"ok": false, "error": "Host 'evil.example:5000' is not allowed..."}. - Without a cookie: HTTP 401 with
"ok": false. Wrong token: HTTP 401Invalid login token.(plain text, as/is a page). Correct token: HTTP 302, and the jar holdsradar_gui_authmarked HttpOnly (#HttpOnly_prefix). With the jar: HTTP 200 and a JSON list. - HTTP 415, 403 and 403, each with
"ok": false;ar.yamlunchanged. - The list holds every scenario with
gui_visible: trueinradar/config.yaml, each withid,name,description,status,type(signature,anomalyorhybrid),rule_ids,bound,sharedand, when bound, a non-emptyar_config.defaultis returned withbound: true. The unknown scenario gives HTTP 404{"ok": false, "error": "not found"}. Deploy status gives{"ok": true, "active": {...}}per scenario. - The first
PUTreturns{"ok": true}, and onlydelta_signature_minutesdiffers from the noted configuration. The unknown mitigation gives HTTP 400 namingnope.sh. Bindingdefaultgives HTTP 400. - The connector list contains no secret value, and
password_statustells which secrets are set. Reveal without unlocked sudo: HTTP 403 withneed_sudo: true; reveal of a key outside the five secret fields: HTTP 403key not allowed. Changingos-urlwithout a new password: HTTP 403 withneed_sudo: true,.envunchanged. Each test answers{"ok": true|false, ...}reflecting whether the service is reachable with the saved settings. - Wrong password: HTTP 403
sudo rejected this password, status{"unlocked": false}. Correct password:{"ok": true}, status{"unlocked": true},OS_PASSrevealed,WEBHOOK_SHARED_SECRETstillkey not allowed. After two idle minutes,{"unlocked": false}. - Preview returns
{"ok": true, "cmd": ...}listing the three health stages, and nothing runs. The health stream shows the=== MANAGER (filesystem/container) ===section before the later sections are produced. The invalid scenario yields atext/plainline starting with[ERROR]. Mint token without sudo: HTTP 403 withneed_sudo: truebefore any output. {"ok": true, ...}, both cookies deleted, the GUI process exits, andgui-urlreports that the GUI is not running. A restarted GUI reports{"unlocked": false}.
The test passes when every expected outcome is observed. Restore ar.yaml and .env from the backup.
radar/tests/py/test_gui_ar_config.py
Parent links: SRS-063 RADAR SOAR web interface: REST API
Child links: TRP-071 TCER: RADAR GUI REST API contract
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Automated/Manual |
| verification_method | T |
| release | stable |
| complexity | 3 |
| test_data | the repository's radar/scenarios/active_responses/ar.yaml and a known active-response catalog (automated part); a backed-up copy of ar.yaml and .env on the RADAR host (manual part) |
| version | 2.2 |
3.31 RADAR agent onboarding and enrollment hardening TST-082
Preconditions and setup actions
- Automated part (steps 1 and 2): a repository checkout with
poetry install --with radar,test, plusbats,jqand, optionally,shellcheckon thePATH. No RADAR stack, network or Docker is needed. Alternatively,radar/test.shruns the whole RADAR suite in theradar/Dockerfile.testimage, which provides these tools. - Manual part (steps 3 to 12):
- A RADAR host with
radar/.env, root throughsudo, andlog_volumedeployed withsudo ./build-radar.sh log_volume. - Endpoint A and endpoint B: clean, supported Debian or Ubuntu hosts that can reach the RADAR host and
packages.wazuh.com. A copy ofradar/radar-agent/on each, in~/radar-agent. MGRis the RADAR host address printed byradar.sh mint-token. Commands marked (host) run inradar/on the RADAR host, (A) and (B) in~/radar-agenton the endpoints.
Test steps
- From
radar/, run:PYTHONPATH=anomaly_detector:. poetry run pytest tests/py/test_token_revocation.py tests/py/test_radar_agent_mapping.py tests/py/test_radar_agent_collectors.py -v - From
radar/, run:for s in bootstrap-agent uninstall-agent ar-mapping ar-dispatch collectors; do bats -p tests/bash/$s.bats; done - Hardened manager (host):
docker exec wazuh.manager grep -E '<use_password>|<purge>' /var/ossec/etc/ossec.conf; compare the<key>of the<cluster>block withWAZUH_CLUSTER_KEYin.env;sudo ./radar.sh enrollment status. (A):timeout 5 bash -c "</dev/tcp/$MGR/1515"; echo $?. - Window auto-close (host):
sudo ./radar.sh enrollment open --minutes 1,sudo ./radar.sh enrollment status; (A): repeat the port probe. Wait two minutes; (host) status again; (A) probe again. - Invalid token, incomplete folder, unreachable manager (host):
sudo ./radar.sh enrollment open --minutes 30. (B):sudo ./bootstrap-agent.sh --manager $MGR --token wrong --group default; then copy the folder to~/broken, delete~/broken/helpers/collectors.sh, and runsudo ~/broken/bootstrap-agent.sh --manager $MGR --token wrong --group default; thentime sudo ./bootstrap-agent.sh --manager 198.51.100.1 --token wrong --group default. - No credential (B):
sudo /var/ossec/bin/agent-auth -m $MGR -A b-nopass(no-P). - Onboarding (host):
sudo ./radar.sh mint-token default,log_volume 30. (A): run the printedbootstrap-agent.shcommand, adding--agent-name endpoint-a. Then (A):ls -l /var/ossec/active-response/bin/ /var/ossec/radar-agent/,apt-mark showhold,systemctl is-active wazuh-agent radar-log-volume.timer. (host):./health-radar.sh --scenario log_volume --agent-name endpoint-aanddocker exec wazuh.manager /var/ossec/bin/manage_agents -l. - Duplicate name (B): with the token of step 7,
sudo /var/ossec/bin/agent-auth -m $MGR -P <token> -A endpoint-a; (host):manage_agents -lagain. - Re-run (host): mint a new token as in step 7. (A): run the new bootstrap command again with
--agent-name endpoint-a; (host):manage_agents -l. - Superseded and expired tokens (B):
sudo /var/ossec/bin/agent-auth -m $MGR -P <token of step 7> -A b-old. (host):sudo ./radar.sh mint-token default 1, wait two minutes,sudo journalctl -u radar-token-revoke.service -n 5,ls .radar-state/, then reopen the window withsudo ./radar.sh enrollment open --minutes 10so that a refusal cannot come from the firewall. (B):sudo /var/ossec/bin/agent-auth -m $MGR -P <1-minute token> -A b-expired. - Uninstall and reinstall (A):
sudo ./uninstall-agent.sh;dpkg -l wazuh-agent,ls -l /var/lib/radar-agent,systemctl status wazuh-agent. (host): mint a token. (A): bootstrap again with--agent-name endpoint-a; (host):manage_agents -l. - Purge (A):
sudo ./uninstall-agent.sh --purge-data;ls /var/ossec /var/lib/radar-agent /var/log/radar. (host):./radar_deploy/manager-deregister-agent.sh --agent-name endpoint-a, and the same for any agent created on B.
Expected outcome
- All tests pass. In particular: a bad token lifetime (
0,99999,1;id, ...) is refused before anydockercall; an unexpired token is left alone and an expired one is replaced and the manager restarted; the shell and Python catalog parsers agree on the shipped catalog; every catalog name is an actionradar_ar.pycan target and every script is shipped; collectors are named after real scenarios and their units and log rotation are consistent. - All tests pass (the
shellchecktests are informational). In particular: required options, root and folder completeness are checked before any change; every catalog script gets a dispatcher and a root-owned copy in the agent home; oneagent-authcall carries manager, token, name and all groups; "Duplicate agent name" is success only with a local key; an invalid password fails with a token and reachability hint; the agent is held; a kept key is restored only for the same name and manager; the dispatcher refuses unmapped names, broken catalogs and group- or world-writable or foreign-owned files; collectors are validated, installed idempotently and removed exactly; uninstall keeps the key unless--purge-data. <use_password>yes</use_password>and<purge>no</purge>; the cluster key equalsWAZUH_CLUSTER_KEY; statusCLOSED - port 1515 is blocked; the probe fails (non-zero).- After opening: status
OPENwith a timer PID, probe succeeds (0). After two minutes: statusCLOSED, probe fails. - The invalid token fails with
FAILED: enrollment rejected by managerand a next step about the token and port 1515 (the package is installed by this run). The incomplete folder fails withFAILED: ... helpers is incompletebefore any change. The unreachable manager fails with a non-zero status within theagent-authconnection timeout, without a key being written. - Refused; no key is issued and no agent
b-nopassappears on the manager. - The mint prints the bootstrap command and opens the window. The bootstrap ends with
=== SUCCESS ===. Dispatcherslock_user_linux.shandterminate_service.share present (root:wazuh, 0750);/var/ossec/radar-agentholds the catalog and every script;wazuh-agentis held; both units areactive. The health check showsendpoint-aactive and in groupsdefaultandlog_volume;manage_agents -llists it once. agent-authreports "Duplicate agent name";endpoint-akeeps its ID and is listed once.- The bootstrap ends with
=== SUCCESS ===after reporting that the name is already registered with a local key;endpoint-ais still listed once with the same ID. - The superseded token is refused. After the 1-minute token's lifetime, the journal of
radar-token-revoke.serviceshowsOK - enrollment token revoked on wazuh.manager,enrollment-token.expiresis gone, and the expired token is refused. - The package is removed, the service is no longer registered, and
/var/lib/radar-agentholds the key (root-only). The reinstall reconnects as the same agent: same ID, groups unchanged, listed once. /var/ossec,/var/lib/radar-agentand/var/log/radarno longer exist. Deregistration reports success.
The test passes when every expected outcome is observed.
radar/tests/bash/bootstrap-agent.batsradar/tests/bash/uninstall-agent.batsradar/tests/bash/ar-mapping.batsradar/tests/bash/ar-dispatch.batsradar/tests/bash/collectors.batsradar/tests/py/test_token_revocation.pyradar/tests/py/test_radar_agent_mapping.pyradar/tests/py/test_radar_agent_collectors.py
Parent links: SRS-067 Secure agent enrollment and automated onboarding, SRS-083 Authenticated and encrypted component channels
Child links: TRP-072 TCER: RADAR agent onboarding and enrollment hardening
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Automated/Manual |
| verification_method | T |
| release | stable |
| complexity | 4 |
| test_data | sandboxed fake roots and stubbed system commands created by the tests (automated part); two disposable Debian or Ubuntu endpoints (manual part) |
| version | 2.2 |
3.32 RADAR health check scoping TST-083
No automated test covers the health check scripts; this test is run by hand against a deployment.
Preconditions and setup actions
- A RADAR host with
radar/.env,sudo, and the core stack andlog_volumedeployed withsudo ./build-radar.sh log_volume. No other scenario is deployed. - One endpoint,
endpoint-a, enrolled withbootstrap-agent.shin groupsdefaultandlog_volumeand connected (TST-082). WEBHOOK_URLis set inradar/.env. The user running the checks can use Docker (member of thedockergroup).- All commands run in
radar/on the RADAR host. Record each command's exit status withecho $?.
Test steps
- Baseline (for step 4):
docker exec wazuh.manager sh -c 'sha256sum /var/ossec/etc/ossec.conf /var/ossec/etc/shared/*/agent.conf /var/ossec/etc/rules/*.xml'anddocker exec wazuh.manager /var/ossec/bin/manage_agents -l; save both outputs. - Single scenario with agent:
./health-radar.sh --scenario log_volume --agent-name endpoint-a. - Other scenario:
./health-radar.sh --scenario suspicious_login. - All scenarios:
./health-radar.sh. Then repeat the two commands of step 1 and compare. - Unknown agent:
./health-radar.sh --scenario log_volume --agent-name endpoint-a,no-such-agent. - Missing scenario parts:
./radar_deploy/manager-undo-scenario.sh log_volume, then./health-radar.sh --scenario log_volume. Redeploy withsudo ./build-radar.sh log_volumeand reassign the agent:./radar_deploy/manager-assign-agent-group.sh --scenario log_volume --agent-name endpoint-a. - Expired token exception:
sudo ./radar.sh mint-token default 1, thensudo systemctl stop radar-token-revoke.timerso that the revocation is missed; wait two minutes;ls .radar-state/;./health-radar.sh --scenario log_volume;ls .radar-state/again. - No registered manager:
cp infra.yaml infra.yaml.bak && printf 'components: {}\n' > infra.yaml;./health-radar.sh --scenario log_volume; thenmv infra.yaml.bak infra.yaml. - GUI: in the GUI, Deployment page, Status tab, run the check for
log_volumewith agentendpoint-a.
Expected outcome
- Outputs saved.
- Exit status 0. The sections print in the order
=== MANAGER (filesystem/container) ===,=== MANAGER (Wazuh API / OpenSearch / webhook) ===,=== AGENTS ===, each line starting withOK,WARN,FAILorSKIP, and noFAIL. The first section has a--- <node> ---block for each manager node ininfra.yaml, includeslog_volume pipeline patch presentand the webhook reachability from the indexer container, and has nomaxminddbor enrichment lines. The second section reports the core daemons running,log_volume active-response wiring, thelog_volumegroup configuration,a1-log-volume.xmland its decoders, one agent assigned to all oflog_volume's groups, the OpenSearch cluster status and theradar-log-volumeindex template. The agent section reportsendpoint-aactive and indefaultandlog_volume. - The first section adds the framework Python,
maxminddb, enrichment file, GeoLite2, state store and error log checks and has nolog_volumepipeline line. The second section reportsFAILfor thesuspicious_loginwiring, group configuration,a3-suspicious-login.xmland the agents, and nolog_volumetemplate line. There is no agent section. - Checks for every scenario in
radar/config.yamlappear, including thegeoip_detectionwhitelist_countriescheck; the scenarios that are not deployed reportFAIL. The checksums and the agent list are identical to step 1. OKlines forendpoint-a, andFAIL - agent no-such-agent not found via APIfor both the status and the group check.- The second section reports
FAILfor thelog_volumewiring, thelog_volumegroup configuration,a1-log-volume.xmland the agents oflog_volume. After redeployment, step 2 passes again. - Before the check,
enrollment-token.expiresexists. The first section starts withWARN - enrollment token expired at ... and was still active; revoking nowandOK - enrollment token revoked on wazuh.manager; afterwards the file is gone. - The run stops after the first section with a non-zero exit status; no API or agent section is printed.
- The same three sections stream into the page, in the same order, with the same results as step 2.
The test passes when every expected outcome is observed.
radar/health-radar.shradar/radar_deploy/manager-health.shradar/wazuh_api/health.py
Parent links: SRS-060 RADAR deployment health check
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Manual |
| verification_method | T |
| release | stable |
| complexity | 3 |
| test_data | none (checks run against the live deployment) |
| version | 2.2 |
3.33 RADAR scenario group delivery and undo TST-084
Preconditions and setup actions
- Automated part (step 1): a repository checkout with
poetry install --with radar,test. No RADAR stack, network or Docker is needed. The automated tests cover deployment and assignment; undo is covered by the manual part only. - Manual part (steps 2 to 9):
- A RADAR host with
radar/.env,sudo, and the core stack running (sudo ./build-radar.sh --core-only); no scenario deployed. - One endpoint,
endpoint-a, enrolled in groupdefaultonly (TST-082). No SSH or other access from the RADAR host to the endpoint is configured or used. - In a shell in
radar/: exportWAZUH_API_URL,WAZUH_AUTH_USERandWAZUH_AUTH_PASSwith the values from.env, and defineT=$(curl -sk -u "$WAZUH_AUTH_USER:$WAZUH_AUTH_PASS" -X POST "$WAZUH_API_URL/security/user/authenticate?raw=true") groups() { curl -sk -H "Authorization: Bearer $T" "$WAZUH_API_URL/agents?name=endpoint-a&select=group"; } confs() { docker exec wazuh.manager sh -c 'sha256sum /var/ossec/etc/shared/*/agent.conf'; } files() { docker exec wazuh.manager ls /var/ossec/etc/decoders /var/ossec/etc/rules; }
Test steps
- From
radar/, run:PYTHONPATH=anomaly_detector:. poetry run pytest tests/py/test_scenario_ops.py tests/py/test_ruleset.py tests/py/test_manager_config.py tests/py/test_wazuh_api.py -v - Deploy one shared scenario:
confs > before.txt;sudo ./build-radar.sh suspicious_login;confs > after.txt;diff before.txt after.txt. - Delivery without endpoint access:
./radar_deploy/manager-assign-agent-group.sh --scenario suspicious_login --agent-name endpoint-a;groups. After the next agent keep-alive (about one minute), on the endpoint:sudo grep -c /var/log/auth.log /var/ossec/etc/shared/agent.conf. - Deploy a second shared scenario:
confs > before.txt;sudo ./build-radar.sh geoip_detection;confs > after.txt;diff before.txt after.txt;./radar_deploy/manager-assign-agent-group.sh --scenario geoip_detection --agent-name endpoint-a;groups;files. - Repeat deploy:
sudo ./build-radar.sh geoip_detectionagain; note the JSON result of thedeploy-manager-configstage. - Undo while the other shared scenario is deployed:
confs > before.txt;./radar_deploy/manager-undo-scenario.sh geoip_detection;confs > after.txt;diff before.txt after.txt;groups;files;docker exec wazuh.manager grep -c 'RADAR: suspicious_login BEGIN' /var/ossec/etc/ossec.conf;./health-radar.sh --scenario suspicious_login --agent-name endpoint-a. - Repeat undo:
./radar_deploy/manager-undo-scenario.sh geoip_detectionagain. - Undo the last shared scenario:
./radar_deploy/manager-undo-scenario.sh suspicious_login;groups;files;docker exec wazuh.manager cat /var/ossec/etc/shared/radar_shared/agent.conf. - Never-deployed scenario:
confs; files;./radar_deploy/manager-undo-scenario.sh scanning_detection;confs; files.
Expected outcome
- All tests pass. In particular: shared scenarios get
default, their own group andradar_shared, others onlydefaultand their own group; deploying a shared scenario writes both its own group andradar_shared, a non-shared one only its own; empty or whitespace-only snippets are not uploaded; hosts are resolved by IP before name and unresolved hosts are reported without stopping the others; ruleset files are uploaded only when their content differs; a seconddeploy_manager_configchanges nothing and does not restart; the whitelist and scenario lists are deployed only for the scenarios that own them; marked blocks are inserted, replaced and kept idempotent. - Only the
agent.confofsuspicious_loginandradar_shareddiffer (or are new);defaultand the other groups are unchanged. - The assignment succeeds;
groupslistsdefault,suspicious_loginandradar_shared. The endpoint's mergedagent.confcontains/var/log/auth.log(count of at least 1), although nothing connected to the endpoint. - Only
geoip_detectionchanges (radar_sharedalready carries the same snippet).groupsaddsgeoip_detection.0310-ssh.xml,0375-web-accesslog.xmlanda2-geoip-detection.xmlare present. - The build completes without error, and the
deploy-manager-configresult reports no changed file or block and"restart_triggered": false. - Only the
agent.confofgeoip_detectionchanges (reset to an empty<agent_config>).groupsno longer listsgeoip_detectionbut still listsdefault,suspicious_loginandradar_shared.a2-geoip-detection.xmland0375-web-accesslog.xmlare gone;0310-ssh.xml, still used bysuspicious_login, is present. Thesuspicious_loginblock is still inossec.conf(count 1), and the health check reports noFAIL. - Completes without error and without a manager restart.
groupslists onlydefault.a3-suspicious-login.xmland0310-ssh.xmlare gone.rules/radar_rules.xml(thedefaultrules) is present. Theradar_sharedgroup has no member any more; itsagent.confis left in place and therefore reaches no agent.- Completes without error, and nothing on the manager changes (
confsandfilesas after step 8).
The test passes when every expected outcome is observed.
radar/tests/py/test_scenario_ops.pyradar/tests/py/test_ruleset.pyradar/tests/py/test_manager_config.pyradar/tests/py/test_wazuh_api.py
Parent links: SRS-069 Scenario-scoped agent group configuration delivery
Child links: TRP-073 TCER: RADAR scenario group delivery and undo
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Ubuntu+Debian) |
| execution_type | Automated/Manual |
| verification_method | T |
| release | stable |
| complexity | 4 |
| test_data | Wazuh API responses mocked with the responses library and temporary scenario trees (automated part); the repository's scenarios under radar/scenarios/ (manual part) |
| version | 2.2 |
4.0 SONAR test case specifications
4.1 Linux resource usage monitoring scenario TST-050
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with adbox,radar,test. sonar/scenarios/linux_resource_monitoring.yamlis present withdebug.enabled: false(the--debugCLI flag is used instead).- The following local test data files exist:
-
sonar/test_data/resource_monitoring/resource_monitoring_training.json(24 hours, 1440 one-minute buckets) -sonar/test_data/resource_monitoring/resource_monitoring_detection.json(2 hours of normal context, then 6 hours with attacks at 01:00, 03:00 and 05:00 on 2024-12-15)
Test steps
-
From the repository root, train the SONAR model for the Linux resource monitoring scenario using local debug data:
poetry run sonar train --scenario sonar/scenarios/linux_resource_monitoring.yaml --debug -
Verify the training log line
Fitting MVAD on ...reports more than zero gradient steps, that training completes, and that a model directory is persisted undersonar/models/with the name matching themodel_namefield in the scenario YAML (linux_resource_monitoring). -
From the repository root, run anomaly detection for the Linux resource monitoring scenario using the local debug detection data:
poetry run sonar detect --scenario sonar/scenarios/linux_resource_monitoring.yaml --debug -
Inspect the detection output and verify that anomalies are flagged inside each injected attack window: the CPU spike (01:00–01:45), the memory leak (03:00–04:00) and the fork bomb (05:00–05:08).
-
Verify that every reported anomaly belongs to a run of at least
min_consecutive(4) consecutive anomalous 1-minute buckets, the scenario's calibrated sustained-anomaly criterion. -
Verify that the derived features count the matching alerts per bucket:
is_cpu_highcounts alerts withcpu_usage_% ≥ 80,is_memory_highalerts withmemory_usage_% ≥ 80, andis_high_loadalerts with1min_loadAverage ≥ 4.0.
Expected outcome
- Training performs more than zero gradient steps and completes without error; a model directory named
linux_resource_monitoringis persisted to disk. - Detection completes without error.
- Anomalies are flagged inside each of the three attack windows.
- Every reported anomaly is part of a run of at least four consecutive anomalous 1-minute buckets.
- Derived features
is_cpu_high,is_memory_high, andis_high_loadhold per-bucket counts consistent with the raw metric thresholds applied to the detection data.
Parent links: SRS-072 SONAR training adequacy, SRS-073 SONAR regular time axis and volume features, SRS-075 SONAR detection window and anomaly reporting
Child links: TRP-040 TCER: Linux resource usage monitoring scenario, TRP-053 TCER: Linux resource usage monitoring scenario
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | stable |
| complexity | 2 |
| test_data | sonar/test_data/resource_monitoring/ |
| version | 1.0 |
4.2 SONAR refuses to persist untrained models TST-063
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with adbox,radar,test. The real MVAD library (time-series-anomaly-detector0.4.0) is installed.
Test steps
- From the repository root, run the training pre-flight unit tests:
poetry run pytest tests/sonartests/test_engine_and_features.py -k "Engine" -v - Run the tests against the real MVAD library:
poetry run pytest tests/sonartests/test_engine_real_mvad.py -v - With the default configuration (
sliding_window: 200, library batch size 128 and stride 10), train on 288 five-minute buckets, and observe the result.
Expected outcome
- Training on 288 buckets with the default window fails with
InsufficientTrainingDataError, names the required bucket count (1725), never calls the library'sfit, and leaves no model. - For each tested dataset size, the predicted number of optimiser updates equals the number of
Adam.stepcalls the library performs, including the case of zero updates. - A trained model's network parameters differ from the library's initialisation, and the saved model records
gradient_stepsgreater than zero, which survives saving and loading. - An unknown training parameter such as
learning_rateis rejected with a hint to uselr. - No library checkpoint is written to the working directory, and two training runs use different checkpoint directories.
- The library defaults and configuration fields that SONAR copies match the installed library.
tests/sonartests/test_engine_real_mvad.pytests/sonartests/test_engine_and_features.py
Parent links: SRS-072 SONAR training adequacy
Child links: TRP-054 TCER: SONAR refuses to persist untrained models
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | generated in the tests (synthetic periodic signals) |
| version | 0.1 |
4.3 SONAR feature schema 2 and feature contract TST-064
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with adbox,radar,test.
Test steps
- From the repository root, run:
poetry run pytest tests/sonartests/test_features_v2.py -v
Expected outcome
- One failed login and two hundred failed logins in a bucket give
alert_count,is_auth_failureand category counts of 1 and 200. - Alerts at 00:01, 00:05 and 00:21 with 5-minute buckets give rows for 00:00, 00:05, 00:10, 00:15 and 00:20, the empty ones with zero counts. An explicit window adds leading and trailing empty buckets; a window given only an end starts at the first alert.
- A numeric field present on 10 of 100 alerts in a bucket yields the mean of those 10 values. Empty buckets are filled with 0, or with the previous value under
numeric_fill: ffill. - A category unseen in training is counted in
<field>__otherat detection, with columns identical to training. - The model records its feature configuration, vocabulary and columns. Predicting on differing columns fails and names them. Loading a model with feature schema 1, or without metadata, fails with a request to retrain. Changed scenario feature settings produce a warning and the model's settings are used.
tests/sonartests/test_features_v2.py
Parent links: SRS-073 SONAR regular time axis and volume features, SRS-074 SONAR feature contract between training and detection
Child links: TRP-055 TCER: SONAR feature schema 2 and feature contract
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | generated in the tests (synthetic Wazuh alerts) |
| version | 0.1 |
4.4 SONAR detection window, severity threshold and no alert writes TST-065
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with adbox,radar,test.
Test steps
- From the repository root, run:
poetry run pytest tests/sonartests/test_detection_cli.py tests/sonartests/test_wazuh_and_pipeline.py tests/sonartests/test_scenario.py -v
Expected outcome
- With 5-minute buckets, a 60-minute detection period yields exactly 12 verdicts, from the first bucket of the period to the last complete bucket; alerts are fetched from the period start minus the model's context; the bucket still filling is never reported.
- Reported documents carry the model name, every model column as feature names and feature count, the model's sliding window and bucket size, the severity as
anomaly_score, and each contributor's value in the bucket. - A threshold selects buckets by severity, independently of the raw score; a threshold outside [0, 1] is rejected both by the post-processor and when a scenario is loaded.
- One-shot detection returns 0 when the period was scored, 2 without alerts or with too few buckets, and 1 on a model error or a missing model;
sonar detectwith and without a scenario uses the same detection path. - The indexer client has no method to write alerts, the former synthetic-fill CLI options are rejected, and the former synthetic-fill scenario keys are reported as obsolete.
tests/sonartests/test_detection_cli.pytests/sonartests/test_wazuh_and_pipeline.pytests/sonartests/test_scenario.py
Parent links: SRS-075 SONAR detection window and anomaly reporting, SRS-076 SONAR does not write security alerts
Child links: TRP-056 TCER: SONAR detection window, severity threshold and no alert writes
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | generated in the tests (synthetic Wazuh alerts, mocked model) |
| version | 0.1 |
4.5 SONAR at-most-once anomaly delivery and realtime resilience TST-066
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with adbox,radar,test.
Test steps
- From the repository root, run:
poetry run pytest tests/sonartests/test_realtime_delivery.py tests/sonartests/test_detection_cli.py -v
Expected outcome
- The anomaly identifier is the same for the same scenario and bucket, whatever the time zone of the timestamp, and differs between scenarios and between buckets; every anomaly document carries it.
- The watermark file survives a new process, never moves back, is separate per scenario, and an unreadable file is treated as no watermark.
- Two polls over the same data deliver each anomaly once, and a restart delivers nothing again.
- A run of anomalous buckets crossing a poll boundary is delivered without repeating the buckets already delivered; with a minimum run length of 3, two buckets at the end of one poll are delivered together with the third once the next poll completes the run.
- A failed delivery returns exit code 1 and leaves the watermark unchanged, and the next poll delivers the anomalies; a dry run leaves the watermark unchanged.
- Realtime polls run when the next bucket has ended plus the ingest delay, unless a fixed polling interval is set; a failed poll is retried after 10, 20, 40… seconds, capped at one bucket; 5 consecutive failures exit with code 1; a poll with too little data resets the failure count.
- The index and the data stream are written with the anomaly identifier as document id, create-only; HTTP 409 counts as delivered, other errors still fail, and a partial delivery is reported as such.
- A bucket that ended less than the ingest delay ago is not scored.
tests/sonartests/test_realtime_delivery.pytests/sonartests/test_detection_cli.py
Parent links: SRS-077 SONAR delivers each anomalous bucket at most once per scenario
Child links: TRP-057 TCER: SONAR at-most-once anomaly delivery and realtime resilience
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | generated in the tests (synthetic Wazuh alerts, mocked model, fake clock and sinks) |
| version | 0.1 |
4.6 SONAR anomaly sinks and Wazuh manager events TST-067
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with adbox,radar,test.
Test steps
- From the repository root, run:
poetry run pytest tests/sonartests/test_sinks.py tests/sonartests/test_realtime_delivery.py tests/sonartests/test_shipper.py -v
Expected outcome
- The SONAR event is one line of valid JSON with
integration: sonar,anomaly_grade,anomaly_confidence(0.5 when the scenario sets none) and thesonarobject (scenario, model, bucket start, severity, band, score, contributors); NaN values become null; the bands follow the configured boundaries. - The file transport appends one line per event, creates the directory, rotates by size keeping the configured number of files, and reports an unwritable file as a failed delivery.
- The API transport authenticates once, sends at most 100 events per request to
POST /eventswith the bearer token and the configured CA bundle, re-authenticates on 401, waits on 429 (honouringRetry-After) and gives up after repeated 429s, reports the accepted prefix when the manager rejects events, and takes the password from the environment when the configuration has none. - The rules file is well-formed, uses IDs 100500–100503 only, inside 100500–100519 and colliding with no rule under
radar/; the base rule matches the event'sintegrationvalue and the band rules itssonar.severity_bandvalues; the rule group is the one alert searches exclude. - Alert searches exclude the
sonarrule group by default, and not when the exclusion list is empty. - Sink selection:
wazuhby default with watermarks;--shipadds the data stream; debug uses the debug sinks without watermarks;--print-payloadsadds standard output; a dry run writes a JSON-lines file and ignores the watermarks; unknown sinks, fallbacks and transports are rejected; anindexsink is refused in debug mode; an unsetanomaly_confidenceis warned about; theoutputsection is read from YAML, nested sections included. - Each sink keeps its own watermark: a failed sink catches up on the next run while the others are not offered the anomalies again; a partial delivery advances over the accepted prefix only; the fallback takes what a sink rejected without moving the watermarks; the run fails only when every sink and the fallback failed.
sonar wazuh install-rulesuploads the rules file withPUT /rules/files/sonar_rules.xml?overwrite=trueas the given user, restarts the manager with--restart, and exits with 1 when the API refuses.- The data stream sink creates documents in bulk under their
anomaly_id, counts existing ones as delivered and reports the accepted prefix; the ISM policy rolls over and deletes after the configured ages and attaches itself to.ds-sonar_anomalies_*, and an existing policy is kept; the per-scenario template has no feature component; anomaly documents carry noruleblock. - A debug detection run prints SONAR events on standard output.
tests/sonartests/test_sinks.pytests/sonartests/test_realtime_delivery.pytests/sonartests/test_shipper.py
Parent links: SRS-077 SONAR delivers each anomalous bucket at most once per scenario, SRS-078 SONAR reports anomalies to the Wazuh manager
Child links: TRP-058 TCER: SONAR anomaly sinks and Wazuh manager events
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | generated in the tests (anomaly documents, mocked Wazuh API and OpenSearch client, temporary files) |
| version | 0.1 |
4.7 Validate SONAR alerts in Wazuh through both transports TST-068
This test checks that SONAR anomalies become Wazuh alerts when SONAR runs on the manager host (file transport) and when it runs on a dedicated host without a Wazuh agent (api transport), that a RADAR scenario can act on them, and that SONAR does not read its own alerts.
SONAR's debug mode supplies the anomalies: with output.debug_sinks: [wazuh], --debug scores the bundled resource-monitoring data and sends its anomalies to the manager. The injected CPU, memory and fork-bomb attacks reach a severity of about 0.45, so the lab configuration lowers the severity bands to make them high.
Preconditions and setup actions
- A Wazuh 4.14.1 single-node stack, deployed with RADAR's core stack (
radar/docker-compose.core.ymlwithradar/volumes.yml) on the controller host, with the indexer athttps://localhost:9200and the server API athttps://localhost:55000. - Indexer credentials (
adminand$OS_PASS) and an API administrator ($WAZUH_AUTH_USER,$WAZUH_AUTH_PASS, by defaultwazuh-wui). - SONAR installed from the repository on the controller host (
poetry install --with adbox,radar,test), and the resource-monitoring model trained:bash poetry run sonar train --scenario sonar/scenarios/linux_resource_monitoring.yaml --debug - A second machine (the dedicated host) with network access to port 55000 of the controller, the repository and SONAR installed, and no Wazuh agent (
systemctl status wazuh-agentreports no such unit).
Setup
- On the controller, create
sonar-lab.yamlat the repository root:yaml wazuh: base_url: "https://localhost:9200" username: "admin" password: "<OS_PASS>" verify_ssl: false output: debug_sinks: [wazuh] wazuh: transport: file file_path: /srv/sonar/anomalies/anomalies.json severity_medium: 0.2 severity_high: 0.3 - Create the shared directory and let the manager read it, then add the
<localfile>block ofsonar/wazuh/ossec-localfile.xmlto/srv/wazuh/manager/etc/ossec.conf(inside<ossec_config>, location/var/log/sonar/anomalies.json):bash sudo install -d -o "$USER" /srv/sonar/anomalies cat > /tmp/sonar-manager.yml <<'YAML' services: wazuh.manager: volumes: - /srv/sonar/anomalies:/var/log/sonar:ro YAMLRecreate the manager with the overlay added to the compose files used for the stack (-f /tmp/sonar-manager.yml). - Install SONAR's rules and restart the manager:
bash SONAR_WAZUH_ADMIN_PASSWORD="$WAZUH_AUTH_PASS" poetry run sonar wazuh install-rules --config sonar-lab.yaml --user "$WAZUH_AUTH_USER" --restart - Create the API user for the dedicated host, with a role that allows only
event:ingest, as described in the setup guide (docs/manual/sonar_docs/setup-guide.md).
Test steps
- Manager host,
filetransport. On the controller run:bash poetry run sonar detect --scenario sonar/scenarios/linux_resource_monitoring.yaml --config sonar-lab.yaml --debugthen, after one minute:bash curl -sk -u "admin:$OS_PASS" "https://localhost:9200/wazuh-alerts-*/_search?size=3" -H 'Content-Type: application/json' \ -d '{"query":{"bool":{"filter":[{"term":{"rule.id":"100503"}},{"term":{"data.integration":"sonar"}},{"range":{"timestamp":{"gte":"now-15m"}}}]}}}' - Dedicated host,
apitransport. On the dedicated host, copysonar-lab.yaml, setoutput.wazuh.transport: api,api_url: https://<controller>:55000,api_username: sonarandwazuh.base_urlto the controller's indexer, exportSONAR_WAZUH_API_PASSWORDwith thesonaruser's password, and run the command of step 1. Query the alerts as in step 1 and record, from one alert,location,decoder.name,agent.nameandfull_logif present. - RADAR active response. Add a test scenario to the lab copy of
radar/scenarios/active_responses/ar.yaml:yaml sonar_anomaly: ad: rule_ids: ["100503"] w_ad: 1.0 w_sig: 0.0 w_cti: 0.0 allow_mitigation: falsedeploy it with RADAR's usual procedure, repeat step 1, and inspect/var/ossec/logs/active-responses.logon the manager. - No self-ingestion. On the controller run:
bash poetry run sonar detect --config sonar-lab.yaml --lookback-minutes 30 --dry-run curl -sk -u "admin:$OS_PASS" "https://localhost:9200/wazuh-alerts-*/_count" -H 'Content-Type: application/json' \ -d '{"query":{"bool":{"filter":[{"range":{"timestamp":{"gte":"now-45m"}}}],"must_not":[{"terms":{"rule.groups":["sonar"]}}]}}}'and compare theFetched N of M matching alertsline of the detection log with the count, which excludes SONAR alerts.
Cleanup
- Remove the
<localfile>block, the overlay and/srv/sonar/anomalies; deletesonar_rules.xml(DELETE /rules/files/sonar_rules.xml) and thesonarAPI user, role and policy; restorear.yaml; restart the manager.
Expected outcome
- Step 1 returns alerts of rule 100503 with
data.anomaly_gradeanddata.anomaly_confidencenumeric anddata.sonar.scenario=resource_monitoring, within the period of the injected attacks (data.sonar.bucket_start). - Step 2 returns the same kind of alerts, sent from a host without a Wazuh agent with a user that can only ingest events; the recorded
locationanddecoder.nameshow how API events are decoded (expected: decoded as JSON). - Step 3:
active-responses.logshows RADAR handling asonar_anomalyalert with the alert's grade and confidence, and no mitigation is executed. - Step 4: the number of matching alerts
Mequals the count that excludes thesonarrule group, although SONAR alerts exist in the window.
Parent links: SRS-078 SONAR reports anomalies to the Wazuh manager
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Wazuh 4.14.1 single-node Docker stack, Ubuntu or Debian) |
| execution_type | Manual |
| verification_method | T |
| release | alpha |
| complexity | 3 |
| test_data | sonar/test_data/resource_monitoring (bundled resource-monitoring alerts) |
| version | 0.1 |
4.8 SONAR paths, detector backends, model files and package TST-069
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with sonar,test. - Poetry available on the path, to build the wheel.
Test steps
- From the repository root, run:
poetry run pytest tests/sonartests/test_paths.py tests/sonartests/test_backends.py tests/sonartests/test_packaging.py -v
Expected outcome
$SONAR_HOMEdecides the default locations when set; otherwise the package directory of a source checkout, otherwise~/.sonar. Paths in a configuration or scenario file resolve against that file; the resolved model, data and state locations are identical from three different working directories; the default and packaged scenarios point at the packaged debug data; a scenario withoutmodel_nameuses its name; the default scenario ID is the model name.- No module of the
sonarpackage outside its test-data scripts contains a./path literal or callsgetcwd/cwd. - Every backend (
mvad,pca,ewma) gives one verdict per bucket after its context and normalised results (severity in [0, 1], 0 for non-anomalies, contributors in decreasing order), finds the injected alert burst, and gives the same verdicts after saving and loading; the model directory holdsmetadata.jsonwith the backend name and columns, no pickle, and no leftover staging directory. - The
ewmabackend validates its parameters, refuses too little training data, and maps the threshold to severity 0.5 and twice the threshold to 1; an unknown backend, a missing model and an unknown model format version are refused. - The
pcabackend validates its parameters and refuses too little training data; it finds both injected anomalies with the injected feature as top contributor, flags at most 5 % of the normal buckets, flags a bucket whose two features are each in their usual range but break their training correlation, scores the first change of a feature that never moved in training as anomalous with a finite score, and takes its settings from the configuration file and, overriding them, from the scenario. - The
mvadbackend reproduces the timestamps, verdicts, severities and scores recorded intests/assets/sonar_mvad_regression.jsonbefore the backend interface existed, and its weights load as plain tensors withweights_only=True. - The built wheel contains the example scenarios, their debug datasets, the default configuration and the Wazuh rules, and nothing from
adbox/assets/secrets/,sonar/models/or.envfiles; itssonarpackage, run from a temporary directory withSONAR_HOMEset, trains and detects on the packagedlinux_resource_monitoringscenario in debug mode and writes SONAR events to thejsonlsink, without touching the repository.
tests/sonartests/test_paths.pytests/sonartests/test_backends.pytests/sonartests/test_packaging.pytests/assets/sonar_mvad_regression.json
Parent links: SRS-079 SONAR runs as a standalone package with safe, interchangeable models
Child links: TRP-059 TCER: SONAR paths, detector backends, model files and package, TRP-062 TCER: SONAR paths, detector backends, model files and package
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | generated in the tests (synthetic feature matrix with injected anomalies), packaged debug datasets, recorded MVAD verdicts |
| version | 0.1 |
4.9 SONAR evaluation metrics, calibration and sonar evaluate TST-070
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with sonar,test.
Test steps
- From the repository root, run:
poetry run pytest tests/sonartests/test_evaluation.py -v - Generate the labelled splits with
generate_resource_data.py --evaluationandgenerate_attack_data.py --evaluation, and runsonar evaluatewith calibration for each bundled scenario and each backend (mvad,pca,ewma), as listed indocs/specs/trp/assets/sonar-evaluation/README.md.
Expected outcome
- For known detections and labels, the event counts, true and false alarms, precision, recall, F1, mean delay and false alarms per day are the hand-computed values; touching reported buckets form one alarm; a tolerance widens the event windows; an alarm before an event has zero delay.
- Threshold and minimum run length select reported buckets with the same rule as detection.
- Events of types not counted are ignored with the alarms on them; events outside the scored span are not counted; detections outside the labelled span are ignored.
- Calibration picks the least filtering that reaches the best F1 within the false-alarm budget, and reports when no setting stays within it.
- Label files round-trip and invalid ones are refused; OpenSearch anomaly detection results (including a
_searchresponse with failed intervals) and generic JSON-lines records load as detections. sonar evaluatewrites a JSON report and a Markdown summary with the configured, validation and test runs and the anomaly confidence; it refuses inconsistent inputs; with a scenario and theewmabackend it trains, scores the test file and detects the labelled spike.- The generators write training, validation and test files with label files whose events lie inside each split's span after its context, and the same seed gives the same files.
- Every scenario and backend gets a JSON report and a Markdown summary with configured, validation and test runs; calibration states whether it stayed within the false-alarm budget, and the reported anomaly confidence equals the calibrated test precision.
tests/sonartests/test_evaluation.pydocs/specs/trp/assets/sonar-evaluation/README.md
Parent links: SRS-080 SONAR detection quality is measured against labelled data
Child links: TRP-060 TCER: SONAR evaluation metrics, calibration and sonar evaluate, TRP-063 TCER: SONAR evaluation of the pca backend
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | generated in the tests (detections and labels in memory, small alert files in temporary directories); labelled splits from the data generators (seed 42) |
| version | 0.1 |
4.10 SONAR end-to-end detection with real detectors TST-071
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with sonar,test(the tests import torch).
Test steps
- From the repository root, run:
poetry run pytest tests/sonartests/test_e2e_detection.py -v
Expected outcome
- A model trained on normal data, with the real MVAD library and with the
pcabackend, flags at least 80 % of the buckets of an injected CPU spike, an alert burst, a silence (no alerts at all) and an interval with a never-seen alert category, and at least twice the share of buckets it flags in the rest of the data. - Realtime polling with the real model over overlapping detection windows, delivering to the
jsonlsink with a watermark, writes at least one anomaly and noanomaly_idtwice, also after a restart.
tests/sonartests/test_e2e_detection.pytests/sonartests/e2e_data.py
Parent links: SRS-073 SONAR regular time axis and volume features, SRS-077 SONAR delivers each anomalous bucket at most once per scenario, SRS-080 SONAR detection quality is measured against labelled data
Child links: TRP-061 TCER: SONAR end-to-end detection with the real MVAD library, TRP-064 TCER: SONAR end-to-end detection with real detectors
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 3 |
| test_data | generated in the tests with fixed seeds (one alert per minute and host, labelled intervals) |
| version | 0.1 |
4.11 SONAR on RADAR's resource-utilization data TST-072
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with sonar,test.
Test steps
- From the repository root, run:
poetry run pytest tests/sonartests/test_radar_alignment.py -v
Expected outcome
- The packaged scenario reads
wazuh-archives-*, requests onlytimestamp,data.cpu_usage_pctanddata.mem_usage_pct, filters ondata.mem_usage_pctwithoutradar_seeddocuments, uses one-minute buckets with zero fill, and builds the mean and maximum of both metrics from string values. - With an agent, the
agent.nameterm joins the event filter, the model name and scenario identifier carry the agent, local data is filtered by agent, and a debug run with thepcabackend trains and detects that agent's model without a feature-settings warning, storing the agent filter in the model. - RADAR's detector results are read through every scroll page with a nested
entityfilter for the agent, the scroll is cleared also when a page fails, and the result count is capped. - Export fetches the window plus the 119 one-minute buckets of context MVAD needs, writes events, labels and RADAR results that the evaluation reads, exits with 2 when the window is empty, and rejects malformed or out-of-window events and an empty window before connecting.
tests/sonartests/test_radar_alignment.py
Parent links: SRS-081 SONAR scores RADAR's resource-utilization data for comparison
Child links: TRP-065 TCER: SONAR on RADAR's resource-utilization data
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | small events written in the tests, and the packaged debug data of the radar_linux_resource_utilization scenario |
| version | 0.1 |
4.12 SONAR indexer client: complete, filtered alert reads and one connection TST-087
Preconditions and setup actions
- SONAR dependencies installed:
poetry install --with sonar,test. - No Wazuh indexer and no network access are needed: the tests replace the OpenSearch client with an in-memory fake that implements point-in-time creation,
search_afterpaging and point-in-time deletion, or with mocks.
Test steps
- From the repository root, run the indexer client tests:
poetry run pytest tests/sonartests/test_indexer_client.py -v - Run the tests of the exclusion of SONAR's own alerts:
poetry run pytest tests/sonartests/test_sinks.py -k "OwnAlertsExcluded or rule_group_is_the_one_searches_exclude" -v
Expected outcome
- All 22 tests of step 1 and the 3 selected tests of step 2 pass.
- Complete read (
TestPaginatedSearch): 25,000 alerts, three per timestamp, are returned all and once each, oldest first, in pages of 10,000; the point-in-time is opened onwazuh-alerts-*with a keep-alive of 2 minutes and closed after the search, after an empty result, and when the second page fails, in which case the error is raised. - Query contract: the query has the
timestamprange withgtestart andltend as filter, the alert filter asmust(nomustwithout one), the sort ontimestampthenid, the point-in-time, and counts the matches on the first page only. - Cap: with
max_alerts15,000 and 25,000 matches, 15,000 alerts are returned, the newest alert is among them, the result is oldest first, and the warning names 25,000 andmax_alerts. - Declared fields (
TestRequiredSourceFields): a search withsource_fieldsrequests exactly those fields and returns no other; the feature builder liststimestamp, the numeric, maximum and categorical fields and the derived features' fields; every derived feature declares its fields and gives the same result on an alert reduced to them; the CLI's alert search passes the model's fields and thealert_filter. - Own alerts excluded: by default the query excludes the rule group
sonar(must_not), which is the group of SONAR's Wazuh rules; withexclude_rule_groups: []the query has nomust_not. - One connection (
TestOneConnection):verify_sslfalse,trueand a CA bundle path give the expected TLS arguments; the client gets the URL without trailing slash, basic authentication, the configured timeout and the CA bundle; the alert client and the data stream shipper are both built through the same factory with the CA bundle. - Writes (
TestIndexAnomaly,TestJsonSafe): an anomaly is created under itsanomaly_idwith NaN written as null; timestamps, numpy numbers, infinity and NaN are converted to JSON values; a 409 conflict counts as delivered while other errors are raised; a dry run sends nothing; the connection check reports a failed ping asFalse.
tests/sonartests/test_indexer_client.pytests/sonartests/test_sinks.py
Parent links: SRS-086 SONAR reads every matching alert through one indexer client
Child links: TRP-066 TCER: SONAR indexer client: complete, filtered alert reads and one connection
| Attribute | Value |
|---|---|
| platform | GNU/Linux (Dockerized C5-DEC deployment environment) |
| execution_type | Automated |
| verification_method | T |
| release | alpha |
| complexity | 2 |
| test_data | alerts generated in the tests and served by an in-memory fake of the OpenSearch client; no indexer is contacted |
| version | 0.1 |
4.13 SONAR container image content, dependencies and mounts TST-088
No automated test covers the image; this test inspects the build files (sonar/Dockerfile.sonar, sonar/Dockerfile.sonar.dockerignore, sonar/sonar.sh, sonar/wazuh/docker-compose.sonar.yml) and then builds and examines the image.
Preconditions and setup actions
- A repository checkout; all commands run from its root.
- Docker 23 or later, whose default builder is BuildKit (
docker buildx versionsucceeds). The build downloads thepython:3.10.12base image and the Python packages, so it needs network access to Docker Hub and PyPI; no Wazuh deployment is needed. - No image or container named
sonar:v0.8/sonar-containerthat must be kept. Step 9 retrains the host'ssonar/models/linux_resource_monitoringmodel, replacing an existing one; the host'ssonar/models/must be writable by uid 1000 (the image's user), and the step needs an interactive terminal (sonar/sonar.shrunsdocker run -it).
Test steps
Inspection
- Show the build instructions:
grep -nE '^(FROM|USER|COPY|RUN|ENTRYPOINT|CMD)' sonar/Dockerfile.sonar. - Show the build-context rules:
grep -vE '^\s*(#|$)' sonar/Dockerfile.sonar.dockerignore. - Show the mounts:
grep -n -- '-v \|_VOLUME=' sonar/sonar.shandgrep -nA14 '^ sonar:' sonar/wazuh/docker-compose.sonar.yml.
Build and examination
- Plant canary files that must not reach the image:
mkdir -p sonar/payloads sonar/models/state touch sonar/.env sonar/canary.pkl sonar/payloads/canary.json sonar/models/state/canary-tst088.json - Build the image:
docker build -f sonar/Dockerfile.sonar -t sonar:v0.8 . - List the project directory and search it for excluded paths:
docker run --rm --entrypoint sh sonar:v0.8 -c 'ls -A /home/alab/soar /home/alab/soar/adbox; find /home/alab/soar \( -name .env -o -name "*.pkl" -o -path "*/sonar/payloads*" -o -path "*/sonar/models/state*" -o -path "*/adbox/assets*" -o -name __pycache__ \)' - List the installed packages:
docker run --rm --entrypoint poetry sonar:v0.8 run pip list --format=freeze. - Show the user, entry point and command:
docker image inspect sonar:v0.8 --format '{{.Config.User}} {{.Config.Entrypoint}} {{.Config.Cmd}}', then rundocker run --rm sonar:v0.8; echo "exit $?". - Run a debug scenario through the wrapper script:
sonar/sonar.sh scenario --use-case sonar/scenarios/linux_resource_monitoring.yaml --debug, thenls sonar/models/linux_resource_monitoring/.
Cleanup
rm -f sonar/.env sonar/canary.pkl sonar/payloads/canary.json sonar/models/state/canary-tst088.json, and remove sonar/payloads/ and sonar/models/state/ if step 4 created them.
Expected outcome
- Step 1: the base image is
python:3.10.12; a user is created andUSER ${user}(withENV user=alab) precedes the installs; the onlyCOPYsources arepyproject.toml poetry.lock README.md,sonarandadbox/__init__.py(noCOPY .); the installs arepoetry install --only main,sonar --no-rootandpoetry install --only-root; the entry point is["poetry", "run", "sonar"]and the command["--help"]. - Step 2: the first rule is
*; the only re-included paths arepyproject.toml,poetry.lock,README.md,sonarandadbox/__init__.py;**/.env,**/*.pkl,sonar/payloads,sonar/models/state,**/__pycache__and**/.DS_Storeare excluded. - Step 3:
sonar/sonar.shmountssonar/models,sonar/test_data,sonar/scenariosandsonar/default_config.yamlat the same paths under/home/alab/soar/sonar/, and${SONAR_ANOMALIES_DIR:-/srv/sonar/anomalies}at/var/log/sonar; the compose servicesonarmounts the anomaly directory,sonar/models,sonar/scenariosandsonar/default_config.yaml(read-only). - Step 5: the build succeeds.
- Step 6:
/home/alab/soarlists exactlyREADME.md,adbox,poetry.lock,pyproject.tomlandsonar;adboxholds only__init__.py; thefindcommand prints nothing, so none of the canaries is in the image. - Step 7: the list contains
time-series-anomaly-detector==0.4.0,torch==2.3.0,opensearch-py==3.0.0andpandas==2.2.2, and none oftabulate,more-itertools,ansible-core,selenium,scapy,faker,geoip2,pytest-cov,pytest-mock,doorstop. - Step 8: the user is
alab, the entry point[poetry run sonar]and the command[--help]; the container prints SONAR's usage with its subcommands and the exit status is 0. - Step 9: training and detection complete with exit status 0, any reported anomaly is printed as a SONAR event on standard output, and
metadata.jsonand the backend's state files of the trained model appear in the host'ssonar/models/linux_resource_monitoring/.
sonar/sonar.sh
Parent links: SRS-087 SONAR container image contains only SONAR
| Attribute | Value |
|---|---|
| platform | GNU/Linux with Docker 23 or later (BuildKit builder) |
| execution_type | Manual |
| verification_method | I/T |
| release | alpha |
| complexity | 2 |
| test_data | the repository checkout as build context, with canary files planted in step 4; the packaged debug data of the linux_resource_monitoring scenario |
| version | 0.1 |