I have a query in relation to the following document:
https://cloud.google.com/chronicle/docs/reference/udm-field-list
The docs says the following:
When writing rules for Detect Engine, use the <prefix> pattern $event for Event fields and $entity for Entity fields. For example:
Now i can't understand why is `principal.user.location.city` prefixed with `$event`.
`principal` is a noun in UDM. So why is `principal.user.location.city` prefixed with `$event`.
Can you please help me fill the gap in my understanding.
Solved! Go to Solution.
In YARA-L every field needs to be mapped. For a rule that only is looking at a single event, this may seem like overkill but as we get into rules that contain multiple events (or entities), we need a way to identify that event1 pertains to process launch events and event2 is network http events and entity1 is a safebrowsing entity and so forth.
The $event or $entity in the example above are referred to as event variables. These are seen all over rules and are sometimes shortened to $e and $u in the documentation. I personally prefer using something more descriptive, ie $process or $network as these event variables can also be seen in the detection and make it simpler to read and see which events pertain to the process portion of a detect versus the network portion, for example.
Here is a short video I put together on YARA-L variables as well:
Hope this helps!