Brand Impersonation: SendGrid
Detects inbound messages that impersonate SendGrid through display name or domain manipulation, combined with security or authentication-themed content, while failing authentication checks and originating from untrusted sources.
Sublime rule (View on GitHub)
1name: "Brand Impersonation: SendGrid"
2description: "Detects inbound messages that impersonate SendGrid through display name or domain manipulation, combined with security or authentication-themed content, while failing authentication checks and originating from untrusted sources."
3type: "rule"
4severity: "medium"
5source: |
6 type.inbound
7 and (
8 // display name contains sendgrid
9 (
10 strings.ilike(strings.replace_confusables(sender.display_name),
11 '*sendgrid*'
12 )
13 // levenshtein distance similar to sendgrid
14 or strings.ilevenshtein(strings.replace_confusables(sender.display_name),
15 'sendgrid'
16 ) <= 1
17 // no display name, local_part contains sendgrid
18 or (
19 strings.ilike(strings.replace_confusables(sender.email.local_part),
20 '*sendgrid*'
21 )
22 and (
23 sender.display_name is null
24 or strings.ilike(strings.replace_confusables(subject.subject),
25 '*sendgrid*'
26 )
27 )
28 )
29 )
30 )
31 and (
32 any(beta.ml_topic(body.current_thread.text).topics,
33 .name in (
34 "Security and Authentication",
35 "Secure Message",
36 "Reminders and Notifications",
37 "Software and App Updates"
38 )
39 and .confidence in ("medium", "high")
40 )
41 or any(beta.ml_topic(beta.ocr(beta.message_screenshot()).text).topics,
42 .name in (
43 "Security and Authentication",
44 "Secure Message",
45 "Reminders and Notifications",
46 "Software and App Updates"
47 )
48 and .confidence in ("medium", "high")
49 )
50 or any(ml.nlu_classifier(body.current_thread.text).intents,
51 .name == "cred_theft" and .confidence == "high"
52 )
53 or any(ml.nlu_classifier(beta.ocr(beta.message_screenshot()).text).intents,
54 .name == "cred_theft" and .confidence == "high"
55 )
56 )
57
58 // and the sender is not in org_domains or from sendgrid domains and passes auth
59 and not (
60 sender.email.domain.root_domain in $org_domains
61 or (
62 sender.email.domain.root_domain in ("sendgrid.com")
63 and headers.auth_summary.dmarc.pass
64 )
65 )
66 // and the sender is not from high trust sender root domains
67 and (
68 (
69 sender.email.domain.root_domain in $high_trust_sender_root_domains
70 and not headers.auth_summary.dmarc.pass
71 )
72 or sender.email.domain.root_domain not in $high_trust_sender_root_domains
73 )
74 and not profile.by_sender().solicited
75
76attack_types:
77 - "BEC/Fraud"
78 - "Credential Phishing"
79 - "Spam"
80tactics_and_techniques:
81 - "Impersonation: Brand"
82 - "Social engineering"
83detection_methods:
84 - "Content analysis"
85 - "Header analysis"
86 - "Natural Language Understanding"
87 - "Optical Character Recognition"
88 - "Sender analysis"
89id: "d800124f-6aa4-58e1-8fa7-beec4958924f"