type.inbound
and any([body.html.display_text, body.current_thread.text, body.plain.raw],
length(.) < 2500 and (
strings.icontains(., 'Scanned by Gmail')
or (
0 < regex.icount(., '\.pdf|\.(doc|xls|ppt)x?') < 3
and any(body.links,
regex.icontains(.display_text, 'd[ao0]wnl[ao0]{2}d all')
)
and length(body.links) < 4
)
)
and regex.icontains(.,
'[KM]b\b'
) // file size
)
// negate highly trusted sender domains unless they fail DMARC authentication
and (
(
sender.email.domain.root_domain in $high_trust_sender_root_domains
and not headers.auth_summary.dmarc.pass
)
or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)
// if the sender has been marked as malicious, but has FPs, don't alert
and (
(
profile.by_sender().any_messages_malicious_or_spam
and not profile.by_sender().any_messages_benign
)
or not profile.by_sender().any_messages_malicious_or_spam
)
Playground
Test against your own EMLs or sample data.