type.inbound
and any(body.links,
.href_url.domain.root_domain == "staples.ca"
and strings.icontains(.href_url.path, '/sso/auth')
and strings.icontains(.href_url.query_params, 'Redirect_URI=')
// make sure it's not redirecting back to staples.ca
and not regex.icontains(.href_url.query_params,
'redirect_uri=(?:https?(?:%3a|:))?(?:%2f|\/)*[^&]*staples\.ca(?:&|\/|$|%2f)'
)
)
and not (
sender.email.domain.root_domain == "staples.ca"
and coalesce(headers.auth_summary.dmarc.pass, false)
)
// negate highly trusted sender domains unless they fail DMARC authentication
and not (
sender.email.domain.root_domain in $high_trust_sender_root_domains
and coalesce(headers.auth_summary.dmarc.pass, false)
)
Playground
Test against your own EMLs or sample data.