Hello Team,
I am running Wazuh 4.3, and I am trying to ingest PowerShell logs. I have enabled the localfile analysis in the endpoint agent configuration like so:
<localfile>
<location>Microsoft-Windows-PowerShell/Operational</location>
<log_format>eventchannel</log_format>
</localfile>
And I have added the following local rules to /var/ossec/etc/rules/local_rules.xml (I have also tried the values 91802 and 60000 for <if_sid>).
<group name="windows-custom,">
<rule id="100535" level="5">
<if_sid>91801</if_sid>
<field name="win.system.providerName">^Microsoft-Windows-PowerShell/Operational$</field>
<group>powershell,</group>
<description>Powershell Information EventLog</description>
</rule>
<rule id="100536" level="7">
<if_sid>91801</if_sid>
<field name="win.system.providerName">^Microsoft-Windows-PowerShell/Operational$</field>
<group>powershell,</group>
<description>Powershell Warning EventLog</description>
</rule>
<rule id="100537" level="10">
<if_sid>91801</if_sid>
<field name="win.system.providerName">^Microsoft-Windows-PowerShell/Operational$</field>
<field name="win.system.severityValue">^ERROR$</field>
<group>powershell,</group>
<description>Powershell Error EventLog</description>
</rule>
<rule id="100538" level="13">
<if_sid>91801</if_sid>
<field name="win.system.providerName">^Microsoft-Windows-PowerShell/Operational$</field>
<group>powershell,</group>
<description>Powershell Critical EventLog</description>
</rule>
<rule id="100539" level="12">
<if_sid>91801</if_sid>
<category>ossec</category>
<decoded_as>windows_eventchannel</decoded_as>
<field name="win.system.severityValue">^VERBOSE$</field>
<field name="win.system.eventID">^4104$</field>
<options>no_full_log</options>
<description>PowerShell CommandLine: $(win.eventdata.scriptBlockText)</description>
</rule>
<rule id="100540" level="0">
<if_sid>100539</if_sid>
<category>ossec</category>
<decoded_as>windows_eventchannel</decoded_as>
<field name="win.eventdata.scriptBlockText">^prompt$</field>
<options>no_full_log</options>
<description>Group of Windows PowerShell rules</description>
</rule>
</group>
I see the event in Windows Event viewer, but not in the dashboard. I have also checked
/var/ossec/logs/archives/archives.json for event 4104, but there are none. I have been using this thread as a guide but still with no results.
https://github.com/wazuh/wazuh/issues/10712.
Any guidance you can give is most appreciated, thank you!
Jennifer A.