Hello, the below parser xml is failing testing on 7.1, any help is much appreciated.
<eventFormatRecognizer>
<![CDATA[.*Vendor _ATTACK\s+]]>
</eventFormatRecognizer>
<parsingInstructions>
<collectFieldsByRegex src="$_rawmsg">
<regex><![CDATA[.*Vendor Name {<_body:gPatMesgBody>}]]></regex>
</collectFieldsByRegex>
<setEventAttribute attr="eventType">VendorAlert</setEventAttribute>
<collectAndSetAttrByJSON src="$_body">
<attrKeyMap attr="accountid" key="Account Id"/>
<attrKeyMap attr="VendorAttackModule" key="Attack Module"/>
</collectAndSetAttrByJSON>
</parsingInstructions>
Solved! Go to Solution.
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
Hi Karl,
The attached example parser worked for the full sample log you provided.
The important part of this parser is this section:
With out seeing the error message you get when you run the test or the raw event , there is not much anyone will be able to do for you here
Created on 10-09-2024 09:56 AM Edited on 10-09-2024 09:58 AM
You are right I should have been more complete in my reporting, Sadly the FortisSIEM test tool knows it failed but neglects to share why. Is there ever a time when the test tool actually tells one why it failed? This is 7.1
Created on 10-09-2024 10:39 AM Edited on 10-09-2024 10:40 AM
The means that the the event didn't match the parser so your event format recognizer didn't match. The used Parser collumn will be filled with what parser its using. one of the two below should work depending on how specific it need to match
<![CDATA[.*_ATTACK\s+]]>
<![CDATA[.*MORPHISEC_ATTACK\s+]]>
Created on 10-09-2024 10:53 AM Edited on 10-09-2024 10:55 AM
Ah ha so there is inference in that message you have decoded
so you are saying do not use
{<_body:gPatMesgBody>}
,,, ok thanks! let me try those and report back.
No using that is fine for the parser body. Your inital problem is in this block. The event message has to match something in the block to use the parser.
But as far as you parser body goes...Unless the event has the string vendor in it won't parse anyhthing or error out.
<eventFormatRecognizer>
<![CDATA[.*Vendor _ATTACK\s+]]>
</eventFormatRecognizer>
Created on 10-09-2024 11:39 AM Edited on 10-09-2024 12:10 PM
Hi,
so the first couple lines of the log show :
One additional note here, is the use of the escaped double quotes """ in my sample parser is actually optional.
<attrKeyMap attr="tenantId" key=""Account Id""/>
and
<attrKeyMap attr="tenantId" key="Account Id"/>
are treated the same if we are not using dot notation or subscript operator.
If the key has whitespace or a literal '.' dot in the key name, you need to escape the key.
Example:
{ "my.key.name" : "my value" }
Needs
<attrKeyMap attr="_tempVar" key=""my.key.name""/>
Example 2
{ "My Key Name" : [ "obj1", "obj2", "obj3" ] }
Needs this to access the second element
<attrKeyMap attr="_obj2TempVar" key=""My Key Name"[1]"/>
Created on 10-10-2024 07:08 AM Edited on 10-10-2024 07:47 AM By Stephen_G
HI Rob and thank you! Here is the full log, while I digest all that you have written :)
Do I sense that I may have to ask the vendor to try an clean up their JASON raw log? based on the comments it sounds like the raw log is not optimal.
Also I am having problems just validating small segments
I started with only adding this chunk of code but could not get it to validate
<eventFormatRecognizer>
<![CDATA[<:gPatYear>-<:gPatMon>-<:gPatDay>\s+<:gPatTime>\s+<:gPatHostName>\s+<:gPatWord>\s+Vendor_ATTACK]]>
</eventFormatRecognizer>
Error states Only one parsingInstructions tag is allowed.
2024-10-08 14:46:58 VENDOR-EPTP INFO VENDOR_ATTACK {"Account Id":"[\"0cebd16e-eba3-40a1-a2b6-88e9e20787d3\"]","Attack Module":"[\"kernel32.dll\"]","Attack Time":"[\"2024-10-08T14:46:49.769Z\"]","Code Processed":"[\"0x007ffcac8a8600 MOV RAX, RSP\"]","Command Line":"[\"C:/Users/shaned/Desktop/winwword.exe\"]","Computer Name":"[\"GWLT011-8884\"]","File Hash":"[\"\"]","File Name":"[\"\"]","Last Module Loaded":"[\"0x00007FFC99430000 | 0x00007FFC99462000 | 0x32000 | 0x20 | C:/WINDOWS/SYSTEM32/dbgcore.DLL (FileDescription:Windows Core Debugging Helpers;ProductName:Microsoft® Windows® Operating System;VersionInfo:10.0.22621.1 (WinBuild.160101.0800);Timestamp:Sun Mar 9 22:12:15 1980;ASLR:Enabled)\"]","Last Stack FunctionCall":"[\"kernel32.dll| 0x0000000000068600 ( WinExec) | 0x00007FFCAC840000\"]","Logged In UserName":"[\"GWNT/shane.dickson\"]","Message":"[\"VENDOR prevented a threat on application winwword\"]","VENDOR Version":"[\"8.3.3\"]","Parent Process Command Line":"[\"C:/Windows/explorer.exe\"]","Parent Signature":"[\"359179ffb630953ee79523866a0a2246a5612d726c2eace52f7413f15530715e\"]","Process Signature":"[\"d3d97b6af2457c9a8c43cb3856ff227802dc928836638d8e71258c9167379168\"]","Protector IP":"[\"10.1.11.35\"]","Tenant Id":"[\"69068d46-d11d-4e81-af93-0b91bec183ef\"]","Threat Description":"[\"VENDOR Total Evasion Framework is a tool that contains several Pen-testing attack techniques that bypass all AV and EDR solutions.\"]","Threat Module":"[\"Shellcode\"]","Threat Name":"[\"VENDOR Total Evasion Framework\"]","Threat Severity":"[\"%!s(int=5)\"]","Threat Sub-Classification":"[\"Attack-Simulator\"]"}
Event Attributes
Welcome to your new Fortinet Community!
You'll find your previous forum posts under "Forums"
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.