Skip to content

Wazuh

Wazuh is an open-source security platform (SIEM and XDR) with agents on your hosts and an indexer for their alerts.

  • What DRACO uses: Alerts of the indexer (and optional archived events); agent names of the manager API.
  • What for: Detections, hunts and the ID directory on agent alerts, active response on agents (commands the organization allows).

Add it in Connectors > Add connector: pick Wazuh, then choose what DRACO collects and what it may change. Add more later with Add a part on its connector page. See Connectors for how connectors, sign-in and tags work.

Parts

Part What DRACO uses Access Permissions
Logs Wazuh read An internal user mapped to a role with cluster_composite_ops_ro and read on wazuh-alerts-4.x-*.
Directory Wazuh read Optional: a manager API user mapped to the agents_readonly role (port 55000) for agent names.
Response Run active response (Wazuh) write A Wazuh API user (separate from the read-only user of agent names) whose role has a policy with the actions active-response:command and agent:read on the resource agent:id:* (or only the agents' ids or groups); the commands must be defined on the manager (ossec.conf )

Requirements

  • Wazuh 4.x with the Wazuh indexer (alerts are indexed in wazuh-alerts-4.x-*).
  • An administrator of the Wazuh dashboard to create the users.
  • Network access from DRACO to the indexer (port 9200) and, for agent names and active response, to the manager API (port 55000), over HTTPS. Plain http:// is accepted only for a private address (10.x, 172.16-31.x, 192.168.x) or an internal host name. A private address or internal host name is reachable only when your DRACO operator has enabled access to private networks for data sources (on-premise installations); otherwise use a public HTTPS endpoint.

Logs

The Wazuh data source (wazuh_alerts) pulls the alerts of Wazuh 4.x from the Wazuh indexer: rule id, level, description, groups and MITRE ATT&CK mapping, agent, source and destination addresses and users, the full log. Optionally it reads the agent inventory of the Wazuh manager API to name agents in the ID directory, and the archived events (wazuh-archives-4.x-*).

Wazuh has no case management, so there is no incident connector for it: Wazuh alerts become DRACO alerts and incidents through DRACO's own detection rules (see Built-in rules), like any other log source.

Setup in Wazuh

Indexer user (alerts)

  1. In the Wazuh dashboard open Indexer management > Dev Tools and create a read-only role:

    PUT _plugins/_security/api/roles/draco_reader
    {
      "cluster_permissions": ["cluster_composite_ops_ro"],
      "index_permissions": [
        {
          "index_patterns": ["wazuh-alerts-4.x-*"],
          "allowed_actions": ["read"]
        }
      ]
    }
    

    The same can be done in Indexer management > Security > Roles > Create role. Add wazuh-archives-4.x-* to index_patterns if you collect archived events. 2. Indexer management > Security > Internal users > Create internal user: draco with a long password. 3. Roles > draco_reader > Mapped users > Manage mapping: map the user draco.

Manager API user (agent names, optional)

  1. Server management > Dev Tools: create a server API user with the same name and password as the indexer user, so one credential covers both: POST /security/users with {"username": "draco", "password": "<the indexer user's password>"}. Note the id in the answer.
  2. Find the built-in role agents_readonly (GET /security/roles?search=agents_readonly) and give it to the user directly: POST /security/users/<user id>/roles?role_ids=<role id>. It allows agent:read and group:read. Do not use Roles mapping: it applies to dashboard sign-ins, never to server API users.

Certificates

Wazuh installs self-signed certificates. Paste the root CA in DRACO (CA certificate(s)): the indexer's /etc/wazuh-indexer/certs/root-ca.pem, followed by the manager API certificate (/var/ossec/api/configuration/ssl/server.crt) if it is self-signed. For a private address you can instead turn off Verify the TLS certificates; for a public address the check stays on.

Add the source in DRACO

  1. Connectors > Add connector, pick Wazuh and tick Logs under Collectors (or Add a part on the Wazuh connector you already have). The wizard repeats the steps above.
  2. Enter the Wazuh indexer URL (https://<indexer>:9200), and optionally the manager API URL (https://<manager>:55000) and the Wazuh dashboard URL (for links to the alerts).
  3. Lowest rule level collected: 3 by default (Wazuh writes level 3 and above to the alerts index). Raise it to reduce volume.
  4. Credential:

    • a Basic credential with the indexer user (draco), when the manager API user has the same name and password; or
    • a Generic JSON credential with both users:

      {"indexer_username": "draco", "indexer_password": "...", "api_username": "draco-api", "api_password": "..."}
      
  5. Test: DRACO reads the alerts of the last 24 hours (and the archived events when they are on) and, with a manager API URL, signs in to the API and reads the agents. A refused server API is shown as a warning: the alerts can be saved first. The source is created only after a passing test.

What DRACO collects

Event Columns
Alert (action alert.<rule id>) class Detection Finding, severity from the rule level (0-2 informational, 3-6 low, 7-11 medium, 12-14 high, 15 critical), host the agent name, actor_user the user of the event (data.dstuser, data.srcuser, Windows target or subject user), src_ip data.srcip (else the agent address), dst_ip data.dstip, resource_uid the agent (<manager>/<agent id>), url the alert in the Wazuh dashboard, message "High Wazuh alert "" on ()"
Archived event (optional, action log.<rule id>) the same columns, class API Activity

The whole alert stays in the fields: rule.id, rule.level, rule.groups, rule.mitre, agent.*, data.*, decoder.name, location, full_log. DRACO adds xdr: kind, vendor_id, severity, rule_id, rule_level, rule_groups, agent_uid, tactics and techniques (ATT&CK ids).

Latency and cost

  • Polls every 5 minutes. Alerts are read by timestamp, the time the manager analysed the event, with a 15-minute overlap for alerts that Filebeat delivers to the indexer late; alerts already stored are skipped. An alert indexed more than 15 minutes after its time, for example after a longer indexer outage, is not read.
  • Up to 5,000 alerts per run (Alerts per run); a busier window continues on the next run right after the last alert read, also when thousands of alerts share one moment.
  • The agent inventory is read at most every six hours. A failure there is shown as a warning and never stops the alerts.
  • Archived events (Also collect archived events, off by default) are every event the manager receives: they need <logall_json>yes</logall_json> on the manager and are a high volume that counts against your DRACO log volume and storage. Because of that volume they are read with a 2-minute overlap: an archived event indexed more than 2 minutes after its time is not read.

Built-in rules (draco-elastic-wazuh)

Rule When
Wazuh: alert of level 12 or higher (recommended) an alert with a rule level of 12 or more
Wazuh: antivirus or real-time protection disabled (recommended) an alert says real-time protection, the antimalware engine or Microsoft Defender was disabled
Wazuh: agent stopped or removed the manager reported an agent stopped (rule 506) or removed (505); off by default: shutdowns and autoscaling stop agents every day
Wazuh: rootkit or trojaned binary detected (recommended) rootcheck reported a rootkit, hidden files, ports or processes, or a trojaned binary
Wazuh: repeated brute force alerts from one address (recommended) three or more authentication failure alerts from one address within an hour
Wazuh: account added to an administrators group (recommended) Windows Administrators or Domain Admins group changed, or a Linux user added to sudo, wheel or admin
Wazuh: critical system file changed (recommended) file integrity monitoring saw passwd, shadow, sudoers, SSH keys or configuration, cron, systemd units or the hosts file change
Wazuh: event log or audit log cleared (recommended) an alert says an event log or audit log was cleared
Wazuh: many different medium alerts on one agent (recommended) five or more different rules of level 7 or higher on one agent within an hour
Wazuh: high-level alert for a privileged account an alert of level 10 or more whose user name looks privileged; off by default: account naming differs, duplicate it as a custom rule with your naming convention

The level-12 rule raises one DRACO alert per agent and Wazuh rule in an hour; the others group by agent (and file, user or address). Rules that need low-level alerts (agent stopped, file integrity) work with the default Lowest rule level collected of 3. To raise DRACO alerts for other Wazuh rules (a rule group, a lower level), write a detection rule on source_type=wazuh_alerts, for example source_type=wazuh_alerts rule.groups=authentication_failures severity_id>=3.

Hunts, dashboard and Sigma

  • Threat hunting > Library: Wazuh: brute force against agents, changes to files attackers use for persistence, agents that stopped reporting or lost protection and alert trends by level, rule and agent.
  • Dashboards > Add prebuilt > Wazuh: alerts by severity over time and by ATT&CK tactic, top agents and users, agent health (stopped, removed, disconnected) and the latest high alerts.
  • Sigma import: rules with logsource: {product: wazuh} read this source with the Wazuh names (rule.id, rule.level, data.srcip...); Sigma Windows names (CommandLine, Image, EventID, TargetUserName...) map to the data.win fields of the eventchannel decoder.

ID directory

Alerts teach the ID directory: agent → agent name (keyed <manager>/<agent id>, because agent ids such as 001 repeat across managers) and wazuh-rule-<id> → rule description. With a manager API URL, the agent inventory adds every agent with its address and operating system.

Response: active response

With the Response part of the connector, DRACO can run a Wazuh active response on agents: for example firewall-drop to block an IP, disable-account for a user, or restart-wazuh on an agent (response actions). Only the commands you list in the action settings can run. The action signs in with the connector's write access, a manager API user separate from the read-only user of agent names.

  1. In the Wazuh dashboard open Server management > Security > Policies and create a policy draco_active_response: actions active-response:command and agent:read, resource agent:id:* (or only the agent ids or groups DRACO may act on), effect allow. With the Wazuh server API instead:

    POST /security/policies
    {"name": "draco_active_response", "policy": {"actions": ["active-response:command", "agent:read"], "resources": ["agent:id:*"], "effect": "allow"}}
    
  2. Create a role draco_response with that policy (Security > Roles) and an API user draco-response (Security > Users) mapped to only that role.

  3. Check that each command you will allow is defined on the manager (<command> in ossec.conf, or a script in active-response/bin, run with the ! prefix).
  4. In DRACO create a user name and password credential for the API user and pick it as the connector's write access, with the manager API URL (https://<manager>:55000, reachable from DRACO) and its CA certificate when it is self-signed. List the Allowed commands and the Agents that act on IP and user targets.
  5. Test: DRACO reads the API user's processed policies (GET /security/users/me/policies) and runs nothing; a missing action is named.

Wazuh's reference: RBAC actions and resources (active-response:command is PUT /active-response), default active response scripts.

Troubleshooting

Last error Fix
Wazuh refused the credentials (HTTP 401) The indexer user name or password is wrong: check Internal users and rotate the credential.
... the credentials need read on wazuh-alerts-4.x-* Map the user to the draco_reader role (or add the index pattern to its role).
Agent names were not refreshed: The Wazuh manager API refused the API user Check the API user and its role mapping (agents_readonly), or use a Generic JSON credential with api_username and api_password.
must be an https:// URL Use HTTPS; plain HTTP only works for a private address or internal host name.
Wazuh request failed: SSLError Paste the root CA (and the manager API certificate).
Wazuh denied PUT /active-response (HTTP 403): it needs the RBAC action active-response:command Add active-response:command on agent:id:* (or the agents) to the response user's policy.
... is not one of the allowed commands of this action Add the command to Allowed commands in the action settings.
No agent is active to run the command The agents are disconnected or never connected; check them in the Wazuh dashboard.