<!--
  XplicitTrust Network Access - Wazuh Decoder
  Copyright (C) 2026 XplicitTrust GmbH

  Decodes syslog messages forwarded by the XplicitTrust event forwarder
  (protocol: Syslog over TLS, RFC 5424 / RFC 5425).

  The syslog message body is a JSON object with one key, "xplicittrust",
  that holds all event fields. The JSON_Decoder plugin extracts them into
  data.xplicittrust.*, apart from the fields of every other decoder.

  Fields available after decoding (always):
    data.xplicittrust.event_id, data.xplicittrust.event_class,
    data.xplicittrust.event_type, data.xplicittrust.session_type,
    data.xplicittrust.message, data.xplicittrust.created_at
  Per event (see the event reference in the documentation), all under
  data.xplicittrust.:
    remote_address, session_id, client, user, user_email, auth_type, role,
    client_name, tenant_name, object_type, object_id, object_name, reason,
    city, country, asn, asn_organization, client_version, os,
    interface_name, ip, port, severity, actor.type, actor.id, actor.name

  data.xplicittrust.event_id identifies the event; delivery is
  at-least-once, so two alerts with the same id are the same event.
  data.xplicittrust.created_at is the event time (RFC 3339, UTC,
  milliseconds); see the Wazuh page of the documentation for indexing alerts
  at that time instead of arrival time.

  Installation:
    cp xplicittrust_decoders.xml /var/ossec/etc/decoders/
    systemctl restart wazuh-manager
-->

<!-- Base decoder: match XplicitTrust syslog messages and parse JSON body -->
<decoder name="xplicittrust">
    <prematch>^xplicittrust </prematch>
    <plugin_decoder offset="after_prematch">JSON_Decoder</plugin_decoder>
</decoder>
