Some context here: I'm writing a detection rule to monitor the network connections and check if any of them match with IOCs. The thing is that I want this rule to trigger if:
- Is IOC and found any allowed network connections, OR
- Is IOC and found more than 2 blocked network connections
What's the best approach here? I've tried to create 3 variables (misp, allow, block) with 2 placeholders (allowed, blocked) like this: $allow.security_result.action = $allowed. With that, I built the condition like this: $ioc and (#allowed > 0 or #blocked > 2).
I'm aware such conditions exist for like 1 IOC and 5 blocks in the time range but the rule doesn't trigger. Is there's another approach, like checking the security_result.action under the outcome section using any function? Any thoughts?