Hi Juan,
If i use <if_group>windows</if_group> this rule work for me.
<rule id="110005" level="5">
<if_group>windows</if_group>
<field name="win.system.providerName">Microsoft-Windows-NetworkProfile</field>
<field name="win.system.eventID">10000</field>
<field name="win.eventdata.state">1</field>
<description>Wifi connected - $(win.eventdata.name)</description>
<options>no_full_log</options>
</rule>
Log for this rule from archives.log:
{"win":{"system":{"providerName":"Microsoft-Windows-NetworkProfile","providerGuid":"{fbcfac3f-8459-419f-8e48-1f0b49cdb85e}","eventID":"20002","version":"0","level":"4","task":"0","opcode":"0","keywords":"0x4000000000000020","systemTime":"2023-02-09T10:49:13.2802731Z","eventRecordID":"6156","processID":"2560","threadID":"16928","channel":"Microsoft-Windows-NetworkProfile/Operational","computer":"DESKTOP-VDADAE5","severityValue":"INFORMATION","message":"\"NSI Set Category Result\r\n\tProfile GUID: {00c92f6a-f2b5-46f7-8904-b020b38b4c12}\r\n\tInterface GUID: {1e40ab64-ef0c-42cf-8782-1fa9c599276a}\r\n\tNetwork Category: Public\r\n\tIPv4 Error Code: 0\r\n\tIPv6 Error Code: 0\r\n\tContext: 3906\r\n\""},"eventdata":{"profileGuid":"{00c92f6a-f2b5-46f7-8904-b020b38b4c12}","interfaceGuid":"{1e40ab64-ef0c-42cf-8782-1fa9c599276a}","category":"0","errorCodev4":"0","errorCodev6":"0","context":"3906"}}}
2023 Feb 09 10:49:17 (DESKTOP-VDADAE5) any->EventChannel {"win":{"system":{"providerName":"Microsoft-Windows-NetworkProfile","providerGuid":"{fbcfac3f-8459-419f-8e48-1f0b49cdb85e}","eventID":"10000","version":"0","level":"4","task":"0","opcode":"0","keywords":"0x4000200000000020","systemTime":"2023-02-09T10:49:13.2814429Z","eventRecordID":"6157","processID":"2560","threadID":"16928","channel":"Microsoft-Windows-NetworkProfile/Operational","computer":"DESKTOP-VDADAE5","severityValue":"INFORMATION","message":"\"Network Connected\r\n\tName: TEST\r\n\tDesc: TEST\r\n\tType: Unmanaged\r\n\tState: Connected\r\n\tCategory: Public\r\n\""},"eventdata":{"name":"TEST","description":"TEST","guid":"{00c92f6a-f2b5-46f7-8904-b020b38b4c12}","type":"0","state":"1","category":"0"}}}
Log for this rule from archives.json:
{"timestamp":"2023-02-09T10:49:17.476+0000","agent":{"id":"010","name":"DESKTOP-VDADAE5","ip":"192.168.15.186"},"manager":{"name":"wazuh.manager"},"id":"1675939757.22786688","full_log":"{\"win\":{\"system\":{\"providerName\":\"Microsoft-Windows-NetworkProfile\",\"providerGuid\":\"{fbcfac3f-8459-419f-8e48-1f0b49cdb85e}\",\"eventID\":\"10000\",\"version\":\"0\",\"level\":\"4\",\"task\":\"0\",\"opcode\":\"0\",\"keywords\":\"0x4000200000000020\",\"systemTime\":\"2023-02-09T10:49:13.2814429Z\",\"eventRecordID\":\"6157\",\"processID\":\"2560\",\"threadID\":\"16928\",\"channel\":\"Microsoft-Windows-NetworkProfile/Operational\",\"computer\":\"DESKTOP-VDADAE5\",\"severityValue\":\"INFORMATION\",\"message\":\"\\\"Network Connected\\r\\n\\tName: TEST\\r\\n\\tDesc: TEST\\r\\n\\tType: Unmanaged\\r\\n\\tState: Connected\\r\\n\\tCategory: Public\\r\\n\\\"\"},\"eventdata\":{\"name\":\"TEST\",\"description\":\"TEST\",\"guid\":\"{00c92f6a-f2b5-46f7-8904-b020b38b4c12}\",\"type\":\"0\",\"state\":\"1\",\"category\":\"0\"}}}","decoder":{"name":"windows_eventchannel"},"data":{"win":{"system":{"providerName":"Microsoft-Windows-NetworkProfile","providerGuid":"{fbcfac3f-8459-419f-8e48-1f0b49cdb85e}","eventID":"10000","version":"0","level":"4","task":"0","opcode":"0","keywords":"0x4000200000000020","systemTime":"2023-02-09T10:49:13.2814429Z","eventRecordID":"6157","processID":"2560","threadID":"16928","channel":"Microsoft-Windows-NetworkProfile/Operational","computer":"DESKTOP-VDADAE5","severityValue":"INFORMATION","message":"\"Network Connected\r\n\tName: TEST\r\n\tDesc: TEST\r\n\tType: Unmanaged\r\n\tState: Connected\r\n\tCategory: Public\r\n\""},"eventdata":{"name":"TEST","description":"TEST","guid":"{00c92f6a-f2b5-46f7-8904-b020b38b4c12}","type":"0","state":"1","category":"0"}}},"location":"EventChannel"}
Alert on my dashboard:
My full log alert for event:
{"timestamp":"2023-02-09T10:29:56.712+0000","rule":{"level":5,"description":"Wifi connected - TEST","id":"110005","firedtimes":4,"mail":false,"groups":["wifi"]},"agent":{"id":"010","name":"DESKTOP-VDADAE5","ip":"192.168.15.186"},"manager":{"name":"wazuh.manager"},"id":"1675938596.22531586","full_log":"{\"win\":{\"system\":{\"providerName\":\"Microsoft-Windows-NetworkProfile\",\"providerGuid\":\"{fbcfac3f-8459-419f-8e48-1f0b49cdb85e}\",\"eventID\":\"10000\",\"version\":\"0\",\"level\":\"4\",\"task\":\"0\",\"opcode\":\"0\",\"keywords\":\"0x4000200000000020\",\"systemTime\":\"2023-02-09T10:29:48.0428549Z\",\"eventRecordID\":\"6109\",\"processID\":\"2560\",\"threadID\":\"12332\",\"channel\":\"Microsoft-Windows-NetworkProfile/Operational\",\"computer\":\"DESKTOP-VDADAE5\",\"severityValue\":\"INFORMATION\",\"message\":\"\\\"Network Connected\\r\\n\\tName: TEST\\r\\n\\tDesc: TETS\\r\\n\\tType: Unmanaged\\r\\n\\tState: Connected\\r\\n\\tCategory: Public\\r\\n\\\"\"},\"eventdata\":{\"name\":\"TETS\",\"description\":\"TEST\",\"guid\":\"{00c92f6a-f2b5-46f7-8904-b020b38b4c12}\",\"type\":\"0\",\"state\":\"1\",\"category\":\"0\"}}}","decoder":{"name":"windows_eventchannel"},"data":{"win":{"system":{"providerName":"Microsoft-Windows-NetworkProfile","providerGuid":"{fbcfac3f-8459-419f-8e48-1f0b49cdb85e}","eventID":"10000","version":"0","level":"4","task":"0","opcode":"0","keywords":"0x4000200000000020","systemTime":"2023-02-09T10:29:48.0428549Z","eventRecordID":"6109","processID":"2560","threadID":"12332","channel":"Microsoft-Windows-NetworkProfile/Operational","computer":"DESKTOP-VDADAE5","severityValue":"INFORMATION","message":"\"Network Connected\r\n\tName: TEST\r\n\tDesc: TEST\r\n\tType: Unmanaged\r\n\tState: Connected\r\n\tCategory: Public\r\n\""},"eventdata":{"name":"TEST","description":"TEST","guid":"{00c92f6a-f2b5-46f7-8904-b020b38b4c12}","type":"0","state":"1","category":"0"}}},"location":"EventChannel"}
Why when i use <if_sid>60000</if_sid> or <decoded_as>windows_evenchannel</decoded_as> not work with rule and how can i create rule for windows_eventchannel log?
I only create custom rule for windows and almost logsource come from Event Viewer with Eventchannel format.
Best Regards,