Skip to content

Commit

Permalink
Update regex in rules to remove line-based matches (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
rw-access authored Oct 19, 2023
1 parent d41b26c commit d96d03a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion detection-rules/attachment_eml_html_attachment_portal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source: |
// exclude bounce backs & read receipts
and not strings.like(sender.email.local_part, "*postmaster*", "*mailer-daemon*", "*administrator*")
and not regex.icontains(subject.subject, "^(undeliverable|read:)")
and not regex.imatch(subject.subject, "(undeliverable|read:).*")
and not any(attachments, .content_type == "message/delivery-status")
// if the "References" is in the body of the message, it's probably a bounce
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ source: |
regex.icontains(.display_text,
'(view|click|download|goto)?(attachment|download|file|online|document)s?'
)
or all(body.links, regex.contains(.display_text, "^[A-Z ]+$"))
or all(body.links, regex.match(.display_text, "[A-Z ]+"))
)
)
and any(ml.nlu_classifier(body.current_thread.text).intents,
Expand Down
2 changes: 1 addition & 1 deletion signals/sender/sender_display_is_upper.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Sender: Display Name Contains All Capital Letters"
type: "query"
source: |
regex.match(sender.display_name, "^[^a-z]*[A-Z][^a-z]*$")
regex.match(sender.display_name, "[^a-z]*[A-Z][^a-z]*")

0 comments on commit d96d03a

Please sign in to comment.