Skip to content

Wazuh Executor

Category: Endpoint Security Script: wazuh.py Integration: REST API Faraday Plugin: Raw JSON Website: https://wazuh.com/

Description

Imports vulnerability findings from a Wazuh manager into Faraday. The executor reads the active Wazuh agents and their detected package vulnerabilities through the Wazuh REST API, and creates one host per agent with one vulnerability per finding.

Prerequisites

  • A Wazuh manager with the vulnerability detector enabled
  • A Wazuh API user with permission to authenticate, list agents and read vulnerability data
  • Network access from the agent to the Wazuh API (port 55000 by default)

Configuration

Environment Variables (Setup)

Variable Required Description
WAZUH_URL Yes Wazuh API URL (e.g., https://wazuh.example.com:55000)
WAZUH_USERNAME Yes Wazuh API username
WAZUH_PASSWORD Yes Wazuh API password

Execution Arguments

Parameter Type Mandatory Description
WAZUH_AGENT_IDS list No Wazuh agent IDs to import (e.g., ["001", "002"]; 000 is the manager itself). Default: all active agents.
WAZUH_MIN_SEVERITY string No Severity passed to the Wazuh API as the severity filter: Low, Medium, High or Critical
WAZUH_VERIFY_SSL boolean No Verify the Wazuh API's TLS certificate (default: true)

YAML Configuration Example

executors:
  wazuh:
    repo_executor: wazuh.py
    max_size: 65536
    varenvs:
      WAZUH_URL: "https://wazuh.example.com:55000"
      WAZUH_USERNAME: "<username>"
      WAZUH_PASSWORD: "<password>"
    params:
      WAZUH_AGENT_IDS:
        mandatory: false
        type: list
        base: list
      WAZUH_MIN_SEVERITY:
        mandatory: false
        type: string
        base: string
      WAZUH_VERIFY_SSL:
        mandatory: false
        type: boolean
        base: boolean

How It Works

  1. Authenticates at {WAZUH_URL}/security/user/authenticate with basic auth and gets a bearer token
  2. Lists active agents from /agents (500 per page), limited to WAZUH_AGENT_IDS when set
  3. For each agent, reads its findings from /vulnerability/{agent_id}, filtered by WAZUH_MIN_SEVERITY when set
  4. Creates one host per agent (IP, name and OS) and maps each finding to a vulnerability:
    • Name: the CVE ID, or the finding title when there is no CVE
    • Description: affected package and version, architecture, condition and detection time
    • Severity: Critical, High, Medium, Low map directly, Negligible becomes info and anything else becomes unclassified
    • Resolution: the solution reported by Wazuh
    • Data: CVSS2/CVSS3 scores and status

Notes

  • Only agents with status active are imported.
  • At most 500 findings are read per agent.
  • Agents that return 404 for the vulnerability endpoint are imported without vulnerabilities. Any other API error stops the run.
  • When an agent has no IP address, its agent ID is used as the host IP.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor. Use WAZUH_MIN_SEVERITY to filter by severity.