Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing FPs on fake attachment rule #1123

Merged
merged 5 commits into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions detection-rules/attachment_fake_attachment_image.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Attachment: Fake attachment image lure"
description: |
Message body (or attached message body) contains a image faking an Outlook attachment button. The image contains OCR entities that are suspicious.
Message (or attached message) contains an image impersonating an Outlook attachment button.
type: "rule"
severity: "medium"
source: |
Expand All @@ -9,32 +9,34 @@ source: |
// fake file attachment preview in original email
any(attachments,
.file_type in $file_types_images
and .size < 5000
and any(file.explode(.),
any(ml.nlu_classifier(.scan.ocr.raw).entities,
.name in~ ("financial", "urgency")
)
)
and any(attachments,
.file_type in $file_types_images
and any(ml.logo_detect(.).brands, .name == "FakeAttachment")
)
and any(ml.logo_detect(.).brands, .name == "FakeAttachment")
)
// fake file attachment preview in attached EML
or any(attachments,
.content_type == "message/rfc822"
(.content_type == "message/rfc822" or .file_extension == "eml")
and any(file.parse_eml(.).attachments,
.file_type in $file_types_images
and .size < 5000
and any(file.explode(.),
any(ml.nlu_classifier(.scan.ocr.raw).entities,
.name in~ ("financial", "urgency")
)
)
and any(ml.logo_detect(.).brands, .name == "FakeAttachment")
)
)
)


// negate highly trusted sender domains unless they fail DMARC authentication
and (
(
sender.email.domain.root_domain in $high_trust_sender_root_domains
and (
any(distinct(headers.hops, .authentication_results.dmarc is not null),
strings.ilike(.authentication_results.dmarc, "*fail")
)
)
)
or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)
and (
not profile.by_sender().solicited
or profile.by_sender().any_messages_malicious_or_spam
)
tags:
- "Suspicious attachment"
- "Suspicious content"
Expand Down
Loading