Skip to content

Commit 14656cd

Browse files
[PR #3704] added rule: Service abuse: SendGrid impersonation via Sendgrid from new sender
1 parent 117d7e2 commit 14656cd

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Service abuse: SendGrid impersonation via Sendgrid from new sender"
2+
description: "Detects messages impersonating SendGrid from new senders, while routing through legitimate SendGrid infrastructure. This pattern is commonly used to abuse trusted email services for malicious purposes."
3+
type: "rule"
4+
severity: "high"
5+
source: |
6+
type.inbound
7+
// SendGird impersonation patterns
8+
and (
9+
strings.ilike(strings.replace_confusables(sender.display_name), '*sendgrid*')
10+
or strings.ilevenshtein(strings.replace_confusables(sender.display_name),
11+
'sendgrid'
12+
) <= 1
13+
or (
14+
strings.ilike(strings.replace_confusables(sender.email.local_part),
15+
'*sendgrid*'
16+
)
17+
and (
18+
sender.display_name is null
19+
or strings.ilike(strings.replace_confusables(subject.base), '*sendgrid*')
20+
)
21+
)
22+
or any(ml.logo_detect(file.message_screenshot()).brands,
23+
.name == "SendGrid" and .confidence == "high"
24+
)
25+
)
26+
// sent from sendgrid infra
27+
and any(headers.domains,
28+
strings.icontains(.domain, 'outbound-mail.sendgrid.net')
29+
)
30+
// not common senders with valid domains
31+
// this catches cases where the domain is invalid and senders become common
32+
and not (
33+
profile.by_sender_email().prevalence == "common" and sender.email.domain.valid
34+
)
35+
36+
// negate legit sendgrid messages
37+
and not (
38+
sender.email.domain.domain == "sendgrid.com"
39+
and coalesce(headers.auth_summary.dmarc.pass, false)
40+
)
41+
42+
attack_types:
43+
- "Credential Phishing"
44+
tactics_and_techniques:
45+
- "Impersonation: Brand"
46+
- "Social engineering"
47+
detection_methods:
48+
- "Header analysis"
49+
- "Sender analysis"
50+
id: "54311009-9116-555a-9aa2-a3304ae64208"
51+
og_id: "aa5d18ca-665a-5817-89d6-d76e29c44580"
52+
testing_pr: 3704
53+
testing_sha: 5d82bd62b7b09f98673c85d30ef6982164861eb6

0 commit comments

Comments
 (0)