Send events to Wazuh
Wazuh has no HTTP collector like Splunk HEC. The supported route without installing
an agent is its remote syslog, and Wazuh parses native JSON with its json
decoder: that way every field of the event is indexed (data.evento.origen.ip,
data.evento.accion, data.trampa.id…) without taking a CEF line apart.
There are three steps: the output in the console, the manager's remote syslog and a small set of rules so that events generate alerts.
1) The output in the console (Sugardaddy)
Create a Syslog output with:
- Format: JSON.
- Transport: unencrypted TCP (Wazuh's remote syslog is TCP/UDP inside your network; it does not do TLS by itself).
- Server / Port: the Wazuh manager's IP and the port you open (514 in the example).
- Syslog header: RFC 3164.
Each event goes out as <PRI>date host {…json…}: Wazuh strips the syslog header
and its json decoder parses the object.
2) The manager's remote syslog (/var/ossec/etc/ossec.conf)
<remote>
<connection>syslog</connection>
<port>514</port>
<protocol>tcp</protocol>
<!-- Only from the Sugardaddy node: -->
<allowed-ips>NODE_IP</allowed-ips>
</remote>
Restart the manager (systemctl restart wazuh-manager). To check that events
arrive before writing rules, you can enable <logall_json>yes</logall_json>
in <global> and look at /var/ossec/logs/archives/archives.json.
3) Rules (/var/ossec/etc/rules/local_rules.xml)
<group name="sugardaddy,">
<!-- Base: recognizes our events by the "integracion" field. Level 0: it does not alert by itself. -->
<rule id="100100" level="0">
<decoded_as>json</decoded_as>
<field name="integracion">^sugardaddy$</field>
<description>Sugardaddy: honeypot message</description>
</rule>
<!-- An event from a decoy: medium alert. -->
<rule id="100101" level="7">
<if_sid>100100</if_sid>
<field name="clase">^evento$</field>
<description>Sugardaddy: $(evento.accion) from $(evento.origen.ip) on decoy $(trampa.id)</description>
<group>sugardaddy,honeypot,</group>
</rule>
<!-- If the event is critical, raise the level. -->
<rule id="100102" level="12">
<if_sid>100101</if_sid>
<field name="severidad">^critica$</field>
<description>Sugardaddy: CRITICAL event from $(evento.origen.ip) on $(trampa.id)</description>
<group>sugardaddy,honeypot,</group>
</rule>
<!-- Health alerts (sensor/decoy down, queue full…). -->
<rule id="100103" level="5">
<if_sid>100100</if_sid>
<field name="clase">^aviso$</field>
<description>Sugardaddy: alert $(codigo) — $(texto)</description>
<group>sugardaddy,</group>
</rule>
</group>
Restart the manager and the alerts will appear in alerts.json and in the Wazuh
dashboard with all the event's fields under data.*. Adjust the levels to
your liking; anyone who touches a decoy is, by definition, suspicious.