Im using the below data sources - "Palo alto, Cloudflare, ExtraHop, Sysmon, Microsoft Defender for endpoints"
My Yara Rule:
events:
( ($e.metadata.log_type = "CLOUDFLARE" and $e.metadata.vendor_name = "Cloudflare") or
($e.metadata.log_type = "PAN_FIREWALL" and $e.metadata.vendor_name = "Palo Alto Networks") or
($e.metadata.log_type = "CLOUDFLARE" and $e.metadata.vendor_name = "Cloudflare") or
($e.metadata.log_type = "EXTRAHOP" and $e.metadata.vendor_name = "ExtraHop") or
($e.metadata.log_type = "WINDOWS_SYSMON" and $e.metadata.vendor_name = "Microsoft") or
( $e.metadata.log_type = "Microsoft Defender for Endpoint" and $e.metadata.vendor_name = "Microsoft")
) and
$e.principal.ip = $ip_address and
strings.extract_domain($e.target.url) in %CloudStorageDomains_List and
$e.network.sent_bytes > 10000000
match:
$ip_address over 15m
outcome:
$total_bytes_transferred = sum($e.network.sent_bytes)
$unique_target_domains = count_distinct(strings.extract_domain($e.target.url))
$user_id = array_distinct($e.principal.user.userid) // To get a list of all users involved
$destination_application = array_distinct($e.target.application)
condition:
$e and $total_bytes_transferred > 10000000
}
RULE IS ACCEPTING WITH NO ERRORS, BUT AT THE SAME TIME NO RESULTS GIVING.
Then I started doing debugging to make sure my rule is correct by changing --
$e.network.sent_bytes > 100
$e and $total_bytes_transferred > 1000
RULE IS ACCEPTING WITH NO ERRORS, BUT AT THE SAME TIME NO RESULTS GIVING.
Then I mentioned only 1 data source
Like below:
$e.metadata.vendor_name = "Palo Alto Networks"
and
$e.principal.ip = $ip_address and
strings.extract_domain($e.target.url) in %CloudStorageDomains_List and
$e.network.sent_bytes > 10 // Set to a very low number for testing
match:
$ip_address over 15m
outcome:
$total_bytes_transferred = sum($e.network.sent_bytes)
$unique_target_domains = count_distinct(strings.extract_domain($e.target.url))
$user_id = array_distinct($e.principal.user.userid)
$destination_application = array_distinct($e.target.application)
condition:
$e and $total_bytes_transferred > 500// Set to a very low number for testing}.
RULE IS ACCEPTING WITH NO ERRORS, BUT AT THE SAME TIME NO RESULTS GIVING.
What to do any suggestions are accepted.
Looking forward for more ideas. Thanks a lot.