<!--
  Windows event channels.
  Goes between the <ossec_config> tags of
  C:\Program Files (x86)\ossec-agent\ossec.conf, or inside <agent_config>
  in a Windows group's shared agent.conf.

  Verified on Wazuh 5.0.0-beta5, Windows 11 Pro build 26200: the installer
  already writes four <localfile> blocks, so DO NOT add these on top without
  reading what is there first.

    Application                             eventchannel
    Security                                eventchannel, with a shipped
        exclusion query for EventID 5145 5156 5447 4656 4658 4663 4660
        4670 4690 4703 4907 5152 5157
    System                                  eventchannel
    active-response\active-responses.log    syslog

  So the Security channel is already filtered out of the box, and active
  response results are already collected on Windows (they are not on Linux).
  The blocks below ADD channels and narrower views; edit the shipped Security
  block rather than duplicating it if you only want to change the query.

  When a script appends any of this, insert before the LAST </ossec_config>.
  The shipped Windows file ends with a trailing comment after that tag, so a
  pattern anchored on the end of the file matches nothing and the edit is
  silently skipped.

  ignore and restrict do not apply to eventchannel; filter with <query>
  in XPath instead.

  Once indexed, there are NO winlog.* fields. The event ID is event.code (a
  string), the channel is event.dataset (security | system | application),
  and the raw XML is event.original.

  References:
  https://documentation.wazuh.com/5.0-beta/user-manual/reference/ossec-conf/localfile.html
  https://documentation.wazuh.com/5.0-beta/user-manual/capabilities/log-data-collection/configuring-log-collection/configuration.html
-->

<!-- Security channel, dropping two chatty file-share event IDs.
     reconnect_time controls retries when the Event Log service is down. -->
<localfile>
  <location>Security</location>
  <log_format>eventchannel</log_format>
  <only-future-events>yes</only-future-events>
  <query>Event/System[EventID != 5145 and EventID != 5156]</query>
  <reconnect_time>10s</reconnect_time>
</localfile>

<!-- Interactive and RDP logons only, using EventData predicates. -->
<localfile>
  <location>Security</location>
  <log_format>eventchannel</log_format>
  <query>Event[System/EventID = 4624 and (EventData/Data[@Name='LogonType'] = 2 or EventData/Data[@Name='LogonType'] = 10)]</query>
</localfile>

<!-- PowerShell operational channel. -->
<localfile>
  <location>Microsoft-Windows-PowerShell/Operational</location>
  <log_format>eventchannel</log_format>
</localfile>

<!-- Defender operational channel. -->
<localfile>
  <location>Microsoft-Windows-Windows Defender/Operational</location>
  <log_format>eventchannel</log_format>
</localfile>

<!-- Host firewall. -->
<localfile>
  <location>Microsoft-Windows-Windows Firewall With Advanced Security/Firewall</location>
  <log_format>eventchannel</log_format>
</localfile>
