-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bfilar.nlu_signals
- Loading branch information
Showing
126 changed files
with
1,096 additions
and
911 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ jobs: | |
with: | ||
ref: ${{ github.head_ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
depth: 0 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
|
@@ -92,6 +93,45 @@ jobs: | |
id: get_head | ||
run: echo "##[set-output name=HEAD;]$(git rev-parse HEAD)" | ||
|
||
- name: Get changed detection-rules | ||
id: changed-files | ||
uses: tj-actions/changed-files@v39 | ||
with: | ||
files: "detection-rules/**" | ||
recover_deleted_files: true | ||
|
||
- name: "Find updated rule IDs" | ||
id: find_ids | ||
run: | | ||
for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do | ||
echo "$file was changed" | ||
rule_id=$(yq '.id' $file) | ||
echo "$file has rule ID $rule_id" | ||
altered_rule_ids=$(echo "$rule_id"" ""$altered_rule_ids") | ||
done | ||
echo "Altered Ruled IDs: [$altered_rule_ids]" | ||
echo "##[set-output name=rule_ids;]$(echo $altered_rule_ids)" | ||
# TODO: This doesn't solve for a modified rule_id. We could merge with any files known on 'main', but changing | ||
# a rule ID is a separate problem. | ||
- name: "Trigger MQL Mimic Tests" | ||
env: | ||
trigger_url: '${{ secrets.MQL_MOCK_TRIGGER }}' | ||
branch: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} | ||
repo: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || github.repository }} | ||
token: '${{ secrets.GITHUB_TOKEN }}' | ||
sha: '${{ steps.get_head.outputs.HEAD }}' | ||
only_rule_ids: '${{ steps.find_ids.outputs.rule_ids }}' | ||
run: | | ||
body='{"branch":"'$branch'","repo":"'$repo'","token":"'$token'","sha":"'$sha'","only_rule_ids":"'$only_rule_ids'"}' | ||
echo $body | ||
curl -X POST $trigger_url \ | ||
-H 'Content-Type: application/json' \ | ||
-d "$body" | ||
# When we add a commit, GitHub won't trigger actions on the auto commit, so we're missing a required check on the | ||
# HEAD commit. | ||
# Various alternatives were explored, but all run into issues when dealing with forks. This sets a "Check" for | ||
|
@@ -126,3 +166,14 @@ jobs: | |
text: "Rule Tests and ID Updated", | ||
}, | ||
}); | ||
- name: Wait for MQL Mimic check to be completed | ||
uses: fountainhead/[email protected] | ||
id: wait-for-build | ||
# Wait for results so that the token remains valid while the test suite is executing and posting a check here. | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
checkName: "MQL Mimic Tests" | ||
ref: ${{ steps.get_head.outputs.HEAD }} | ||
timeoutSeconds: 3600 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: "Attachment: Zip Exploiting CVE-2023-38831 (Unsolicited)" | ||
description: | | ||
A Zip attachment that exhibits attributes required to exploit CVE-2023-38831, a vulnerability in WinRAR (prior to 6.23). | ||
type: "rule" | ||
severity: "critical" | ||
authors: | ||
- twitter: "delivr_to" | ||
references: | ||
- https://twitter.com/GroupIB_TI/status/1694277126944633328 | ||
- https://www.group-ib.com/blog/cve-2023-38831-winrar-zero-day/ | ||
- https://github.com/b1tg/CVE-2023-38831-winrar-exploit/ | ||
- https://delivr.to/payloads?id=ab969e8a-bf5c-45a6-acd0-0dd2b2a34750 | ||
source: | | ||
type.inbound | ||
and any(attachments, | ||
.file_extension in $file_extensions_common_archives and | ||
any(file.explode(.), | ||
( | ||
.depth == 0 and | ||
any(.scan.zip.all_paths, | ||
regex.match(., | ||
// zip contains a path with spaces and file extensions | ||
// lure.pdf /lure.pdf .cmd | ||
// | ||
// /= Initial file name | ||
// | | ||
// | /= Space | ||
// | | | ||
// | | /= Folder | ||
// | | | | ||
// | | | /= Repeated file name | ||
// | | | | | ||
// | | | | /= Space | ||
// | | | | | | ||
// | | | | | /= Real script ending | ||
// | | | | | | | ||
'\w+\.\w+\s\/\w+\.\w+\s\.\w+' | ||
) | ||
) | ||
) and | ||
( | ||
// One file name is present in another, e.g. | ||
// delivrto.pdf | ||
// delivrto.pdf /delivrto.pdf .cmd | ||
any(.scan.zip.all_paths, | ||
any(..scan.zip.all_paths, | ||
. != .. and | ||
strings.starts_with(., ..) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
and ( | ||
( | ||
sender.email.domain.root_domain in $free_email_providers | ||
and sender.email.email not in $recipient_emails | ||
) | ||
or ( | ||
sender.email.domain.root_domain not in $free_email_providers | ||
and sender.email.domain.domain not in $recipient_domains | ||
) | ||
) | ||
tags: | ||
- "Suspicious Attachment" | ||
- "CVE-2023-38831" | ||
id: "926b96ae-f40b-525d-a312-bd6c9a5f19fb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.