There is a decoder that isn't quite handling some log entries the want I need. I want to augment an existing decoder, but apparently I'm not doing this correctly. Here's an example log entry: 2017 Jul 03 11:17:37 WinEvtLog: Security: AUDIT_FAILURE(5152): Microsoft-Windows-Security-Auditing: (no user): no domain: workstation: The Windows Filtering Platform blocked a packet. Application Information: Process ID: 0 Application Name: - Network Information: Direction: %%14592 Source Address: 1.2.3.4 Source Port: 143 Destination Address: 5.6.7.8 Destination Port: 2619 Protocol: 6 Filter Information: Filter Run-Time ID: 93069 Layer Name: %%14597 Layer Run-Time ID: 13
Using this as a guild: http://ossec-docs.readthedocs.io/en/latest/manual/rules-decoders/create-custom.html I've created a new decoder that inherits from this existing one: <decoder name="windows"> <type>windows</type> <prematch>^\d\d\d\d \w\w\w \d\d \d\d:\d\d:\d\d WinEvtLog: |^WinEvtLog: </prematch> <regex offset="after_prematch">^\.+: (\w+)\((\d+)\): (\.+): </regex> <regex>(\.+): \.+: (\S+): </regex> <order>status, id, extra_data, user, system_name</order> <fts>name, location, user, system_name</fts> </decoder> I've tried an number of different versions of this -- below was my last attempt: <decoder name="windows-filtering-platform"> <parent>windows</parent> <prematch offset="after_parent">The Windows Filtering Platform</prematch> <regex offset="after_parent">^\.+: (\w+)\((\d+)\): (\.+): </regex> <regex>(\.+): \.+: (\S+): Thee Windows Filtering Platform</regex> <regex>Source Address: (\S+) Source Port: (\d+) Destination Address: (\S+) Destination Port: (\d+)</regex> <order>status, id, extra_data, user, system_name, srcip, srcport, dstip, dstport</order> </decoder> All I'm trying to do is match for the source and destination information that's in these particular log entries. However, when I added my decoder, it "took over" for all the windows decoder matches instead of just for the log entries I was hoping to match against -- any log entry that contained "The Windows Filtering Platform." On top of that, my decoder's regex doesn't seem to be matching any of the fields -- phase 2 just states: **Phase 2: Completed decoding. decoder: 'windows' instead of at least: **Phase 2: Completed decoding. decoder: 'windows' status: 'AUDIT_FAILURE' id: '5152' extra_data: 'Microsoft-Windows-Security-Auditing' dstuser: '(no user)' system_name: 'workstation' How far off the rails am I in achieving the solution I'm looking for? -- --- You received this message because you are subscribed to the Google Groups "ossec-list" group. To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.