However as you could see, because both principal.ip and principal.user.email_addresses are repeated fields and you are matching using principal.user.userid so each user id will have a multi-list of IP-emails pairs, the rule will trigger if there is at least one pair that is not in your data table.
i.e. The highlighted alert had 10 pairs, 9 of them were not in the data table so the rule triggered.
For Equal Matching ; The rule will work as expected
Concatenating them in the parser should work but it won’t be a neat solution and will have the same effect.
You could define the table as ;
ipEmail
ref
ip1_email1
GCP_CLOUDAUDIT
First column will be the ip-email pair concatenated with “_”, the other column is any dummy value.
%sample_rule3.ref = $e.metadata.log_type //dummy match just to allow “!=” operator later
$ipEmailPair != %sample_rule3.ipEmail
match:
$user_id_for_match over 1h
outcome:
$ipEmailPair_ = array_distinct($ipEmailPair)
condition:
$e }
The rule will generate a list of IP Email pairs ($ipEmailPair_) per user id ($user_id_for_match), but also the rule will trigger if the list $ipEmailPair_ have any pairs that are not in the table.
i.e. if you added ip1_email1,”GCP_CLOUDAUDIT” in that table, the rule will trigger if a user id user1 has ip2_email2 and ip1_email1pairs within the hour since ip2_email2 pair is not in the data table.
Thank you for your reply. I will try to verify the information you provided! I will contact you once the verification is complete.
I tested it and was able to achieve what I wanted to do.