Suspicious Links to Cloudflare R2 and Edge Services

Detects links to Cloudflare R2 storage buckets, Pages, and Workers domains from unsolicited or previously malicious senders who are not on a trusted sender list or have failed DMARC authentication.

Sublime rule (View on GitHub)

 1name: "Suspicious Links to Cloudflare R2 and Edge Services"
 2description: "Detects links to Cloudflare R2 storage buckets, Pages, and Workers domains from unsolicited or previously malicious senders who are not on a trusted sender list or have failed DMARC authentication."
 3type: "rule"
 4severity: "medium"
 5source: |
 6  type.inbound
 7  and any(body.links,
 8          // Check root domain first
 9          .href_url.domain.root_domain in ("r2.dev", "pages.dev", "workers.dev")
10  // Check the specific pub-{hex}.r2.dev subdomain pattern only for r2.dev
11  )
12  // negate emails with unsubscribe links
13  and not any(body.links,
14              strings.icontains(.href_url.url, "unsubscribe")
15              or strings.icontains(.display_text, "unsubscribe")
16  )
17  // negate bulk mailer domains
18  and not any(body.links,
19              .href_url.domain.root_domain in $bulk_mailer_url_root_domains
20  )
21  and not (
22    any(ml.nlu_classifier(body.current_thread.text).topics,
23        .name in (
24          "Newsletters and Digests",
25          "Advertising and Promotions",
26          "Educational and Research",
27          "B2B Cold Outreach",
28          "Health and Wellness",
29          "Professional and Career Development",
30          "Romance",
31          "Sexually Explicit Messages",
32          "Software and App Updates",
33          "Acts of Violence",
34          "Voicemail Call and Missed Call Notifications"
35        )
36        and .confidence == "high"
37    )
38    and not (
39      any(body.current_thread.links, strings.iends_with(.href_url.path, ".html"))
40      and length(body.current_thread.links) < 5
41    )
42  )
43  // negate highly trusted sender domains unless they fail DMARC authentication
44  and not (
45    sender.email.domain.root_domain in $high_trust_sender_root_domains
46    and coalesce(headers.auth_summary.dmarc.pass, false)
47  )
48  and (
49    not profile.by_sender().solicited
50    or (
51      profile.by_sender().any_messages_malicious_or_spam
52      and not profile.by_sender().any_messages_benign
53    )
54  )
55  and not profile.by_sender().any_messages_benign  
56tags:
57 - "Attack surface reduction"
58attack_types:
59  - "BEC/Fraud"
60  - "Callback Phishing"
61  - "Credential Phishing"
62  - "Extortion"
63  - "Malware/Ransomware"
64  - "Spam"
65tactics_and_techniques:
66  - "Free file host"
67detection_methods:
68  - "Header analysis"
69  - "Sender analysis"
70  - "URL analysis"
71id: "5dd3e5c8-7c81-5e2f-8e2b-ef21ea77bf73"

Related rules

to-top