Hello guys,
Let's say I have a YARA-L rule I want to tune. I have a host-based whitelist and a username-based whitelist. I don't want any alert if the user in the log is in the username-based whitelist or if the host in the log is in the host-based whitelist.
There are two ways of writing it in the events section :
[...previous detection logic...]
not $e.principal.hostname in %whitelist_hostname
not $e.principal.user.user_id in %whitelist_username
vs.
[...previous detection logic...]
not (
$e.principal.hostname in %whitelist_hostname
or $e.principal.user.user_id in %whitelist_username
)
Which one is the best way, in consideration of rule execution performance, to implement this logic in YARA-L ?