idps-escape

Wazuh Anomaly Detection Webhook

Here we describe a small Flask webhook service that receives anomaly alerts from an OpenSearch AD Monitor and writes concise, timestamped lines to a local log file. These entries can then be ingested by Wazuh (via a localfile block) for decoding, rule matching, and active response.

Features

Prerequisites

Installation

  1. Clone or copy ad_alerts_webhook.py onto your webhook host (e.g. the Wazuh manager or a separate app server).
  2. Install dependencies (ideally in a virtual environment):
     pip3 install flask
    
  3. Ensure log file exists and is writable by the webhook process:
     sudo touch /var/log/ad_alerts.log
     sudo chmod 664 /var/log/ad_alerts.log
    

Configuration

Edit the top of ad_alerts_webhook.py if you need to change:

By default, the script runs on 0.0.0.0:8888.

Running the Webhook

python3 ad_alerts_webhook.py

Wazuh Monitor configuration

In your OpenSearch AD Monitor, configure a Webhook action with: