Hello,
I am attempting to implement monitoring and alerting of AppLocker. I can get these log entries to be sent from agents to the manager. However, they do not appear to be decoded correctly. What steps do I need to take to get these EventChannel events to pass decoding?
AppLocker uses Windows EventChannel and logs Event IDs 8000 to 8027 per the following documentation:
I have configured my agents to include the following logs and restarted the agents:
<localfile>
<location>Microsoft-Windows-AppLocker/EXE and DLL</location>
<log_format>eventchannel</log_format>
</localfile>
<localfile>
<location>Microsoft-Windows-AppLocker/MSI and Script</location>
<log_format>eventchannel</log_format>
</localfile>
<localfile>
<location>Microsoft-Windows-AppLocker/Packaged app-Deployment</location>
<log_format>eventchannel</log_format>
</localfile>
<localfile>
<location>Microsoft-Windows-AppLocker/Packaged app-Execution</location>
<log_format>eventchannel</log_format>
</localfile>
I have enabled <logall>yes</logall> and set <log_alert_level>1</log_alert_level> in the manager ossec.conf and confirmed that archive logs are getting created for Event ID 8002. See example entry.
2021 Jun 23 13:39:58 (server) any->EventChannel {"win":{"system":{"providerName":"Microsoft-Windows-AppLocker","providerGuid":"{CBDA4DBF-8D5D-4F69-9578-BE14AA540D22}","eventID":"8002","version":"0","level":"4","task":"0","opcode":"0","keywords":"0x8000000000000000","systemTime":"2021-06-23T20:39:57.448162900Z","eventRecordID":"16691","processID":"15356","threadID":"7800","channel":"Microsoft-Windows-AppLocker/EXE and DLL","computer":"
server.fqdn.com","severityValue":"INFORMATION","message":"\"%SYSTEM32%\\WINTYPES.DLL was allowed to run.\""},"ruleAndFileData":{"policyNameLength":"3","policyName":"DLL","ruleId":"{BAC4B0BF-6F1B-40E8-8627-8545FA89C8B6}","ruleNameLength":"37","ruleName":"(Default Rule) Microsoft Windows DLLs","ruleSddlLength":"57","ruleSddl":"D:(XA;;FX;;;S-1-1-0;(APPID://PATH Contains \\\"%WINDIR%\\\\*\\\"))","targetUser":"S-1-5-21-1724543075-3879649918-2838239325-7215","targetProcessId":"15356","filePathLength":"23","filePath":"%SYSTEM32%\\\\WINTYPES.DLL","fileHashLength":"32","fileHash":"F19F0A69963FE9F1DB0A0A2639D99178AD539C7E70ABF52EF9B20B0D4EDEB361","fqbnLength":"120","fqbn":"O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\\\MICROSOFT® WINDOWS® OPERATING SYSTEM\\\\WINTYPES.DLL\\\\10.0.14393.4467","targetLogonId":"0x155d95b8"}}}
I have added the following to my local_rules.xml config:
<rule id="100000" level="5">
<if_sid>60600,60601,60602</if_sid>
<field name="win.system.eventID">^8002$</field>
<description>AppLocker Audit</description>
</rule>
<rule id="100010" level="10">
<if_sid>60600,60601,60602</if_sid>
<field name="win.system.eventID">^8003$|^8006$</field>
<description>AppLocker Audit Warning</description>
<options>alert_by_email</options>
</rule>
<rule id="100020" level="10">
<if_sid>60600,60601,60602</if_sid>
<field name="win.system.eventID">^8004$|^8007$</field>
<description>AppLocker Block</description>
<options>alert_by_email</options>
</rule>
However, Wazuh does not apparently decode these EventChannel logs correctly. I see no matching alerts in alerts.log. Also, the wazuh-logtest binary tells me that no decoder is matched:
Starting wazuh-logtest v4.1.5
Type one log per line
2021 Jun 23 13:39:58 (server) any->EventChannel {"win":{"system":{"providerName":"Microsoft-Windows-AppLocker","providerGuid":"{CBDA4DBF-8D5D-4F69-9578-BE14AA540D22}","eventID":"8002","version":"0","level":"4","task":"0","opcode":"0","keywords":"0x8000000000000000","systemTime":"2021-06-23T20:39:57.448162900Z","eventRecordID":"16691","processID":"15356","threadID":"7800","channel":"Microsoft-Windows-AppLocker/EXE and DLL","computer":"
server.fqdn.com","severityValue":"INFORMATION","message":"\"%SYSTEM32%\\WINTYPES.DLL was allowed to run.\""},"ruleAndFileData":{"policyNameLength":"3","policyName":"DLL","ruleId":"{BAC4B0BF-6F1B-40E8-8627-8545FA89C8B6}","ruleNameLength":"37","ruleName":"(Default Rule) Microsoft Windows DLLs","ruleSddlLength":"57","ruleSddl":"D:(XA;;FX;;;S-1-1-0;(APPID://PATH Contains \\\"%WINDIR%\\\\*\\\"))","targetUser":"S-1-5-21-1724543075-3879649918-2838239325-7215","targetProcessId":"15356","filePathLength":"23","filePath":"%SYSTEM32%\\\\WINTYPES.DLL","fileHashLength":"32","fileHash":"F19F0A69963FE9F1DB0A0A2639D99178AD539C7E70ABF52EF9B20B0D4EDEB361","fqbnLength":"120","fqbn":"O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\\\MICROSOFT® WINDOWS® OPERATING SYSTEM\\\\WINTYPES.DLL\\\\10.0.14393.4467","targetLogonId":"0x155d95b8"}}}
**Phase 1: Completed pre-decoding.
full event: '2021 Jun 23 13:39:58 (server) any->EventChannel {"win":{"system":{"providerName":"Microsoft-Windows-AppLocker","providerGuid":"{CBDA4DBF-8D5D-4F69-9578-BE14AA540D22}","eventID":"8002","version":"0","level":"4","task":"0","opcode":"0","keywords":"0x8000000000000000","systemTime":"2021-06-23T20:39:57.448162900Z","eventRecordID":"16691","processID":"15356","threadID":"7800","channel":"Microsoft-Windows-AppLocker/EXE and DLL","computer":"
server.fqdn.com","severityValue":"INFORMATION","message":"\"%SYSTEM32%\\WINTYPES.DLL was allowed to run.\""},"ruleAndFileData":{"policyNameLength":"3","policyName":"DLL","ruleId":"{BAC4B0BF-6F1B-40E8-8627-8545FA89C8B6}","ruleNameLength":"37","ruleName":"(Default Rule) Microsoft Windows DLLs","ruleSddlLength":"57","ruleSddl":"D:(XA;;FX;;;S-1-1-0;(APPID://PATH Contains \\\"%WINDIR%\\\\*\\\"))","targetUser":"S-1-5-21-1724543075-3879649918-2838239325-7215","targetProcessId":"15356","filePathLength":"23","filePath":"%SYSTEM32%\\\\WINTYPES.DLL","fileHashLength":"32","fileHash":"F19F0A69963FE9F1DB0A0A2639D99178AD539C7E70ABF52EF9B20B0D4EDEB361","fqbnLength":"120","fqbn":"O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\\\MICROSOFT® WINDOWS® OPERATING SYSTEM\\\\WINTYPES.DLL\\\\10.0.14393.4467","targetLogonId":"0x155d95b8"}}}'
timestamp: '2021 Jun 23 13:39:58'
**Phase 2: Completed decoding.
No decoder matched.