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

  1. Clone the ADBox repository. git clone https://github.com/AbstractionsLab/idps-escape.git

  2. Change the working directory to the cloned folder containing all the files along with the Dockerfile.

cd siem-mtad-gat
  1. Build the image.

3a. Make the script executable: chmod +x build-adbox.sh

3b. And execute it as follows

./build-adbox.sh
  1. 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

  1. Clone this repository: git clone https://github.com/AbstractionsLab/idps-escape.git
  2. Start Docker Desktop if not already running.
  3. Open the project folder in VS Code.
  4. Select the "Reopen in Container" option in the notification that pops up in VS Code or run it via the command palette.
  5. Open a terminal in VS Code and run poetry install in the container to install all dependencies.
  6. 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-container should be running.

Test steps

  1. 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-container should 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

  1. Run the container “siem-mtad-gat-container” by executing the adbox script without any parameters. ./adbox/adbox.sh
  2. Input y after Are 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

  1. Run the container “siem-mtad-gat-container” by executing the adbox script without any parameters. ./adbox/adbox.sh
  2. Input y after Are 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.json and 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-container should 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

  1. Run the container siem-mtad-gat-container by 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}/prediction folder.

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-container should be running.
  • No instance of Wazuh distribution running.

Test steps

  1. Run the container siem-mtad-gat-container by 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-container should 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

  1. Run the container siem-mtad-gat-container by 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}/prediction folder.

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-container should be running.
  • No instance of Wazuh distribution running.

Test steps

  1. Run the container siem-mtad-gat-container by 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}/prediction folder.

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-container should 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

  1. Run the container siem-mtad-gat-container by 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}/prediction folder.

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-container should be running.
  • No instance of Wazuh distribution running.

Test steps

  1. Run the container siem-mtad-gat-container by 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-container should 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

  1. Run the container siem-mtad-gat-container by 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}/prediction folder.

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-container should be running.
  • No instance of Wazuh distribution running.

Test steps

  1. Run the container siem-mtad-gat-container by 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}/prediction folder.

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-container should 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

  1. Run the container siem-mtad-gat-container by 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}/prediction folder.

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-container should be running.
  • No instance of Wazuh distribution running.

Test steps

  1. Run the container siem-mtad-gat-container by 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}/prediction folder.

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-container should be running.
  • An instance of a Wazuh distribution should be running.

Test steps

  1. Run the container siem-mtad-gat-container by 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 templatesadbox_stream_template,adbox_stream_template_mtad_gat;
  • Indexer Management>Index Management>Templates>Component templates check for presence of base templatescomponent_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-container should be running.
  • An instance of a Wazuh distribution should be running.

Test steps

  1. Run the container siem-mtad-gat-container by 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. DashboardTST-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

  1. Open Dashboard Management.
  2. Select Dashboard Management>Index patterns and create a new index.
  3. Add the data stream pattern using the.
  4. Select timestamp as time field.
  5. Finally, the pattern is created. The field names correspond to the prediction outcome fields.

Expected outcome

  1. The pattern is created. The field names correspond to the prediction outcome fields.
  2. 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.git cloned 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-container should be running.

Test steps

  1. Open the cloned ADBox repository
  2. Open the /siem_mtad_gat/assets/secrets/wazuh_credentials.json
  3. Set "host" as indexer's host address
  4. Set "port" as indexer's port
  5. Run
./adbox/adbox.sh -c

Expected outcome

  1. 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.git cloned 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-container should be running.

Test steps

  1. Open the cloned ADBox repository
  2. Open the /siem_mtad_gat/assets/secrets/wazuh_credentials.json
  3. Update "username" as indexer's username
  4. Update "password" as indexer's password
  5. Run
./adbox/adbox.sh -c

Expected outcome

  1. 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

  1. Open the cloned ADBox repository
  2. 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.
  3. Open siem_mtad_gat/frontend/viznotebook/result_visualizer.ipynb within dev container
  4. Insert dector id in Variables and path to be modified
  5. Run Notebook
  6. Go to Running ADBox with a use-case>Training>Training output table

Expected outcome

  1. 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

  1. Open the cloned ADBox repository
  2. Choose one of the detectors avaliable in siem_mtad_gat/assets/detector_models.
  3. Open siem_mtad_gat/assets/detector_models/uuid/training/train_losses.png using system default software.

Expected outcome

  1. 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

  1. Open the cloned ADBox repository
  2. Choose one of the detectors avaliable in siem_mtad_gat/assets/detector_models.
  3. Open siem_mtad_gat/assets/detector_models/uuid/prediction
  4. Open a prediction file of the uc-x_predicted_anomalies_data-*.json using system default software.

Expected outcome

  1. 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

  1. Create a new directory for suricata docker deployment.
  2. In the directory download the suricata.yaml configuration file docs/manual/custom_deployments/suricata/suricata.yaml.
  3. 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.
  4. In the directory download the Dockerfile docs/manual/custom_deployments/suricata/Dockerfile.
  5. Pull the ubuntu docker base image. sudo docker pull ubuntu
  6. Build the docker image.
sudo docker build -t suricata-container .
  1. Run the docker container.
sudo docker run --network=host --hostname=suricata-instance --name=suricata-instance -it suricata-container

Expected outcome

  • Container named suricata-instance is running. Verify it by checking the running docker container with this command. sudo docker ps -a
  • Upon running the ps aux command 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-docker single-node stack. The C&C deployment documented in this repository is radar/build-radar.sh --core-only (radar/docker-compose.core.yml, Wazuh 4.14.1), see docs/manual/radar_docs/radar-getting-started.md.

Test steps

  1. 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
  1. Navigate to the directory since it is a single node deployment.
cd wazuh-docker/single-node
  1. Provide the group of certificates for secure communication. sudo docker-compose -f generate-indexer-certs.yml run --rm generator

  2. Deploy Wazuh as single-node using docker-compose. sudo docker-compose up -d This 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 -a you shall see wazuh/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.sh requires an enrollment password and keeps port 1515 closed outside an enrollment window; enroll there with radar/radar-agent/bootstrap-agent.sh and a token minted with radar/radar.sh mint-token (see docs/manual/radar_docs/radar-getting-started.md#3-onboard-an-endpoint).

Test steps

  1. On the Wazuh Dashboard, go to Endpoint Summary, and click on Deploy new agent.
  2. Select the package to download and install on the respective system i.e., Linux DEB amd64.
  3. 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
  1. 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
  1. 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.sh requires an enrollment password and keeps port 1515 closed outside an enrollment window; enroll there with radar/radar-agent/bootstrap-agent.sh and a token minted with radar/radar.sh mint-token (see docs/manual/radar_docs/radar-getting-started.md#3-onboard-an-endpoint).

Test steps

  1. On the Wazuh Dashboard, go to Endpoint Summary, and click on Deploy new agent.
  2. Select the package to download and install on the REMOTE MACHINE system i.e., Linux DEB amd64.
  3. 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
  1. 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
  1. 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

  1. 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"
  1. 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.
  1. Access the bash of the container which is running the Wazuh Manager. sudo docker exec -it [Container name or ID of Wazuh Manager] bash
  2. Run the command to access the Agent Manager. /var/ossec/bin/manage_agents
  3. The removal can be confirmed by entering L and 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

  1. Access the bash of the container which is running the Wazuh Manager.
sudo docker exec -it [Container name or ID of
Wazuh Manager] bash
  1. Run the command to access the Agent Manager. /var/ossec/bin/manage_agents
  2. Press <R> which is the option for removing and agent and press enter.
  3. 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 ID removed".
  • 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.

  1. Edit the configuration file of the Wazuh agent to make it able to read Suricata logs. sudo nano /var/ossec/etc/ossec.conf
  2. 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>

  1. Remove the Suricata container. sudo docker rm suricata-instance
  2. 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
  1. Restart the Wazuh agent
sudo systemctl restart wazuh-agent
  1. 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
  1. Enter any number from 1 to 11 to generate the respective traffic.
  2. 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

    1. 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 script docs/manual/custom_deployments/remote_monitoring/idps-escape-port-mirroring.sh.
  1. From machine 2, send some ICMP echo request packets to machine 1.
ping -c3 [IP of the capture interface of machine
1]
  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

  1. 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
  1. 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

  1. 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

  2. Enter any number from 1 to 11 to generate the respective traffic on the console.

  3. 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, select is and 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

  1. Stop the deployment stack if it's running. From wazuh repository:
sudo docker-compose down
  1. 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
  1. Copy the generated hash.
  2. Open the config/wazuh_indexer/internal_users.yml file. Locate the block for the user for whom the password is being changed for.

Part 2: Set the new password.

  1. In the docker-compose.yml file, replace all instances of the old password with the new one.

Part 3: Apply changes

  1. Start the deployment stack.
sudo docker-compose up -d
  1. Enter the container bash.
sudo docker exec -it [Name or ID of the Wazuh Indexer container] bash
  1. 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
  1. 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.sh script 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
  1. 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

  1. Stop the deployment stack if it's running. From wazuh repository:
sudo docker-compose down
  1. 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
  1. Copy the generated hash.
  2. Open the config/wazuh_indexer/internal_users.yml file. Locate the block for the user for whom the password is being changed for.

Part 2: Set the new password.

  1. In the docker-compose.yml file, replace all instances of the old password with the new one at API_PASSWORD occurrence.

Part 3: Apply changes

  1. Start the deployment stack.
sudo docker-compose up -d

Expected outcome

  1. 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 $TOKEN This hould return the following error. {"title": "Unauthorized", "detail": "Invalid credentials"}
  2. 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

  1. Get the Wazuh API Token.
  2. 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

  1. 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

  1. On the Wazuh dashboard navigate to Threat Hunting and filter by data.tunnel.src_ip:[IP remote machine].

Expected outcome

  1. 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

  1. Open Wazuh Dashboard
  2. Go to Threat Hunting > Events> Add Filter and choose rule.mitre.id exists.
  3. Inspect filtered output (possibly extend time interval for more results).

Expected outcome

  1. In json rule.mitre.id key 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

  1. Open the docs/traceability/HARC.html file using the browser

Expected outcome

  1. 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 git available.
  • All commands are run from the repository root.

Test steps

  1. Inspect the licence file: bash head -3 LICENSE grep -E '^[0-9]+\. ' LICENSE tail -1 LICENSE Read the preamble and terms, and compare them with the AGPL-3.0 published at https://www.gnu.org/licenses/agpl-3.0.html.
  2. Inspect the authors file and the package metadata: bash cat AUTHORS grep '^authors' pyproject.toml
  3. Inspect the licence section of the top-level README: bash grep -n -A3 '^## License' README.md
  4. 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.
  5. 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

  1. LICENSE starts with GNU AFFERO GENERAL PUBLIC LICENSE and Version 3, 19 November 2007, lists the 18 sections 0. Definitions. to 17. Interpretation of Sections 15 and 16., and ends with END OF TERMS AND CONDITIONS. Its preamble and terms match the published AGPL-3.0 apart from layout.
  2. AUTHORS lists the developers and states that IDPS-ESCAPE is licensed under the GNU Affero General Public License version 3. The authors entry of pyproject.toml names the same developers.
  3. The README licence section names the copyright holders (itrust Abstractions Lab and itrust consulting), states the GNU AGPL v3.0 and links to LICENSE and AUTHORS.
  4. Exactly the files of adbox/ad_opensearch_extension/ and adbox/data_ingestion/__init__.py are listed, and each keeps the Copyright OpenSearch Contributors notice with SPDX-License-Identifier: Apache-2.0. No other source file carries a licence notice that conflicts with the AGPL-3.0.
  5. adbox/mtad_gat_pytorch/LICENSE is the MIT licence of the original MTAD-GAT authors; licences/ contains LICENCE_OmniAnomaly, LICENCE_TelemAnom and LICENCE_pyGAT, one for each project credited in the component's README.md.

The test passes when all five outcomes are observed.

LICENSE AUTHORS README.md adbox/mtad_gat_pytorch/LICENSE adbox/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-data prints nothing.
  • radar/.env created from radar/env.example, with OS_PASS, WAZUH_AUTH_PASS and INDEXER_DASHBOARD_PASSWORD empty or set to the stock Wazuh values.
  • All commands run in radar/. To use a value from .env in a command without printing it, read it with v() { python3 -m wazuh_api.envfile get "$1" .env; } (the RADAR scripts need the same Python modules). Define os_ok() { curl -sk -o /dev/null -w '%{http_code}\n' -u "admin:$1" https://localhost:9200/_cluster/health; } and api_ok() { curl -sk -o /dev/null -w '%{http_code}\n' -u "wazuh-wui:$1" -X POST https://localhost:55000/security/user/authenticate; }.

Test steps

  1. First deployment: sudo ./build-radar.sh --core-only. Then stat -c '%a' .env, stat -c '%a' .radar-generated, ls -a .radar-generated, and check that .radar-generated/internal_users.yml contains no value of .env.
  2. 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 as admin with OS_PASS.
  3. Existing deployment kept: sha256sum .env > env.sum; sudo ./stop-radar.sh; sudo ./build-radar.sh --core-only; sha256sum -c env.sum.
  4. Deploy a scenario so that the manager has an active_responses.env: sudo ./build-radar.sh log_volume.
  5. Refusals: sha256sum .env > env.sum; ./radar.sh rotate-credentials (without sudo); then docker stop wazuh.indexer, sudo ./radar.sh rotate-credentials, sha256sum -c env.sum, docker start wazuh.indexer and wait until os_ok "$(v OS_PASS)" returns 200.
  6. Rotation: OLD_OS="$(v OS_PASS)"; OLD_API="$(v WAZUH_AUTH_PASS)"; sudo ./radar.sh rotate-credentials; echo $?.
  7. 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"; compare sudo sha256sum .radar-state/env.before-rotation with env.sum; sudo stat -c '%a' .radar-state/env.before-rotation. Log in to the dashboard as admin with the new OS_PASS.
  8. 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 $?.
  9. Deployment still healthy: ./health-radar.sh --scenario log_volume.
  10. Clean up: unset OLD_OS OLD_API; rm env.sum.

Expected outcome

  1. The build reports OK - generated unique credentials in .env: ... naming at least INDEXER_DASHBOARD_PASSWORD, OS_PASS and WAZUH_AUTH_PASS, and OK - wrote .radar-generated/internal_users.yml and wazuh.yml, and ends with === SUCCESS .... .env has mode 600 and .radar-generated mode 700, holding internal_users.yml, wazuh.yml and .gitignore. internal_users.yml holds bcrypt hashes only.
  2. 200 for the generated OS_PASS, 401 for SecretPassword, 200 for the generated WAZUH_AUTH_PASS, 401 for the stock API password, 401 for the demo user readall. The dashboard login succeeds.
  3. The build reports OK - existing deployment (..._wazuh-indexer-data found): passwords left unchanged; sha256sum -c reports OK.
  4. The build completes without error.
  5. 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 .env unchanged (OK).
  6. 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.
  7. 200 for the new OS_PASS, 401 for the old one; 200 for the new WAZUH_AUTH_PASS, 401 for the old one. The checksum of .radar-state/env.before-rotation equals the one in env.sum, and its mode is 600. The dashboard login with the new password succeeds.
  8. root:wazuh 440, and grep exits 0: the manager's active-response environment carries the new indexer password.
  9. No line of the Wazuh API section reports Authentication failed, the core daemons are reported running, and the OpenSearch check reports OK - OpenSearch reachable (cluster: ...). A FAIL for agents in log_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.sh radar/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 sudo on 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.0 of SATRAP-DL. Once deployed, its address is set as DECIPHER_BASE_URL in .env (step 2).

Test steps

  1. On the RADAR host, the working directory is required to be radar:
cd radar
  1. Create .env from 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.

  1. 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.)

  1. 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
  1. Check that agent enrollment is hardened:
sudo ./radar.sh enrollment status
sudo grep -E '<use_password>|<purge>' /srv/wazuh/manager/etc/ossec.conf
  1. 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

  1. The working directory is radar.

  2. .env exists with the required variables set.

  3. The command completes with === SUCCESS: plain Wazuh manager/indexer/dashboard is up (no RADAR scenario applied) ===.

  4. Three items to verify:

    • wazuh.manager, wazuh.indexer and wazuh.dashboard are listed as Up.
    • config/wazuh_indexer_ssl_certs/ contains the generated .pem files.
    • OS_PASS, WAZUH_AUTH_PASS and DASHBOARD_PASS are set in .env, with values other than the stock Wazuh demo passwords, and WAZUH_CLUSTER_KEY is set.
  5. The window status is CLOSED - port 1515 is blocked, and ossec.conf contains <use_password>yes</use_password> and <purge>no</purge>.

  6. The indexer answers with the generated credentials, and its cluster status is green or yellow.

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/.env filled in, Docker available on the controller host.
  • A Linux endpoint reachable from the manager, with sudo.

Test steps

  1. On the controller host, the working directory is required to be radar:
cd radar
  1. Build RADAR with the suspicious_login scenario (prefix with sudo if 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.

  1. 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
  1. 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 --purge to also remove the volumes).
  • On the endpoint, from the radar-agent folder: 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.dashboard or 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/.env filled in, Docker available on the controller host.
  • A Linux endpoint reachable from the manager, with sudo.

Test steps

  1. On the controller host, the working directory is required to be radar:
cd radar
  1. Build RADAR with the geoip_detection scenario (prefix with sudo if 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.

  1. 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
  1. 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 --purge to also remove the volumes).
  • On the endpoint, from the radar-agent folder: 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.dashboard or 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/.env filled in, Docker available on the controller host.
  • A Linux endpoint reachable from the manager, with sudo.

Test steps

  1. On the controller host, the working directory is required to be radar:
cd radar
  1. Build RADAR with the log_volume scenario (prefix with sudo if 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.

  1. 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>
  1. 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 --purge to also remove the volumes).
  • On the endpoint, from the radar-agent folder: 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-volume is 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.dashboard or 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

  1. The working directory is required to be radar:
cd radar
  1. Run RADAR with SCENARIO_NAME log_volume. Add --ingest true to seed a synthetic history for the agent named in scenarios.log_volume.ingest.agent_name of config.yaml, so that the detector has a baseline at once:
./run-radar.sh log_volume

Expected outcome

  1. 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_DETECTOR is listed, started, with the configuration of log_volume in config.yaml: index wazuh-ad-log-volume-*, feature log_volume_max, category field agent.name, interval 1 minute.

    2.2. In the Alerting menu, the monitor LogVolume-Monitor is listed under Monitors, enabled, with the trigger LogVolume-Growth-Detected and an action to the RADAR Webhook notification 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 in radar/.env.

Test steps

  1. Copy radar/radar-test-framework/simulate/scenarios/suspicious_login.py to the endpoint. Edit its CONFIG if needed (log_path, default /var/log/auth.log; hostname).
  2. On the endpoint, run every case (burst, travel, failed_travel, composite, benign): bash sudo python3 suspicious_login.py or 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, detection signature.
  • Expected risk_score range is between 0.0 and 1.0, and the tier follows the tiers boundaries of suspicious_login in ar.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 dispatched line for the decision).
    • 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.
    • Tier 2:
      • Email and FlowIntel case as for Tier 1; the case is tagged with medium priority.
      • If allow_mitigation is true for suspicious_login, each command of mitigations_tier2 is dispatched (Wazuh Active Response dispatched); otherwise Actions planned shows them under would_be_mitigations with withheld_reason: mitigation_disabled.
    • Tier 3:
      • Email and FlowIntel case as for Tier 1; the case is tagged with high priority.
      • If allow_mitigation is true for suspicious_login, each command of mitigations_tier3 is dispatched; otherwise it is withheld as above.
  • 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 (never root or 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.log monitored).

Test steps

  1. Copy radar/radar-test-framework/simulate/scenarios/geoip_detection.py to the endpoint. Edit its CONFIG if needed (auth_log_path, web_log_path, hostname).
  2. On the endpoint, run every case: bash sudo python3 geoip_detection.py or 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, detection signature. 100902 alerts produce no decision (not bound to the active response).
  • With the shipped ar.yaml the risk score is 0.54 (w_sig 1.0 × likelihood 0.9 × impact 0.6, no CTI) and the tier is 2.
  • Expected risk_score range is between 0.0 and 1.0, and the tier follows the tiers boundaries of geoip_detection in ar.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 dispatched line for the decision).
    • 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.
    • Tier 2:
      • Email and FlowIntel case as for Tier 1; the case is tagged with medium priority.
      • If allow_mitigation is true for geoip_detection, each command of mitigations_tier2 is dispatched (Wazuh Active Response dispatched); otherwise Actions planned shows them under would_be_mitigations with withheld_reason: mitigation_disabled.
    • Tier 3:
      • Email and FlowIntel case as for Tier 1; the case is tagged with high priority.
      • If allow_mitigation is true for geoip_detection, each command of mitigations_tier3 is dispatched; otherwise it is withheld as above.
  • Mitigation check on the agent:
    • firewall-drop: the alert's source IP is blocked.
    • lock_user_linux.sh: the alert's user is locked (never root or 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

  1. Copy radar/radar-test-framework/simulate/scenarios/log_volume.py to the endpoint. Edit its CONFIG if needed: target_dir (default /var/log), the growth (start_bytes, growth_factor, steps) and cleanup_minutes. The growth must be large enough to pass the detector's rules in config.yaml (deviations that are too small are ignored).
  2. 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, detection ad; the risk score is 0.9 × grade × confidence (no CTI source).
  • Expected risk_score range is between 0.0 and 1.0, and the tier follows the tiers boundaries of log_volume in ar.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 dispatched line for the decision).
    • 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.
    • Tier 2:
      • Email and FlowIntel case as for Tier 1; the case is tagged with medium priority.
      • If allow_mitigation is true for log_volume, each command of mitigations_tier2 is dispatched (Wazuh Active Response dispatched); otherwise Actions planned shows them under would_be_mitigations with withheld_reason: mitigation_disabled.
    • Tier 3:
      • Email and FlowIntel case as for Tier 1; the case is tagged with high priority.
      • If allow_mitigation is true for log_volume, each command of mitigations_tier3 is dispatched; otherwise it is withheld as above.
  • Mitigation check on the agent:
    • firewall-drop: the alert's source IP is blocked.
    • lock_user_linux.sh: the alert's user is locked (never root or 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

  1. 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 (Up status in docker 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/snapshots inside the indexer container. The snapshot data is restored into multi-node Wazuh and the Opensearch cluster is green.
  • The user has sudo privileges on the Wazuh host.
  1. 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.yml maps, 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 (from env.example) points at the existing stack and holds the runtime secrets used by the deployment scripts and, copied into the manager as active_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.sh for 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, rule 5502, level 3, description PAM: Login session closed., groups pam, 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:wazuh ownership.
  • Post-12: PASS - pyyaml and requests importable and PASS - maxminddb importable.
  • Post-13: Both GeoLite2 .mmdb files present on both manager nodes.
  • Post-14: PASS - All pre-existing files byte-for-byte unmodified.
  • Post-15: log_volume_metric patch present in container pipeline file (2 matches). OpenSearch pipeline filebeat-7.10.2-wazuh-archives-pipeline also contains the patch.
  • Post-16: No changes to wazuh-alerts-* template. wazuh-ad-log-volume-* template present after log_volume deployment.

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/.env filled in, Docker available on the controller host.
  • A Linux endpoint reachable from the manager, with sudo.

Test steps

  1. On the controller host, the working directory is required to be radar:
cd radar
  1. Build RADAR with the scanning_detection scenario (prefix with sudo if 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.

  1. 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
  1. 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 --purge to also remove the volumes).
  • On the endpoint, from the radar-agent folder: 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.dashboard or 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

  1. Copy radar/radar-test-framework/simulate/scenarios/scanning_detection.py to the endpoint. Edit its CONFIG if needed: log_path (default /var/log/suricata/eve.json), host, webdav_host (a virtual host listed in radar_webdav_apps) and fail_threshold (must equal the frequency of rule 100825).
  2. 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_only raises 100810 (level 3); i2_only 100825 (level 10); i2_below only 100815; i3_only 100820 and 100821 (level 6); none of them raises 100830.
  • i2_spread, i3_excluded, webdav_app and legit raise nothing above level 3.
  • confirm_1_2, confirm_1_3 and confirm_2_3 each raise 100830 (level 12) with the source IP; confirm_split does 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, detection signature; no other rule of the scenario produces a decision.
  • With the shipped ar.yaml the risk score is 0.378 + 0.3 × CTI score, so Tier 2 at least.
  • A source listed in radar_scanning_allowlist is still alerted, but its mitigation is declined: the audit entry in /var/ossec/logs/active-responses.log has "result":"declined","reason":"allowlist".
  • Expected risk_score range is between 0.0 and 1.0, and the tier follows the tiers boundaries of scanning_detection in ar.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 dispatched line for the decision).
    • 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.
    • Tier 2:
      • Email and FlowIntel case as for Tier 1; the case is tagged with medium priority.
      • If allow_mitigation is true for scanning_detection, each command of mitigations_tier2 is dispatched (Wazuh Active Response dispatched); otherwise Actions planned shows them under would_be_mitigations with withheld_reason: mitigation_disabled.
    • Tier 3:
      • Email and FlowIntel case as for Tier 1; the case is tagged with high priority.
      • If allow_mitigation is true for scanning_detection, each command of mitigations_tier3 is dispatched; otherwise it is withheld as above.
  • Mitigation check on the agent:
    • firewall-drop: the alert's source IP is blocked.
    • lock_user_linux.sh: the alert's user is locked (never root or 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/.env filled in, Docker available on the controller host.
  • A Linux endpoint reachable from the manager, with sudo.

Test steps

  1. On the controller host, the working directory is required to be radar:
cd radar
  1. Build RADAR with any scenario; the default rules and response binding are deployed with every scenario. For example, the suspicious_login scenario (prefix with sudo if 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.

  1. 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
  1. 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 --purge to also remove the volumes).
  • On the endpoint, from the radar-agent folder: 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.yaml maps 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.conf includes 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.dashboard or 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

  1. 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).
  2. Optionally, on the endpoint, make repeated failed SSH logins for an existing user until a stock rule of the authentication_failures group 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 group authentication_failures), detection signature, unless its rule ID is mapped to another scenario (rule-ID matches take precedence over group matches).
  • The default scenario has no DECIPHER analysis endpoint, so the CTI score is 0 and, with the shipped ar.yaml, the risk score is w_sig 0.7 × likelihood × impact 0.5: 0.00035 (23503), 0.00175 (23504), 0.0035 (23505) and 0.105 (authentication_failures), all below tier1_min 0.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_TO receives 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 .env are available. See env.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, and MAXMIND_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 .env as MAXMIND_LICENSE_KEY in 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.0 of SATRAP-DL. Once deployed, configure the DECIPHER_BASE_URL variable in .env to point to the running DECIPHER instance.
  • Shell commands in the expected outcomes use $OS_URL, $OS_USER and $OS_PASS. The first deployment generates OS_PASS, so load these from .env after 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")"; done

    Confirm with env | grep OS_. Do not use the stock SecretPassword: the indexer rejects it with Unauthorized.

Optional: test the full pipeline including integration with DECIPHER

Test steps

  1. 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.

  1. 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>.

  1. 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.

  2. In the GUI, go to Deployment → Agent Management (default Onboard agent sub-tab). Select scenario suspicious_login, click Mint token, and copy the printed bootstrap-agent.sh command.

  3. Copy the whole radar-agent folder 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-name argument (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
  1. In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario suspicious_login, and click Assign group.

  2. Check health of manager: in Deployment → Status, choose the Suspicious Login scenario and press Run health check.

  3. 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

  1. .env exists in the controller with the required variables set, including MAXMIND_LICENSE_KEY.

  2. 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 .venv directory is created under the RADAR root.

  3. Two items to verify:

    • (a) The command completes with === SUCCESS in 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.

  1. A ready-to-run command of the form sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,suspicious_login,radar_shared is printed.

  2. The command completes with === SUCCESS === in its output.

  3. On the Wazuh Dashboard, open Agents management → Summary. The agent should be assigned groups suspicious_login and radar_shared.

  4. No FAIL lines should be present in the health check.

  5. Three items to verify:

    • (a) suspicious_login.py is 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

  1. 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
  1. 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_detection needs it too).

Test steps

  1. On the controller host, prepare .env:
cd radar
cp env.example .env

Edit it with the values described in Preconditions (see TST-055).

  1. 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>.

  1. 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.

  2. In the GUI, go to Deployment → Agent Management (default Onboard agent sub-tab). Select scenario geoip_detection, click Mint token, and copy the printed bootstrap-agent.sh command.

  3. Copy the whole radar-agent folder 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-name argument (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
  1. In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario geoip_detection, and click Assign group.

  2. Check health of manager: in Deployment → Status, choose the GeoIP Detection scenario and press Run health check.

  3. 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.

  1. (Optional) If DECIPHER is configured, open Flowintel in browser.

Expected outcome

  1. .env exists in the controller with the required variables set, including MAXMIND_LICENSE_KEY.

  2. The GUI is reachable in a browser, and the Deployment page shows Scenario Management, Agent Management, and Group Management tabs all present.

  3. Two items to verify:

  • (a) The command completes with === SUCCESS in 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.

  1. A ready-to-run command of the form sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,geoip_detection,radar_shared is printed.

  2. The command completes with === SUCCESS === in its output.

  3. On the Wazuh Dashboard, open Agents management → Summary. The agent should be assigned groups geoip_detection and radar_shared.

  4. No FAIL lines should be present in the health check.

  5. Two items to verify:

  • (a) geoip_detection.py is 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 rule 100902 (web cases) appear in Wazuh Dashboard (Discovery), and no rule fires for the whitelisted and private-address cases.
  • radar_ar.py wrote an active-response entry to active-responses.log.
  • An email notification is delivered (check the SMTP relay logs or destination inbox).
  • enrichment_errors.log has no new entries.
  1. (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

  1. After finishing tests, clean up using Deployment → Teardown in the GUI.

  2. 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.json records to /var/log/suricata/eve.json on the agent host (the directory is created if missing); the scanning_detection agent configuration collects that file together with the Apache and Nginx access logs.

Optional: test the full pipeline including integration with DECIPHER

Test steps

  1. On the controller host, prepare .env:
cd radar
cp env.example .env

Edit it with the values described in Preconditions (see TST-055).

  1. 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>.

  1. 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.

  2. In the GUI, go to Deployment → Agent Management (default Onboard agent sub-tab). Select scenario scanning_detection, click Mint token, and copy the printed bootstrap-agent.sh command.

  3. Copy the whole radar-agent folder 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-name argument (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
  1. In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario scanning_detection, and click Assign group.

  2. Check health of manager: in Deployment → Status, choose the Scanning Detection scenario and press Run health check.

  3. 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.

  1. (Optional) If DECIPHER is configured, open Flowintel in browser.

Expected outcome

  1. .env exists in the controller with the required variables set.

  2. 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 .venv directory is created under the RADAR root.

  3. Two items to verify:

    • (a) The command completes with === SUCCESS in 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.

  1. A ready-to-run command of the form sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,scanning_detection is printed.

  2. The command completes with === SUCCESS === in its output.

  3. On the Wazuh Dashboard, open Agents management → Summary. The agent should be assigned group scanning_detection.

  4. No FAIL lines should be present in the health check.

  5. Three items to verify:

    • (a) scanning_detection.py is copied and runs on the agent host without error. It pauses after each case for confirmation — answer y for 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 present rule IDs.

    • (c) For cases with an absent expectation, cross-check wazuh-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 100830 is 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 a confirm_* case), Scenario details (the scanning-specific scan_src_ip/uri/http_method/user_agent extracted from those events, not the generic IOCs line above it), CTI score (T), CTI labels, and Identified scanners.

  6. (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's Components line (score, tier, anomaly/signature/CTI sub-components); an iocs section plus, for scanning_detection, an extras section (scan_src_ip/uri/http_method/user_agent) matching the email's Scenario details; misp_events.

    • (c) The description also contains the elements misp_events and identified_scanners, either carrying information or an empty value.

    • (d) If the value for misp_events is a non-empty list, the CTI score (T) is non-zero.

Cleanup

  1. After finishing tests, clean up using Deployment → Teardown in the GUI.

  2. 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

  1. On the controller host, prepare .env:
cd radar
cp env.example .env

Edit it with the values described in Preconditions (see TST-055).

  1. 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>.

  1. 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.

  2. In the GUI, go to Deployment → Agent Management (default Onboard agent sub-tab). Select scenario log_volume, click Mint token, and copy the printed bootstrap-agent.sh command.

  3. Copy the whole radar-agent folder 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-name argument (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
  1. In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario log_volume, and click Assign group.

  2. On controller host, adjust the agent name agent_name under ingest variables ingest of log_volume part in radar/config.yaml. The agent name should be the same as the agent name represented in Wazuh Dashboard.

  3. In the GUI, go to Deployment → Anomaly Detector (card: Run Anomaly Detector), choose Log Volume Growth, check the ingest option, and press Run.

  4. Check health of manager: in Deployment → Status, choose the Log Volume Growth scenario and press Run health check.

  5. 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.

  1. (Optional) If DECIPHER is configured, open Flowintel in browser.

Expected outcome

  1. .env exists in the controller with the required variables set.

  2. 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 .venv directory is created under the RADAR root.

  3. Two items to verify:

    • (a) The command completes with === SUCCESS in its output.

    • (b) On the manager side (i.e. server node), confirm the index template was applied. Load OS_URL, OS_USER and OS_PASS from .env first, 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.

  1. A ready-to-run command of the form sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,log_volume is printed.

  2. The command completes with === SUCCESS === in its output.

  3. On the Wazuh Dashboard, open Agents management → Summary. The agent should be assigned group log_volume.

  4. N/A

  5. 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.

  1. No FAIL lines should be present in the health check.

  2. Three items to verify:

    • (a) log_volume.py is 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.

  3. (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

  1. After finishing tests, clean up using Deployment → Teardown in the GUI.

  2. 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

Test steps

  1. 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.

  1. On the Wazuh Dashboard, open Agents management → Summary and note the agent's current group membership before making any changes.

  2. In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select scenario 'Log Volume Growth', and click Unenroll from groups.

  3. On the Wazuh Dashboard, open Agents management → Summary again and check the agent's group membership.

  4. 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.

  5. In the GUI, go to Deployment → Scenario Management, open the Undeploy scenario sub-tab, select scenario 'Log Volume Growth', and click Undeploy.

  6. In the GUI, open Deployment → Status, select scenario 'Log Volume Growth', and click Run health check.

  7. On the manager host, confirm directly that the scenario's ossec.conf block is gone:

docker exec wazuh.manager grep -c "RADAR: log_volume" /var/ossec/etc/ossec.conf
  1. On the Wazuh Dashboard, open Agents management → Summary once more and check the agent's group membership.

  2. In the GUI, go to Deployment → Agent Management, open the Deregister agent sub-tab, enter the agent's name, and click Deregister agent.

  3. On the Wazuh Dashboard, open Agents management → Summary and check whether the agent is still listed.

Expected outcome

  1. The GUI is reachable in a browser, with Scenario Management, Agent Management, Group Management, and Status tabs all present under Deployment.

  2. The agent shows both the default and log_volume groups.

  3. The streamed output ends with a JSON result and a success line, of the form:

=== SUCCESS: group unassignment for 'log_volume' completed ===
  1. The agent now shows only the default group — log_volume has been removed, and default is untouched.

  2. 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.

  1. The streamed output ends with:
=== SUCCESS: undo for 'log_volume' completed ===

with no error key present in either printed result.

  1. Two items to verify:
  • (a) The four wazuh-* daemon checks, and the OpenSearch/Webhook checks at the bottom, all still report OK.
  • (b) The log_volume checks for active-response wiring, group configuration, the three decoder/rule files, and the agents assigned to the scenario's group now report FAIL.
  1. The command returns 0.

  2. The agent shows only the default group.

  3. The streamed output ends with JSON result followed by success message:

=== SUCCESS: deregistration for '<agent-name>' completed ===
  1. The agent no longer appears in the agents list at all.

Cleanup

  1. After finishing tests, clean up using the Teardown tab in the GUI.

  2. 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

  1. On the controller host, prepare .env pointing it at the existing Wazuh stack's addresses.

  2. Start the GUI:

./radar.sh gui
  1. In the GUI, go to Infrastructure. Register the existing stack's components with their real container names:

    • Manager: host address, port 55000, scheme https, container name matching docker ps on the Wazuh host (e.g. <project>-wazuh.manager-1).
    • Indexer: host address, port 9200, scheme https, its real container name (e.g. <project>-wazuh.indexer-1).
    • Dashboard: host address, port 443, scheme https, its real container name.
  2. On the Infrastructure page, use Test link to check reachability between the components.

  3. On the Wazuh host, confirm volumes.yml has 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).

  1. In the GUI, go to Deployment → Scenario Management, select the scenario under test, and click Deploy. If prompted for the sudo password, enter it.

  2. In the GUI, go to Deployment → Agent Management. Select the same scenario, click Mint token, and copy the printed bootstrap-agent.sh command.

  3. Copy the whole radar-agent folder 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
  1. In the GUI, go to Deployment → Group Management. Enter the agent's IP/name, select the scenario under test, and click Assign group.

  2. 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:

    • suspicious_login → TST-055, steps 7-8.
    • geoip_detection → TST-056, steps 7-9.
    • scanning_detection → TST-057, steps 7-9.
    • log_volume → TST-058, steps 7-11.

Expected outcome

  1. .env exists in the controller with the required variables set, pointing at the existing Wazuh stack.

  2. The GUI is reachable in a browser.

  3. 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.

  1. Test link reports components are reachable.

  2. volumes.yml has a complete entry for the manager's container name; none of the six required container paths are missing.

  3. The Deploy command completes with === SUCCESS in its output.

  4. A ready-to-run bootstrap-agent.sh command is printed, carrying the group(s) for the scenario under test.

  5. The command completes with === SUCCESS === in its output.

  6. On the Wazuh Dashboard, open Agents management → Summary. The agent is assigned the scenario's group(s).

  7. 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 FAIL lines 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

  1. 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.yml for the manager.

  2. 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
  1. 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_utilization scenario is not deployed on the manager, and the agent host has no Wazuh agent installed.

Test steps

  1. On the controller host, prepare .env:
cd radar
cp env.example .env

Edit it with the values described in the preconditions of TST-055.

  1. 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>.

  1. 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.

  2. In the GUI, go to Deployment → Agent Management → Onboard agent. Select scenario Linux Resource Utilization, click Mint token, and copy the printed bootstrap-agent.sh command.

  3. Copy the whole radar-agent folder 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.

  1. 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.

  2. 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
  1. In the GUI, go to Deployment → Anomaly Detector → Run Anomaly Detector, choose Linux Resource Utilization, check the ingest option box, and press Run.

  2. 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")
  1. Check the health of the manager: in Deployment → Status, choose the Linux Resource Utilization scenario and press Run health check.

  2. Run the steps in Cleanup.

Cleanup

  1. In the GUI, bring down and remove the Wazuh stack from Deployment → Teardown.

  2. 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-utilization prints nothing
  • /usr/local/bin/radar-linux-resource-utilization-metric.sh no longer exists
  • dpkg -l wazuh-agent reports nothing.

Expected outcome

  1. .env exists on the controller with the required variables set.

  2. The GUI is reachable in a browser, and the Deployment page shows the Scenario Management, Agent Management, Group Management, and Anomaly Detector tabs.

  3. Linux Resource Utilization is listed in the scenario dropbox lists and is indicated as "not deployed". The streamed output completes with === SUCCESS and no [ERROR] line.

  4. A ready-to-run command of the form sudo ./bootstrap-agent.sh --manager <address> --token <token> --group default,linux_resource_utilization is printed.

  5. The command completes with === SUCCESS ===, and its output contains OK - installed and started radar-linux-resource-utilization.timer. On the Wazuh Dashboard, Agents management → Summary shows the agent in group linux_resource_utilization.

  6. On the Wazuh Dashboard, Agents management → Summary shows the agent in group linux_resource_utilization.

  7. The timer radar-linux-resource-utilization.timer is listed, and the log shows lines of the form <timestamp> <hostname> resource_usage_metric: cpu=<cpu_pct> mem=<mem_pct>, about 30 seconds apart.

  8. The streamed output shows Done and contains the messages [+] Created detector 'LINUX_RESOURCE_UTILIZATION_DETECTOR' and [✓] Started detector. The "Output" screen does not show any errors.

  9. count is greater than 0.

  10. No FAIL line is present, and all checks report OK.

  11. 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-ng at 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.

  1. From the root of the project, copy the simulation script and the radar-agent folder (which holds bootstrap-agent.sh and uninstall-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
  1. 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}'
  1. On the controller host, set baseline_cpu_pct and baseline_mem_pct in the ingest part of the linux_resource_utilization section of radar/config.yaml to the printed averages. The other ingest values stay as they are.

  2. On the controller host, prepare .env and start the GUI of RADAR as in steps 1-2 of TST-061.

Assumptions

  1. The baseline values in config.yaml have been set according to the agent's host normal usage metrics, as described in the Setup section.
  2. Nothing runs on the agent's host other than the operating system, the Wazuh agent and the stress script.
  3. Installing the agent causes a short CPU spike, which the detector may report as an anomaly.
  4. 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:

  1. An anomaly with cpu_usage_max ≥ 80% is reported.
  2. That anomaly has anomaly_grade ≥ 0.8 and confidence ≥ 0.3.

In addition, the expected outcome of step 5 holds in the first run.

Test steps

  1. 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 printed bootstrap-agent.sh command on the agent host from inside ~/radar-agent.
  2. On the agent's host, start generating CPU stress (target CPU load 90%):

./linux_resource_utilization.sh --mode=cpu
  1. 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 to config.yaml during the setup; the sample simulates logs received every 30 seconds during 240 minutes.

  2. On the Wazuh dashboard, open Explore → Anomaly Detection → Detectors → LINUX_RESOURCE_UTILIZATION_DETECTOR. Wait up to 5 minutes, then record the anomaly_grade and confidence of the reported anomaly, along with the expected and observed values of the cpu_usage_max.

  3. 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.
  4. Run the steps in Cleanup.

Cleanup

  1. Bring down and remove the Wazuh stack from the GUI, using Deployment → Teardown.

  2. 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-utilization prints nothing
  • /usr/local/bin/radar-linux-resource-utilization-metric.sh no longer exists
  • dpkg -l wazuh-agent reports nothing.

Expected outcome

  1. Not checked in this test. If deployment or onboarding fails, the run is not counted: fix the setup and repeat TST-061.

  2. The script runs without error, printing the CPU and memory lines and then linux_resource_utilization simulation completed. Load released.

  3. The streamed output shows Done and contains the messages [+] Created detector 'LINUX_RESOURCE_UTILIZATION_DETECTOR' and [✓] Started detector. The "Output" screen does not show any errors.

  4. Within 5 minutes, an anomaly meeting the Acceptance criteria is visible on the LINUX_RESOURCE_UTILIZATION_DETECTOR page of the Anomaly Detection dashboard of Wazuh.

  5. 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 computed risk_score of 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 utilization is 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.

  6. 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

  1. RADAR test dependencies installed (pytest, responses, pyyaml).

Test steps

  1. From the repository root, run the RADAR suite: radar/tests/run-tests.sh or 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

  1. Fusion is off unless a scenario enables it and has anomaly and signature rules with non-zero w_ad and w_sig. In the shipped ar.yaml only suspicious_login enables it, and no other shipped scenario queries the indexer for a counterpart.
  2. 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.
  3. 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.
  4. 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.
  5. A failing fusion lookup leaves the decision to proceed on the alert's own score; a match is reported in the decision's extras.
  6. An anomaly alert yields no firewall-drop or lock_user_linux.sh target; lock_user_linux.sh targets only the users named in the alert, never context users. Hybrid alerts get their anomaly scores.
  7. With the shipped calibration, geoip_detection rules 100900/100901/100903 reach T2 and 100902 stays T1; a suspicious_login signature alert alone keeps the tier it had with tier2_max 0.66, and reaches T3 only with a fused anomaly.

radar/tests/py/test_radar_ar_fusion.py radar/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

  1. RADAR test dependencies installed (pytest, responses, flask, pyyaml).
  2. RADAR's radar/anomaly_detector is importable as anomaly_detector: run-tests.sh sets this up. In an environment where another anomaly_detector package is installed (for example the SONAR dependency group), run the RADAR suite from an environment without it.

Test steps

  1. From the repository root, run: radar/tests/run-tests.sh

Expected outcome

  1. The monitor query returns up to monitor_max_entities results whose grade and confidence are both above their thresholds. Its message template renders to valid JSON carrying the top hit's keys (including dataStart/dataEnd) and an anomalies list with one entry per hit.
  2. 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.
  3. The webhook writes one line per entity, keeping the highest-graded hit, appends data_start/data_end in ISO UTC only when both are usable, still writes one line for a body without anomalies, skips invalid entries, and rejects a body whose entries are all invalid. Injection attempts in any field are rejected.
  4. All copies of 0001-ad-common.xml are identical, and both of its opensearch_ad_detector regexes match the line the webhook writes.
  5. 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 uses if_sid.
  6. The body built by inject_ad_alert.py is accepted by the webhook and produces a line for rule 210040.

radar/tests/py/test_monitor.py radar/tests/py/test_ad_alerts_webhook.py radar/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_login deployed (rules, decoders including 0001-ad-common.xml, active response), its off-hours monitors and detector created (./radar.sh run suspicious_login), and the agent bootstrapped with the suspicious_login group.
  • The webhook running and reachable from the manager host (http://127.0.0.1:8080/notify by default), WEBHOOK_SHARED_SECRET set in radar/.env.
  • suspicious_login.py and inject_ad_alert.py copied from radar/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

  1. Anomaly first: on the manager host run python3 inject_ad_alert.py (entity test01). Within 30 minutes, on the agent run sudo python3 suspicious_login.py burst.
  2. 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 run python3 inject_ad_alert.py.
  3. Wait at least 30 minutes. Other user: set entity to test02 in inject_ad_alert.py's CONFIG, run it, then on the agent run sudo python3 suspicious_login.py burst (user test01).
  4. For each step, inspect /var/ossec/logs/active-responses.log on the manager, the email, and (if DECIPHER is configured) the Flowintel case.

Expected outcome

  1. Rule 210040 fires for test01 and its decision runs. The 210013 decision then logs Fusion: counterpart matched with counterpart: ad and 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.
  2. The 210040 decision logs Fusion: counterpart matched with counterpart: signature and a 210013 alert ID. It dispatches no firewall-drop and no lock_user_linux.sh (no source IP or Linux user in an anomaly alert), whatever its tier.
  3. The 210013 decision logs Fusion: no counterpart in window and its risk score equals the single-alert score.
  4. In steps 1 and 2, the email's scenario details and the case show the fusion match (alert ID, rule, gap, weight). Any mitigation of the 210013 decision targets only that alert's source IP and user test01.

Cleanup

  1. Restore entity: "test01" in inject_ad_alert.py.
  2. If a mitigation ran, remove the firewall block and unlock test01 on the agent.

radar/radar-test-framework/simulate/scenarios/inject_ad_alert.py radar/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_volume and linux_resource_utilization both deployed on the same manager, their detectors and monitors created, and an agent in both groups (optionally suspicious_login deployed as well).

Test data: log_volume and linux_resource_utilization simulations (inject mode for linux_resource_utilization)

Test steps

  1. 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 with OpenSearchAD LinuxResourceUtilization-Anomaly-Detected: entity="<agent>", … and once with OpenSearchAD LogVolume-Growth-Detected: entity="<agent>", ….
  2. Run the linux_resource_utilization simulation in inject mode on the agent, then the log_volume simulation, as in their own test specifications.
  3. Inspect the alerts in the Wazuh dashboard and /var/ossec/logs/active-responses.log.

Expected outcome

  1. 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_volume is deployed).
  2. Both simulations raise their trigger rule.
  3. Both scenarios' active responses run and identify their own scenario (linux_resource_utilization for 100321, log_volume for 100309).

radar/scenarios/rules/log_volume/a1-log-volume.xml radar/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 in radar/.env).

Test steps

  1. From radar/, run tests/run-tests.sh, or only PYTHONPATH=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.
  2. From radar/anomaly_detector/, run poetry run python off_hours.py validate --config ../config.yaml.
  3. From radar/, run poetry run python radar-test-framework/checks/off_hours_simulate.py --env .env.

Expected outcome

  1. 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_count and schedule_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.
  2. The command logs valid with the rule-mode and model-mode groups.
  3. The script prints PASS for every case and ends with [ok]: the Painless pipeline and the Python implementation agree on the deployed cluster.

radar/tests/py/test_off_hours.py radar/tests/py/test_suspicious_login_ingest.py radar/tests/py/fixtures/off_hours_cases.yaml radar/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_login deployed with ./radar.sh run suspicious_login, the webhook running, and an agent bootstrapped with the suspicious_login group.
  • For step 2, a test account on the agent listed in scenarios.suspicious_login.off_hours.users under a rule-mode group whose hours exclude the current time, deployed again after the change, and with no off-hours event in the last quiet_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

  1. From radar/, run poetry run python radar-test-framework/checks/off_hours_rule_e2e.py --env .env.
  2. Log in to the agent over SSH as the test account. After delay_minutes plus up to one interval_minutes, run off_hours.py status --mode rule (see the manual, Off-hours activity).
  3. Log in again within quiet_minutes and wait one more interval.
  4. Run docker exec wazuh.manager grep '"id":"210041"' /var/ossec/logs/alerts/alerts.json | tail -2 on the manager host and inspect /var/ossec/logs/active-responses.log.

Expected outcome

  1. The script prints PASS for: - one report for test_off_user with count 1 and group test_always_off; - none for test_on_user, whose event is flagged 0; - no second report one interval later; - a new report after the quiet period; - bob reported 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

  1. Remove the test account from scenarios.suspicious_login.off_hours.users and redeploy.

radar/radar-test-framework/checks/off_hours_rule_e2e.py radar/anomaly_detector/off_hours.py radar/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 true completed with the shipped configuration: synthetic history written and marked, SUSPICIOUS_LOGIN_OFF_HOURS_DETECTOR created 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

  1. From radar/, run poetry 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.
  2. Run ./radar.sh run suspicious_login a second time, then list the detectors and monitors in Anomaly Detection and Alerting.

Expected outcome

  1. The script prints: - PASS for 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); - PASS for 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.py radar/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_login scenario, and for step 6 also geoip_detection, as in TST-043, with MAXMIND_LICENSE_KEY set in radar/.env so that deployment downloads the GeoLite2 City and ASN databases.
  • A Linux endpoint onboarded into the groups default, suspicious_login and radar_shared (plus geoip_detection for step 6), with the simulation scripts of radar/radar-test-framework/simulate/scenarios/ copied to it.

Test steps

  1. From the repository root, run the enrichment unit tests: poetry run pytest radar/tests/py/test_manager_enrichment.py -v They also run as part of the whole RADAR suite, radar/tests/run-tests.sh.
  2. From the repository root, check that no GeoIP database is under version control: git ls-files | grep -i '\.mmdb$'
  3. On the controller host, from radar/, run the health check: ./radar.sh health --scenario suspicious_login
  4. On the endpoint, write the SSH cases of the suspicious_login simulation, 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
  5. 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
  6. With geoip_detection deployed, 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
  7. Read the enrichment error log: docker exec wazuh.manager cat /var/ossec/logs/radar/enrichment_errors.log

Expected outcome

  1. 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 sshd lines 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 of 0310-ssh.xml, which the tests reproduce.
  2. The command prints nothing (exit status 1): no .mmdb file is tracked.
  3. The health check reports OK for the integration files, both GeoLite2 databases and maxminddb, OK or, before any login has been enriched, WARN for user_state.sqlite3, and OK - enrichment_errors.log empty/absent.
  4. Each simulated SSH line appears in enriched_auth.log followed by a RADAR outcome='…' asn='…' … country='…' … geo_velocity_kmh='…' country_change_i='…' asn_novelty_i='…' tail; for the travel case the second and third logins have country_change_i='1' and a velocity above 900 km/h, and for benign the second login has no country change. The corresponding rules of SRS-051 fire on the enriched lines.
  5. With the City database missing, the health check reports FAIL for GeoLite2-City.mmdb; after restoring it, OK again.
  6. The web_ip line appears in enriched_web_access.log with a RADAR country="…" region="…" city="…" lat="…" lon="…" tail; the web_private line is not enriched.
  7. 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.py radar/radar_deploy/manager-health.sh radar/radar-test-framework/simulate/scenarios/suspicious_login.py radar/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/.env exists and the user can run sudo. A deployed scenario is not needed except for step 9.
  • Back up radar/scenarios/active_responses/ar.yaml and radar/.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, set GUI=http://127.0.0.1:5000, TOKEN=<token part of ./radar.sh gui-url> and J='Content-Type: application/json'. Every curl after step 3 uses the cookie jar: curl -s -b jar -c jar ....

Test steps

  1. From radar/, run: PYTHONPATH=anomaly_detector:. poetry run pytest tests/py/test_gui_ar_config.py -v
  2. Host allowlist: curl -s -w ' %{http_code}\n' -H 'Host: evil.example:5000' "$GUI/api/scenarios".
  3. Login token: request $GUI/api/scenarios without a cookie; then $GUI/?token=wrong; then log in with curl -s -c jar -o /dev/null -w '%{http_code}\n' "$GUI/?token=$TOKEN" and inspect jar; then request $GUI/api/scenarios with the jar.
  4. CSRF checks: send -X PUT -d '{}' $GUI/api/scenarios/suspicious_login/ar-config three 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'.
  5. Scenarios: GET /api/scenarios; GET /api/scenarios/default; GET /api/scenarios/no_such_scenario; GET /api/scenarios/deploy-status.
  6. Active-response partial update: note GET /api/scenarios/suspicious_login/ar-config; PUT it with {"delta_signature_minutes": 7}; read it again. Then PUT it with {"mitigations_tier2": ["nope.sh"]}. Then POST /api/scenarios/default/bind with {}.
  7. Connectors: GET /api/connectors; POST /api/connectors/reveal with {"key": "OS_PASS"}; with {"key": "WEBHOOK_SHARED_SECRET"}; PUT /api/connectors/opensearch with {"os-url": "https://198.51.100.1:9200"}; POST /api/connectors/opensearch/test and POST /api/connectors/wazuh-api/test.
  8. Sudo session: POST /api/sudo/unlock with a wrong password, then GET /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 and GET /api/sudo/status again.
  9. Streaming and preview: POST /api/deploy/preview with {"action": "health", "scenario": "all"}; then curl -N -b jar -X POST -H "$J" -d '{"scenario": "all"}' "$GUI/api/deploy/health" and watch the output arrive; POST /api/deploy/run with {"scenario": "no_such_scenario", "ingest": false}; POST /api/deploy/mint-token with {"groups": "default"} while no sudo password is held.
  10. Logout: unlock sudo again, then POST /api/logout with {}; check the response cookies, the GUI process, and ./radar.sh gui-url.

Expected outcome

  1. All tests pass: the mitigation names offered and accepted are firewall-drop plus the catalog names; a partial PUT .../ar-config and a bind store normalised names; an unknown mitigation or a non-list value is refused with HTTP 400 and a message naming it, and leaves ar.yaml unchanged; a broken catalog is reported on the page; the GUI never writes the catalog.
  2. HTTP 403 with {"ok": false, "error": "Host 'evil.example:5000' is not allowed..."}.
  3. Without a cookie: HTTP 401 with "ok": false. Wrong token: HTTP 401 Invalid login token. (plain text, as / is a page). Correct token: HTTP 302, and the jar holds radar_gui_auth marked HttpOnly (#HttpOnly_ prefix). With the jar: HTTP 200 and a JSON list.
  4. HTTP 415, 403 and 403, each with "ok": false; ar.yaml unchanged.
  5. The list holds every scenario with gui_visible: true in radar/config.yaml, each with id, name, description, status, type (signature, anomaly or hybrid), rule_ids, bound, shared and, when bound, a non-empty ar_config. default is returned with bound: true. The unknown scenario gives HTTP 404 {"ok": false, "error": "not found"}. Deploy status gives {"ok": true, "active": {...}} per scenario.
  6. The first PUT returns {"ok": true}, and only delta_signature_minutes differs from the noted configuration. The unknown mitigation gives HTTP 400 naming nope.sh. Binding default gives HTTP 400.
  7. The connector list contains no secret value, and password_status tells which secrets are set. Reveal without unlocked sudo: HTTP 403 with need_sudo: true; reveal of a key outside the five secret fields: HTTP 403 key not allowed. Changing os-url without a new password: HTTP 403 with need_sudo: true, .env unchanged. Each test answers {"ok": true|false, ...} reflecting whether the service is reachable with the saved settings.
  8. Wrong password: HTTP 403 sudo rejected this password, status {"unlocked": false}. Correct password: {"ok": true}, status {"unlocked": true}, OS_PASS revealed, WEBHOOK_SHARED_SECRET still key not allowed. After two idle minutes, {"unlocked": false}.
  9. 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 a text/plain line starting with [ERROR]. Mint token without sudo: HTTP 403 with need_sudo: true before any output.
  10. {"ok": true, ...}, both cookies deleted, the GUI process exits, and gui-url reports 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, plus bats, jq and, optionally, shellcheck on the PATH. No RADAR stack, network or Docker is needed. Alternatively, radar/test.sh runs the whole RADAR suite in the radar/Dockerfile.test image, which provides these tools.
  • Manual part (steps 3 to 12):
  • A RADAR host with radar/.env, root through sudo, and log_volume deployed with sudo ./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 of radar/radar-agent/ on each, in ~/radar-agent.
  • MGR is the RADAR host address printed by radar.sh mint-token. Commands marked (host) run in radar/ on the RADAR host, (A) and (B) in ~/radar-agent on the endpoints.

Test steps

  1. 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
  2. From radar/, run: for s in bootstrap-agent uninstall-agent ar-mapping ar-dispatch collectors; do bats -p tests/bash/$s.bats; done
  3. Hardened manager (host): docker exec wazuh.manager grep -E '<use_password>|<purge>' /var/ossec/etc/ossec.conf; compare the <key> of the <cluster> block with WAZUH_CLUSTER_KEY in .env; sudo ./radar.sh enrollment status. (A): timeout 5 bash -c "</dev/tcp/$MGR/1515"; echo $?.
  4. 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.
  5. 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 run sudo ~/broken/bootstrap-agent.sh --manager $MGR --token wrong --group default; then time sudo ./bootstrap-agent.sh --manager 198.51.100.1 --token wrong --group default.
  6. No credential (B): sudo /var/ossec/bin/agent-auth -m $MGR -A b-nopass (no -P).
  7. Onboarding (host): sudo ./radar.sh mint-token default,log_volume 30. (A): run the printed bootstrap-agent.sh command, 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-a and docker exec wazuh.manager /var/ossec/bin/manage_agents -l.
  8. 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 -l again.
  9. 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.
  10. 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 with sudo ./radar.sh enrollment open --minutes 10 so that a refusal cannot come from the firewall. (B): sudo /var/ossec/bin/agent-auth -m $MGR -P <1-minute token> -A b-expired.
  11. 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.
  12. 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

  1. All tests pass. In particular: a bad token lifetime (0, 99999, 1;id, ...) is refused before any docker call; 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 action radar_ar.py can target and every script is shipped; collectors are named after real scenarios and their units and log rotation are consistent.
  2. All tests pass (the shellcheck tests 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; one agent-auth call 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.
  3. <use_password>yes</use_password> and <purge>no</purge>; the cluster key equals WAZUH_CLUSTER_KEY; status CLOSED - port 1515 is blocked; the probe fails (non-zero).
  4. After opening: status OPEN with a timer PID, probe succeeds (0). After two minutes: status CLOSED, probe fails.
  5. The invalid token fails with FAILED: enrollment rejected by manager and a next step about the token and port 1515 (the package is installed by this run). The incomplete folder fails with FAILED: ... helpers is incomplete before any change. The unreachable manager fails with a non-zero status within the agent-auth connection timeout, without a key being written.
  6. Refused; no key is issued and no agent b-nopass appears on the manager.
  7. The mint prints the bootstrap command and opens the window. The bootstrap ends with === SUCCESS ===. Dispatchers lock_user_linux.sh and terminate_service.sh are present (root:wazuh, 0750); /var/ossec/radar-agent holds the catalog and every script; wazuh-agent is held; both units are active. The health check shows endpoint-a active and in groups default and log_volume; manage_agents -l lists it once.
  8. agent-auth reports "Duplicate agent name"; endpoint-a keeps its ID and is listed once.
  9. The bootstrap ends with === SUCCESS === after reporting that the name is already registered with a local key; endpoint-a is still listed once with the same ID.
  10. The superseded token is refused. After the 1-minute token's lifetime, the journal of radar-token-revoke.service shows OK - enrollment token revoked on wazuh.manager, enrollment-token.expires is gone, and the expired token is refused.
  11. The package is removed, the service is no longer registered, and /var/lib/radar-agent holds the key (root-only). The reinstall reconnects as the same agent: same ID, groups unchanged, listed once.
  12. /var/ossec, /var/lib/radar-agent and /var/log/radar no longer exist. Deregistration reports success.

The test passes when every expected outcome is observed.

radar/tests/bash/bootstrap-agent.bats radar/tests/bash/uninstall-agent.bats radar/tests/bash/ar-mapping.bats radar/tests/bash/ar-dispatch.bats radar/tests/bash/collectors.bats radar/tests/py/test_token_revocation.py radar/tests/py/test_radar_agent_mapping.py radar/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 and log_volume deployed with sudo ./build-radar.sh log_volume. No other scenario is deployed.
  • One endpoint, endpoint-a, enrolled with bootstrap-agent.sh in groups default and log_volume and connected (TST-082).
  • WEBHOOK_URL is set in radar/.env. The user running the checks can use Docker (member of the docker group).
  • All commands run in radar/ on the RADAR host. Record each command's exit status with echo $?.

Test steps

  1. 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' and docker exec wazuh.manager /var/ossec/bin/manage_agents -l; save both outputs.
  2. Single scenario with agent: ./health-radar.sh --scenario log_volume --agent-name endpoint-a.
  3. Other scenario: ./health-radar.sh --scenario suspicious_login.
  4. All scenarios: ./health-radar.sh. Then repeat the two commands of step 1 and compare.
  5. Unknown agent: ./health-radar.sh --scenario log_volume --agent-name endpoint-a,no-such-agent.
  6. Missing scenario parts: ./radar_deploy/manager-undo-scenario.sh log_volume, then ./health-radar.sh --scenario log_volume. Redeploy with sudo ./build-radar.sh log_volume and reassign the agent: ./radar_deploy/manager-assign-agent-group.sh --scenario log_volume --agent-name endpoint-a.
  7. Expired token exception: sudo ./radar.sh mint-token default 1, then sudo systemctl stop radar-token-revoke.timer so that the revocation is missed; wait two minutes; ls .radar-state/; ./health-radar.sh --scenario log_volume; ls .radar-state/ again.
  8. No registered manager: cp infra.yaml infra.yaml.bak && printf 'components: {}\n' > infra.yaml; ./health-radar.sh --scenario log_volume; then mv infra.yaml.bak infra.yaml.
  9. GUI: in the GUI, Deployment page, Status tab, run the check for log_volume with agent endpoint-a.

Expected outcome

  1. Outputs saved.
  2. Exit status 0. The sections print in the order === MANAGER (filesystem/container) ===, === MANAGER (Wazuh API / OpenSearch / webhook) ===, === AGENTS ===, each line starting with OK, WARN, FAIL or SKIP, and no FAIL. The first section has a --- <node> --- block for each manager node in infra.yaml, includes log_volume pipeline patch present and the webhook reachability from the indexer container, and has no maxminddb or enrichment lines. The second section reports the core daemons running, log_volume active-response wiring, the log_volume group configuration, a1-log-volume.xml and its decoders, one agent assigned to all of log_volume's groups, the OpenSearch cluster status and the radar-log-volume index template. The agent section reports endpoint-a active and in default and log_volume.
  3. The first section adds the framework Python, maxminddb, enrichment file, GeoLite2, state store and error log checks and has no log_volume pipeline line. The second section reports FAIL for the suspicious_login wiring, group configuration, a3-suspicious-login.xml and the agents, and no log_volume template line. There is no agent section.
  4. Checks for every scenario in radar/config.yaml appear, including the geoip_detection whitelist_countries check; the scenarios that are not deployed report FAIL. The checksums and the agent list are identical to step 1.
  5. OK lines for endpoint-a, and FAIL - agent no-such-agent not found via API for both the status and the group check.
  6. The second section reports FAIL for the log_volume wiring, the log_volume group configuration, a1-log-volume.xml and the agents of log_volume. After redeployment, step 2 passes again.
  7. Before the check, enrollment-token.expires exists. The first section starts with WARN - enrollment token expired at ... and was still active; revoking now and OK - enrollment token revoked on wazuh.manager; afterwards the file is gone.
  8. The run stops after the first section with a non-zero exit status; no API or agent section is printed.
  9. 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.sh radar/radar_deploy/manager-health.sh radar/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 group default only (TST-082). No SSH or other access from the RADAR host to the endpoint is configured or used.
  • In a shell in radar/: export WAZUH_API_URL, WAZUH_AUTH_USER and WAZUH_AUTH_PASS with the values from .env, and define T=$(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

  1. 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
  2. Deploy one shared scenario: confs > before.txt; sudo ./build-radar.sh suspicious_login; confs > after.txt; diff before.txt after.txt.
  3. 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.
  4. 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.
  5. Repeat deploy: sudo ./build-radar.sh geoip_detection again; note the JSON result of the deploy-manager-config stage.
  6. 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.
  7. Repeat undo: ./radar_deploy/manager-undo-scenario.sh geoip_detection again.
  8. 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.
  9. Never-deployed scenario: confs; files; ./radar_deploy/manager-undo-scenario.sh scanning_detection; confs; files.

Expected outcome

  1. All tests pass. In particular: shared scenarios get default, their own group and radar_shared, others only default and their own group; deploying a shared scenario writes both its own group and radar_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 second deploy_manager_config changes 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.
  2. Only the agent.conf of suspicious_login and radar_shared differ (or are new); default and the other groups are unchanged.
  3. The assignment succeeds; groups lists default, suspicious_login and radar_shared. The endpoint's merged agent.conf contains /var/log/auth.log (count of at least 1), although nothing connected to the endpoint.
  4. Only geoip_detection changes (radar_shared already carries the same snippet). groups adds geoip_detection. 0310-ssh.xml, 0375-web-accesslog.xml and a2-geoip-detection.xml are present.
  5. The build completes without error, and the deploy-manager-config result reports no changed file or block and "restart_triggered": false.
  6. Only the agent.conf of geoip_detection changes (reset to an empty <agent_config>). groups no longer lists geoip_detection but still lists default, suspicious_login and radar_shared. a2-geoip-detection.xml and 0375-web-accesslog.xml are gone; 0310-ssh.xml, still used by suspicious_login, is present. The suspicious_login block is still in ossec.conf (count 1), and the health check reports no FAIL.
  7. Completes without error and without a manager restart.
  8. groups lists only default. a3-suspicious-login.xml and 0310-ssh.xml are gone. rules/radar_rules.xml (the default rules) is present. The radar_shared group has no member any more; its agent.conf is left in place and therefore reaches no agent.
  9. Completes without error, and nothing on the manager changes (confs and files as after step 8).

The test passes when every expected outcome is observed.

radar/tests/py/test_scenario_ops.py radar/tests/py/test_ruleset.py radar/tests/py/test_manager_config.py radar/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

  1. SONAR dependencies installed: poetry install --with adbox,radar,test.
  2. sonar/scenarios/linux_resource_monitoring.yaml is present with debug.enabled: false (the --debug CLI flag is used instead).
  3. 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

  1. 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

  2. Verify the training log line Fitting MVAD on ... reports more than zero gradient steps, that training completes, and that a model directory is persisted under sonar/models/ with the name matching the model_name field in the scenario YAML (linux_resource_monitoring).

  3. 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

  4. 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).

  5. 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.

  6. Verify that the derived features count the matching alerts per bucket: is_cpu_high counts alerts with cpu_usage_% ≥ 80, is_memory_high alerts with memory_usage_% ≥ 80, and is_high_load alerts with 1min_loadAverage ≥ 4.0.

Expected outcome

  1. Training performs more than zero gradient steps and completes without error; a model directory named linux_resource_monitoring is persisted to disk.
  2. Detection completes without error.
  3. Anomalies are flagged inside each of the three attack windows.
  4. Every reported anomaly is part of a run of at least four consecutive anomalous 1-minute buckets.
  5. Derived features is_cpu_high, is_memory_high, and is_high_load hold 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

  1. SONAR dependencies installed: poetry install --with adbox,radar,test. The real MVAD library (time-series-anomaly-detector 0.4.0) is installed.

Test steps

  1. From the repository root, run the training pre-flight unit tests: poetry run pytest tests/sonartests/test_engine_and_features.py -k "Engine" -v
  2. Run the tests against the real MVAD library: poetry run pytest tests/sonartests/test_engine_real_mvad.py -v
  3. 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

  1. Training on 288 buckets with the default window fails with InsufficientTrainingDataError, names the required bucket count (1725), never calls the library's fit, and leaves no model.
  2. For each tested dataset size, the predicted number of optimiser updates equals the number of Adam.step calls the library performs, including the case of zero updates.
  3. A trained model's network parameters differ from the library's initialisation, and the saved model records gradient_steps greater than zero, which survives saving and loading.
  4. An unknown training parameter such as learning_rate is rejected with a hint to use lr.
  5. No library checkpoint is written to the working directory, and two training runs use different checkpoint directories.
  6. The library defaults and configuration fields that SONAR copies match the installed library.

tests/sonartests/test_engine_real_mvad.py tests/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

  1. SONAR dependencies installed: poetry install --with adbox,radar,test.

Test steps

  1. From the repository root, run: poetry run pytest tests/sonartests/test_features_v2.py -v

Expected outcome

  1. One failed login and two hundred failed logins in a bucket give alert_count, is_auth_failure and category counts of 1 and 200.
  2. 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.
  3. 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.
  4. A category unseen in training is counted in <field>__other at detection, with columns identical to training.
  5. 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

  1. SONAR dependencies installed: poetry install --with adbox,radar,test.

Test steps

  1. 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

  1. 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.
  2. 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.
  3. 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.
  4. 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 detect with and without a scenario uses the same detection path.
  5. 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.py tests/sonartests/test_wazuh_and_pipeline.py tests/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

  1. SONAR dependencies installed: poetry install --with adbox,radar,test.

Test steps

  1. From the repository root, run: poetry run pytest tests/sonartests/test_realtime_delivery.py tests/sonartests/test_detection_cli.py -v

Expected outcome

  1. 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.
  2. The watermark file survives a new process, never moves back, is separate per scenario, and an unreadable file is treated as no watermark.
  3. Two polls over the same data deliver each anomaly once, and a restart delivers nothing again.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. A bucket that ended less than the ingest delay ago is not scored.

tests/sonartests/test_realtime_delivery.py tests/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

  1. SONAR dependencies installed: poetry install --with adbox,radar,test.

Test steps

  1. 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

  1. The SONAR event is one line of valid JSON with integration: sonar, anomaly_grade, anomaly_confidence (0.5 when the scenario sets none) and the sonar object (scenario, model, bucket start, severity, band, score, contributors); NaN values become null; the bands follow the configured boundaries.
  2. 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.
  3. The API transport authenticates once, sends at most 100 events per request to POST /events with the bearer token and the configured CA bundle, re-authenticates on 401, waits on 429 (honouring Retry-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.
  4. 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's integration value and the band rules its sonar.severity_band values; the rule group is the one alert searches exclude.
  5. Alert searches exclude the sonar rule group by default, and not when the exclusion list is empty.
  6. Sink selection: wazuh by default with watermarks; --ship adds the data stream; debug uses the debug sinks without watermarks; --print-payloads adds standard output; a dry run writes a JSON-lines file and ignores the watermarks; unknown sinks, fallbacks and transports are rejected; an index sink is refused in debug mode; an unset anomaly_confidence is warned about; the output section is read from YAML, nested sections included.
  7. 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.
  8. sonar wazuh install-rules uploads the rules file with PUT /rules/files/sonar_rules.xml?overwrite=true as the given user, restarts the manager with --restart, and exits with 1 when the API refuses.
  9. 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 no rule block.
  10. A debug detection run prints SONAR events on standard output.

tests/sonartests/test_sinks.py tests/sonartests/test_realtime_delivery.py tests/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.yml with radar/volumes.yml) on the controller host, with the indexer at https://localhost:9200 and the server API at https://localhost:55000.
  • Indexer credentials (admin and $OS_PASS) and an API administrator ($WAZUH_AUTH_USER, $WAZUH_AUTH_PASS, by default wazuh-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-agent reports no such unit).

Setup

  1. On the controller, create sonar-lab.yaml at 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
  2. Create the shared directory and let the manager read it, then add the <localfile> block of sonar/wazuh/ossec-localfile.xml to /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 YAML Recreate the manager with the overlay added to the compose files used for the stack (-f /tmp/sonar-manager.yml).
  3. 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
  4. 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

  1. Manager host, file transport. On the controller run: bash poetry run sonar detect --scenario sonar/scenarios/linux_resource_monitoring.yaml --config sonar-lab.yaml --debug then, 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"}}}]}}}'
  2. Dedicated host, api transport. On the dedicated host, copy sonar-lab.yaml, set output.wazuh.transport: api, api_url: https://<controller>:55000, api_username: sonar and wazuh.base_url to the controller's indexer, export SONAR_WAZUH_API_PASSWORD with the sonar user'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.name and full_log if present.
  3. 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: false deploy it with RADAR's usual procedure, repeat step 1, and inspect /var/ossec/logs/active-responses.log on the manager.
  4. 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 the Fetched N of M matching alerts line of the detection log with the count, which excludes SONAR alerts.

Cleanup

  1. Remove the <localfile> block, the overlay and /srv/sonar/anomalies; delete sonar_rules.xml (DELETE /rules/files/sonar_rules.xml) and the sonar API user, role and policy; restore ar.yaml; restart the manager.

Expected outcome

  1. Step 1 returns alerts of rule 100503 with data.anomaly_grade and data.anomaly_confidence numeric and data.sonar.scenario = resource_monitoring, within the period of the injected attacks (data.sonar.bucket_start).
  2. 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 location and decoder.name show how API events are decoded (expected: decoded as JSON).
  3. Step 3: active-responses.log shows RADAR handling a sonar_anomaly alert with the alert's grade and confidence, and no mitigation is executed.
  4. Step 4: the number of matching alerts M equals the count that excludes the sonar rule 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

  1. SONAR dependencies installed: poetry install --with sonar,test.
  2. Poetry available on the path, to build the wheel.

Test steps

  1. 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

  1. $SONAR_HOME decides 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 without model_name uses its name; the default scenario ID is the model name.
  2. No module of the sonar package outside its test-data scripts contains a ./ path literal or calls getcwd/cwd.
  3. 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 holds metadata.json with the backend name and columns, no pickle, and no leftover staging directory.
  4. The ewma backend 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.
  5. The pca backend 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.
  6. The mvad backend reproduces the timestamps, verdicts, severities and scores recorded in tests/assets/sonar_mvad_regression.json before the backend interface existed, and its weights load as plain tensors with weights_only=True.
  7. 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 .env files; its sonar package, run from a temporary directory with SONAR_HOME set, trains and detects on the packaged linux_resource_monitoring scenario in debug mode and writes SONAR events to the jsonl sink, without touching the repository.

tests/sonartests/test_paths.py tests/sonartests/test_backends.py tests/sonartests/test_packaging.py tests/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

  1. SONAR dependencies installed: poetry install --with sonar,test.

Test steps

  1. From the repository root, run: poetry run pytest tests/sonartests/test_evaluation.py -v
  2. Generate the labelled splits with generate_resource_data.py --evaluation and generate_attack_data.py --evaluation, and run sonar evaluate with calibration for each bundled scenario and each backend (mvad, pca, ewma), as listed in docs/specs/trp/assets/sonar-evaluation/README.md.

Expected outcome

  1. 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.
  2. Threshold and minimum run length select reported buckets with the same rule as detection.
  3. 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.
  4. Calibration picks the least filtering that reaches the best F1 within the false-alarm budget, and reports when no setting stays within it.
  5. Label files round-trip and invalid ones are refused; OpenSearch anomaly detection results (including a _search response with failed intervals) and generic JSON-lines records load as detections.
  6. sonar evaluate writes 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 the ewma backend it trains, scores the test file and detects the labelled spike.
  7. 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.
  8. 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.py docs/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

  1. SONAR dependencies installed: poetry install --with sonar,test (the tests import torch).

Test steps

  1. From the repository root, run: poetry run pytest tests/sonartests/test_e2e_detection.py -v

Expected outcome

  1. A model trained on normal data, with the real MVAD library and with the pca backend, 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.
  2. Realtime polling with the real model over overlapping detection windows, delivering to the jsonl sink with a watermark, writes at least one anomaly and no anomaly_id twice, also after a restart.

tests/sonartests/test_e2e_detection.py tests/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

  1. SONAR dependencies installed: poetry install --with sonar,test.

Test steps

  1. From the repository root, run: poetry run pytest tests/sonartests/test_radar_alignment.py -v

Expected outcome

  1. The packaged scenario reads wazuh-archives-*, requests only timestamp, data.cpu_usage_pct and data.mem_usage_pct, filters on data.mem_usage_pct without radar_seed documents, uses one-minute buckets with zero fill, and builds the mean and maximum of both metrics from string values.
  2. With an agent, the agent.name term joins the event filter, the model name and scenario identifier carry the agent, local data is filtered by agent, and a debug run with the pca backend trains and detects that agent's model without a feature-settings warning, storing the agent filter in the model.
  3. RADAR's detector results are read through every scroll page with a nested entity filter for the agent, the scroll is cleared also when a page fails, and the result count is capped.
  4. 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

  1. SONAR dependencies installed: poetry install --with sonar,test.
  2. 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_after paging and point-in-time deletion, or with mocks.

Test steps

  1. From the repository root, run the indexer client tests: poetry run pytest tests/sonartests/test_indexer_client.py -v
  2. 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

  1. All 22 tests of step 1 and the 3 selected tests of step 2 pass.
  2. 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 on wazuh-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.
  3. Query contract: the query has the timestamp range with gte start and lt end as filter, the alert filter as must (no must without one), the sort on timestamp then id, the point-in-time, and counts the matches on the first page only.
  4. Cap: with max_alerts 15,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 and max_alerts.
  5. Declared fields (TestRequiredSourceFields): a search with source_fields requests exactly those fields and returns no other; the feature builder lists timestamp, 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 the alert_filter.
  6. Own alerts excluded: by default the query excludes the rule group sonar (must_not), which is the group of SONAR's Wazuh rules; with exclude_rule_groups: [] the query has no must_not.
  7. One connection (TestOneConnection): verify_ssl false, true and 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.
  8. Writes (TestIndexAnomaly, TestJsonSafe): an anomaly is created under its anomaly_id with 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 as False.

tests/sonartests/test_indexer_client.py tests/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

  1. A repository checkout; all commands run from its root.
  2. Docker 23 or later, whose default builder is BuildKit (docker buildx version succeeds). The build downloads the python:3.10.12 base image and the Python packages, so it needs network access to Docker Hub and PyPI; no Wazuh deployment is needed.
  3. No image or container named sonar:v0.8 / sonar-container that must be kept. Step 9 retrains the host's sonar/models/linux_resource_monitoring model, replacing an existing one; the host's sonar/models/ must be writable by uid 1000 (the image's user), and the step needs an interactive terminal (sonar/sonar.sh runs docker run -it).

Test steps

Inspection

  1. Show the build instructions: grep -nE '^(FROM|USER|COPY|RUN|ENTRYPOINT|CMD)' sonar/Dockerfile.sonar.
  2. Show the build-context rules: grep -vE '^\s*(#|$)' sonar/Dockerfile.sonar.dockerignore.
  3. Show the mounts: grep -n -- '-v \|_VOLUME=' sonar/sonar.sh and grep -nA14 '^ sonar:' sonar/wazuh/docker-compose.sonar.yml.

Build and examination

  1. 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
  2. Build the image: docker build -f sonar/Dockerfile.sonar -t sonar:v0.8 .
  3. 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__ \)'
  4. List the installed packages: docker run --rm --entrypoint poetry sonar:v0.8 run pip list --format=freeze.
  5. Show the user, entry point and command: docker image inspect sonar:v0.8 --format '{{.Config.User}} {{.Config.Entrypoint}} {{.Config.Cmd}}', then run docker run --rm sonar:v0.8; echo "exit $?".
  6. Run a debug scenario through the wrapper script: sonar/sonar.sh scenario --use-case sonar/scenarios/linux_resource_monitoring.yaml --debug, then ls 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

  1. Step 1: the base image is python:3.10.12; a user is created and USER ${user} (with ENV user=alab) precedes the installs; the only COPY sources are pyproject.toml poetry.lock README.md, sonar and adbox/__init__.py (no COPY .); the installs are poetry install --only main,sonar --no-root and poetry install --only-root; the entry point is ["poetry", "run", "sonar"] and the command ["--help"].
  2. Step 2: the first rule is *; the only re-included paths are pyproject.toml, poetry.lock, README.md, sonar and adbox/__init__.py; **/.env, **/*.pkl, sonar/payloads, sonar/models/state, **/__pycache__ and **/.DS_Store are excluded.
  3. Step 3: sonar/sonar.sh mounts sonar/models, sonar/test_data, sonar/scenarios and sonar/default_config.yaml at the same paths under /home/alab/soar/sonar/, and ${SONAR_ANOMALIES_DIR:-/srv/sonar/anomalies} at /var/log/sonar; the compose service sonar mounts the anomaly directory, sonar/models, sonar/scenarios and sonar/default_config.yaml (read-only).
  4. Step 5: the build succeeds.
  5. Step 6: /home/alab/soar lists exactly README.md, adbox, poetry.lock, pyproject.toml and sonar; adbox holds only __init__.py; the find command prints nothing, so none of the canaries is in the image.
  6. Step 7: the list contains time-series-anomaly-detector==0.4.0, torch==2.3.0, opensearch-py==3.0.0 and pandas==2.2.2, and none of tabulate, more-itertools, ansible-core, selenium, scapy, faker, geoip2, pytest-cov, pytest-mock, doorstop.
  7. 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.
  8. Step 9: training and detection complete with exit status 0, any reported anomaly is printed as a SONAR event on standard output, and metadata.json and the backend's state files of the trained model appear in the host's sonar/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