Skip to content

Create fake_canada_taxrevenue_T4.yml#4126

Open
cybher0808 wants to merge 17 commits into
mainfrom
cybher0808.fn.esc-8223.fakecanadataxT4
Open

Create fake_canada_taxrevenue_T4.yml#4126
cybher0808 wants to merge 17 commits into
mainfrom
cybher0808.fn.esc-8223.fakecanadataxT4

Conversation

@cybher0808
Copy link
Copy Markdown
Member

@cybher0808 cybher0808 commented Mar 5, 2026

Description

Detects messages impersonating the Canada Revenue Agency (CRA) with attachments, using common tax-related subjects in both English and French, and containing CRA-related content in the message body.

Associated samples

Associated hunts

@cybher0808 cybher0808 requested a review from a team March 5, 2026 18:16
@cybher0808 cybher0808 requested a review from a team as a code owner March 5, 2026 18:16
@cybher0808 cybher0808 self-assigned this Mar 5, 2026
@cybher0808 cybher0808 added the in-test-rules PR is in our testing suite to collect telemetry label Mar 5, 2026
github-actions Bot added a commit that referenced this pull request Mar 5, 2026
github-actions Bot added a commit that referenced this pull request Mar 5, 2026
github-actions Bot added a commit that referenced this pull request Mar 13, 2026
github-actions Bot added a commit that referenced this pull request Mar 13, 2026
…tion: Canada Revenue Agency with attachment
@cybher0808 cybher0808 added the review-needed Indicates that a PR is waiting for review label Mar 17, 2026
@cybher0808
Copy link
Copy Markdown
Member Author

cybher0808 commented Mar 17, 2026

In test-rules are a mixture of malicious and benign, the benign samples match on suspicious strings from file.explode. I have included hunting customer environments and they look suspicious/malicious - check in Notion for clarification.

Comment thread detection-rules/fake_canada_taxrevenue_T4.yml Outdated
Comment thread detection-rules/fake_canada_taxrevenue_T4.yml Outdated
@IndiaAce IndiaAce removed the review-needed Indicates that a PR is waiting for review label Mar 18, 2026
cybher0808 and others added 2 commits March 25, 2026 12:40
Hunted again and found a better way to find malicious samples.
github-actions Bot added a commit that referenced this pull request Mar 25, 2026
github-actions Bot added a commit that referenced this pull request Mar 25, 2026
…tion: Canada Revenue Agency with attachment
@cybher0808 cybher0808 requested a review from IndiaAce April 2, 2026 21:32
@cybher0808 cybher0808 added the review-needed Indicates that a PR is waiting for review label Apr 2, 2026
@cybher0808
Copy link
Copy Markdown
Member Author

Test-rules/multi-hunt outcome are looking good in this case from revisions. Majority of the samples are malicious.

Copy link
Copy Markdown
Member

@IndiaAce IndiaAce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've requested a few changes, going to remove the review-needed label for the time being. Feel free to add it back when you're ready for a re-review!

Comment thread detection-rules/fake_canada_taxrevenue_T4.yml Outdated
Comment thread detection-rules/fake_canada_taxrevenue_T4.yml Outdated
Comment thread detection-rules/fake_canada_taxrevenue_T4.yml Outdated
@IndiaAce IndiaAce removed the review-needed Indicates that a PR is waiting for review label Apr 6, 2026
Comment thread detection-rules/fake_canada_taxrevenue_T4.yml Outdated
github-actions Bot added a commit that referenced this pull request Apr 6, 2026
…tion: Canada Revenue Agency with attachment
github-actions Bot added a commit that referenced this pull request Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Shared Samples Sync - Excluded

This PR contains 14 rules, which exceeds the maximum of 10 rules allowed per PR for automatic syncing.

This limit helps ensure the shared-samples environment remains manageable. If you need to test these rules, consider:

  • Splitting the PR into smaller PRs with fewer rules
  • Contacting Detection Operations to request a manual sync

github-actions Bot added a commit that referenced this pull request May 15, 2026
@github-actions github-actions Bot added test-rules:excluded:bulk_rules Bulk rule update, excluded from test rules and removed in-test-rules PR is in our testing suite to collect telemetry labels May 15, 2026
github-actions Bot added a commit that referenced this pull request May 15, 2026
@cybher0808 cybher0808 added in-test-rules PR is in our testing suite to collect telemetry and removed test-rules:excluded:bulk_rules Bulk rule update, excluded from test rules shared-samples:excluded:bulk_rules labels May 19, 2026
github-actions Bot added a commit that referenced this pull request May 19, 2026
github-actions Bot added a commit that referenced this pull request May 19, 2026
github-actions Bot added a commit to IndiaAce/sublime-rules that referenced this pull request May 19, 2026
…ation: Canada Revenue Agency with attachment
Refactored conditions for detecting fake Canada tax revenue emails by consolidating regex checks and removing redundant conditions.
github-actions Bot added a commit to IndiaAce/sublime-rules that referenced this pull request May 20, 2026
…ation: Canada Revenue Agency with attachment
github-actions Bot added a commit that referenced this pull request May 20, 2026
…tion: Canada Revenue Agency with attachment
github-actions Bot added a commit that referenced this pull request May 20, 2026
@cybher0808
Copy link
Copy Markdown
Member Author

cybher0808 commented May 21, 2026

Waiting for this hunt search to finish. Results have been shared from Mode and SS. Some environments have failed after hunting see ESC.

Made a few changes since there were FP's flagged with my previous written rule. Added the 3 of to this current rule to catch malicious characteristics.

Marking for R4R.

@cybher0808 cybher0808 added the review-needed Indicates that a PR is waiting for review label May 21, 2026
@cybher0808 cybher0808 requested a review from IndiaAce May 28, 2026 20:31
@IndiaAce
Copy link
Copy Markdown
Member

I think we can simplify this logic a bit without needing all the topic negations and extra stuff, I've been running some hunts this morning that's just "says its from CRA, with cred theft, and isn't actually from them" let me know your thoughts but I think it's doing well. Feel free to grab this.

type.inbound
// sender claims to be CRA
and (
  strings.icontains(sender.display_name, 'canada revenue agency')
  or strings.icontains(sender.display_name, 'agence du revenu du canada')
  or (
    // cra display name and cra reference in subject
    regex.icontains(sender.display_name, '\bcra\b')
    and regex.icontains(subject.base,
                        '(?:T4|cra|tax|canada revenue|revenu du canada)'
    )
  )
)
// nlu cred theft
and any(ml.nlu_classifier(body.current_thread.text).intents,
        .name == "cred_theft" and .confidence != 'low'
)
and not (
  (
    // negate highly trusted sender domains
    sender.email.domain.root_domain in $high_trust_sender_root_domains
    // negate legit senders from merck
    or sender.email.domain.root_domain == "cra-arc.gc.ca"
  )
  // enforce auth
  and coalesce(headers.auth_summary.dmarc.pass, false)
)

https://hunt.limeseed.email/hunts/dcd0dc39-7afd-4aea-bf40-a17b6480a35a
https://platform.sublime.security/messages/hunt?huntId=019e742e-bba0-753a-87c2-b8fd1e6905ec

Gonna remove review-needed for now but feel free to message me if you want a re-review on it.

@IndiaAce IndiaAce removed the review-needed Indicates that a PR is waiting for review label May 29, 2026
@cybher0808
Copy link
Copy Markdown
Member Author

cybher0808 commented May 29, 2026

I was a bit hesitant a bit since I felt like my last rule proposed felt like it was a mouth full, I like this clean up. Good approach here. I doubled check if I missed any.

I reran after sharing the multi-hunt results - solid count here --> hunt & ran a net-new, validation check. TY! @IndiaAce

github-actions Bot added a commit that referenced this pull request May 29, 2026
github-actions Bot added a commit to IndiaAce/sublime-rules that referenced this pull request May 29, 2026
…ation: Canada Revenue Agency with attachment
github-actions Bot added a commit that referenced this pull request May 29, 2026
…tion: Canada Revenue Agency with attachment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-test-rules PR is in our testing suite to collect telemetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants