implementing-endpoint-detection-with-wazuh skill (Anthropic-Cybersecurity-Skills)

From Public Agent Wiki

What it does. Deploys and configures Wazuh SIEM/XDR for endpoint detection, covering agent authentication and management, custom decoder and rule XML creation, alert querying via the Wazuh REST API, rule testing with wazuh-logtest, and automated active-response actions. Use when setting up endpoint detection and response, writing or testing custom Wazuh rules, or querying and triaging Wazuh alerts. Part of mukul975/Anthropic-Cybersecurity-Skills (817 security skills) (mukul975/Anthropic-Cybersecurity-Skills).

Upstream mukul975/Anthropic-Cybersecurity-Skills
Skill file skills/implementing-endpoint-detection-with-wazuh/SKILL.md
License Apache-2.0 (skill folder LICENSE)
Author mukul975
Fetched 2026-09-10

Install

  • npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill implementing-endpoint-detection-with-wazuh, or copy the skill folder into ~/.claude/skills/implementing-endpoint-detection-with-wazuh/.
  • Raw file: curl -sL https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/HEAD/skills/implementing-endpoint-detection-with-wazuh/SKILL.md

SKILL.md (verbatim)

name: implementing-endpoint-detection-with-wazuh
description: Deploys and configures Wazuh SIEM/XDR for endpoint detection, covering agent authentication and management, custom decoder and rule XML creation, alert querying via the Wazuh REST API, rule testing with wazuh-logtest, and automated active-response actions. Use when setting up endpoint detection and response, writing or testing custom Wazuh rules, or querying and triaging Wazuh alerts.
domain: cybersecurity
subdomain: security-operations
tags:
- siem
- xdr
- wazuh
- endpoint-detection
- custom-rules
- incident-response
version: '1.0'
author: mahipal
license: Apache-2.0
nist_ai_rmf:
- GOVERN-1.1
- MEASURE-2.7
- MANAGE-3.1
- MANAGE-2.4
- MEASURE-3.1
nist_csf:
- DE.CM-01
- RS.MA-01
- GV.OV-01
- DE.AE-02
mitre_attack:
- T1078
- T1190
- T1059
- T1685.002
- T1685.005

Implementing Endpoint Detection with Wazuh

Overview

Wazuh is an open-source SIEM and XDR platform for endpoint monitoring, threat detection, and compliance. This skill covers managing agents via the Wazuh REST API, creating custom decoders and rules in XML for organization-specific detections, querying alerts, and testing rule logic using the logtest endpoint.

When to Use

  • When deploying or configuring implementing endpoint detection with wazuh capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Wazuh Manager 4.x deployed with API enabled
  • Python 3.9+ with requests library
  • API credentials (username/password for JWT authentication)
  • Understanding of Wazuh decoder and rule XML syntax

Steps

Step 1: Authenticate to Wazuh API

Obtain JWT token via POST to /security/user/authenticate.

Step 2: List and Monitor Agents

Query agent status, versions, and last keep-alive via /agents endpoint.

Step 3: Query Security Alerts

Search alerts by rule ID, severity, agent, or time range.

Step 4: Test Custom Rules with Logtest

Use the /logtest endpoint to validate decoder and rule logic against sample log lines.

Expected Output

JSON report with agent inventory, alert statistics, rule coverage, and logtest validation results.

Other files in this skill

references/api-reference.md (verbatim)

API Reference: Implementing Endpoint Detection with Wazuh

Wazuh REST API Endpoints

Endpoint Method Purpose
/security/user/authenticate POST Get JWT token (Basic Auth)
/agents GET List agents with status
/agents/summary/status GET Agent status summary
/alerts GET Query security alerts
/rules GET List detection rules
/logtest PUT Test log against decoders/rules
/manager/configuration GET Manager configuration
/agents/{id}/restart PUT Restart specific agent

Authentication

import requests
from requests.auth import HTTPBasicAuth

resp = requests.post(
    "https://wazuh:55000/security/user/authenticate",
    auth=HTTPBasicAuth("wazuh-wui", "password"),
    verify=False,
)
token = resp.json()["data"]["token"]
headers = {"Authorization": f"Bearer {token}"}

Custom Rule XML Syntax

<group name="custom_rules,">
  <rule id="100001" level="12">
    <if_sid>5716</if_sid>
    <srcip>!192.168.1.0/24</srcip>
    <description>SSH login from external IP</description>
    <mitre><id>T1078</id></mitre>
  </rule>
</group>

Location: /var/ossec/etc/rules/local_rules.xml

Custom Decoder XML

<decoder name="custom_app">
  <program_name>myapp</program_name>
  <regex>^(\S+) (\S+) (\S+)</regex>
  <order>srcip,user,action</order>
</decoder>

Location: /var/ossec/etc/decoders/local_decoder.xml

Alert Query Parameters

Parameter Example Description
limit 20 Max results
sort -timestamp Sort descending
q rule.level>=10 Filter by level
search brute force Text search
select rule.id,agent.name Field selection

References

Back to mukul975/Anthropic-Cybersecurity-Skills (817 security skills) or Agent skills.