Skip to content

Commit

Permalink
Fixing FPs on fake attachment rule (#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenmitchell authored Dec 13, 2023
1 parent 965238c commit a6bcb58
Showing 1 changed file with 21 additions and 19 deletions.
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

0 comments on commit a6bcb58

Please sign in to comment.