New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Google Professional Security Operations Engineer Exam - Topic 4 Question 8 Discussion

Actual exam question for Google's Professional Security Operations Engineer exam
Question #: 8
Topic #: 4
[All Professional Security Operations Engineer Questions]

You are responsible for identifying suspicious activity and security events in your organization's environment. You discover that some detection rules are generating false positives when the principal.ip field contains one or more IP addresses in the 192.168.2.0/24 subnet. You want to improve these detection rules using the principal.ip repeated field. What should you add to the YARA-L detection rules?

Show Suggested Answer Hide Answer
Suggested Answer: D

Comprehensive and Detailed Explanation

The correct solution is Option D. The goal is to exclude events (i.e., stop false positives) when the principal.ip field contains any IP from the trusted 192.168.2.0/24 subnet.

The principal.ip field in UDM is a repeated field, meaning it can hold an array of values (e.g., ['1.2.3.4', '192.168.2.5']). YARA-L provides the any and all quantifiers to handle repeated fields.9

any $e.principal.ip: This checks if at least one IP in the array meets the condition.

all $e.principal.ip: This checks if every IP in the array meets the condition.

The function net.ip_in_range_cidr(...) returns true if an IP is in the specified range.

Therefore, the logic we need is: 'do not trigger this rule if any of the IPs in the principal.ip field are in the 192.168.2.0/24 range.'

This translates directly to the YARA-L syntax: not net.ip_in_range_cidr(any $e.principal.ip, '192.168.2.0/24')

Option B would only find events from that subnet.

Option A would only find events where all associated IPs are in that subnet.

Option C is the logical inverse of A and would incorrectly filter out events that might be malicious (e.g., ['1.2.3.4', '192.168.2.5'] would not be excluded because all IPs are not in the range).

Exact Extract from Google Security Operations Documents:

YARA-L 2.0 language syntax > Repeated fields and boolean expressions: When a boolean expression, such as a function call, is applied to a repeated field, you can use the any or all keywords to specify how the expression should be evaluated.10

any <repeated_field>: The expression evaluates to true if it is true for at least one of the values in the repeated field.

all <repeated_field>: The expression evaluates to true only if it is true for all of the values in the repeated field.

Functions > net.ip_in_range_cidr: The net.ip_in_range_cidr function is useful to bind rules to specific parts of the network.11 To exclude all private netblocks as defined in RFC1918, you can add a not to the start of the criteria:

and not (net.ip_in_range_cidr(any $e.principal.ip, '10.0.0.0/8') or net.ip_in_range_cidr(any $e.principal.ip, '172.16.0.0/12') or net.ip_in_range_cidr(any $e.principal.ip, '192.168.0.0/16'))


Google Cloud Documentation: Google Security Operations > Documentation > Detections > YARA-L 2.0 language syntax

Google Cloud Documentation: Google Security Operations > Documentation > Detections > YARA-L 2.0 functions > net.ip_in_range_cidr

Contribute your Thoughts:

0/2000 characters
Mertie
3 days ago
I'm going with D). Gotta love that "not" keyword to negate the condition.
upvoted 0 times
...
Veta
8 days ago
C) is the way to go. Negating the condition to exclude the 192.168.2.0/24 subnet makes the most sense.
upvoted 0 times
...
Meghan
13 days ago
B) is the correct answer. It checks if any of the IP addresses in the principal.ip field are within the 192.168.2.0/24 subnet.
upvoted 0 times
...
Simona
18 days ago
I recall a similar question where we had to filter out specific IP ranges, and I think option D might be the way to go, but I need to double-check the logic behind it.
upvoted 0 times
...
Cyril
23 days ago
I feel like option C could be the right choice since we want to exclude those IPs, but I’m not entirely confident about the syntax for YARA-L rules.
upvoted 0 times
...
Fanny
28 days ago
I think option B makes sense because it checks if any of the IPs fall within that range, but I’m a bit confused about the implications of using "any" versus "all."
upvoted 0 times
...
Teresita
1 month ago
I remember we discussed how to handle false positives in our last practice session, but I'm not sure which option specifically addresses the repeated field correctly.
upvoted 0 times
...
Sabina
1 month ago
Hmm, I'm not sure about this one. I think I need to review the YARA-L documentation again to make sure I understand how to use the net.ip_in_range_cidr function properly. I don't want to guess and get it wrong.
upvoted 0 times
...
Jeannetta
1 month ago
I'm pretty confident that the answer is D. We want to exclude any IP addresses in the 192.168.2.0/24 subnet, so the "not net.ip_in_range_cidr(any $e.principal.ip, "192.168.2.0/24")" function should do the trick.
upvoted 0 times
...
Ellen
2 months ago
Okay, let me think this through. If we want to improve the detection rules, we probably want to exclude the 192.168.2.0/24 subnet, since that's causing false positives. So I'm thinking option C or D might be the way to go.
upvoted 0 times
...
Frankie
2 months ago
Hmm, I'm a bit confused about the repeated field concept. Do we need to check if all the IP addresses in principal.ip are in the 192.168.2.0/24 subnet, or just any of them? That's going to affect the answer.
upvoted 0 times
...
Donte
2 months ago
I think the key here is to focus on the repeated field principal.ip and how to use it to improve the detection rules. The question is asking us to add something to the YARA-L detection rules, so I'm guessing we need to use a function related to that.
upvoted 0 times
...

Save Cancel