type.inbound
and any(body.links,
.href_url.domain.domain == "bananaguide.com"
and .href_url.path == "/thru.php"
and length(.href_url.query_params_decoded["url"]) > 0
// Make sure the redirect is not going back to bananaguide.com
and not any(.href_url.query_params_decoded["url"],
strings.parse_url(.).domain.root_domain == "bananaguide.com"
)
)
and not sender.email.domain.root_domain == "bananaguide.com"
// 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
)
Playground
Test against your own EMLs or sample data.