Skip to content

Conversation

@nasbench
Copy link
Contributor

@nasbench nasbench commented Jan 16, 2026

This PR enhances the performance of a couple of detections as part of a continued effort that I was tracking from the issue #3809. Details are below.

Note All tests were executed on Endor
First batch was addressed in #3850

Updated Analytics [11]

  • Common Ransomware Notes - From 164 seconds to 33.44 seconds - Switch to using a subsearch since the lookup is small enough. Added a warning in the description to inform the user about this too.
  • File with Samsam Extension - From 160 seconds to 11 seconds - Moved the extension search to the where and kept the extraction for better output.
  • Detect Rare Executables - From 300~ seconds to 100~ seconds - Reduces usage of values and switched them to latest so that we can reduce MV calcs which are expensive.
  • 3CX Supply Chain Attack Network Indicators - Added a where clause with DNS.query=* to ensure the existence of the field, since it is used as a filter in the lookup. This is a best effort and will only reduce search time by some time. The same thing was applied to the following Detect hosts connecting to dynamic domain providers, Detect Remote Access Software Usage DNS
  • Detect Remote Access Software Usage URL - Added a where clause with Web.url_domain=* to ensure the existence of the field, since it is used as a filter in the lookup.
  • Detect Remote Access Software Usage Traffic - Added a where clause with All_Traffic.app=* to ensure the existence of the field, since it is used as a filter in the lookup.
  • Common Ransomware Extensions - To enhance this we added filter for known extensions to reduce the search space. By excluding stuff like .exe...etc from file creation we already get rid of a lot. This can ofc be further enhanced by adding more to the list.
  • Detect Remote Access Software Usage File - In order to also enhance perf, we allow only the extensions that are referenced by the lookup itself. Because this is using an file creation event, this will reduce the search space by a lot.
  • Windows DotNet Binary in Non Standard Path - From 852 seconds to 7 seconds - Using a subsearch to enhance performance with the accepted limitation just because the lookup is small.

@nasbench nasbench added this to the v5.21.0 milestone Jan 19, 2026
@nasbench nasbench marked this pull request as ready for review January 19, 2026 15:21
| `drop_dm_object_name("All_Traffic")`
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| lookup remote_access_software remote_appid AS app OUTPUT isutility, description as signature, comment_reference as desc, category
Copy link
Contributor

@patel-bhavin patel-bhavin Jan 20, 2026

Choose a reason for hiding this comment

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

Should we move these lookup by the where clause like other detection updates? eg : Windows DotNet Binary in Non Standard Path

Copy link
Contributor Author

@nasbench nasbench Jan 20, 2026

Choose a reason for hiding this comment

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

We can't just because the app field is inconsistent in that CIM it can contain both apps categories and binaries, but more importantly the lookup is big with 600 entries, which will results in a big OR clause that results in the same performance.

@patel-bhavin patel-bhavin self-requested a review January 20, 2026 03:40
@patel-bhavin
Copy link
Contributor

Lets wait on merging this after the release is out!

@patel-bhavin patel-bhavin enabled auto-merge (squash) January 22, 2026 12:35
@patel-bhavin patel-bhavin merged commit 76f629e into develop Jan 22, 2026
4 of 5 checks passed
@patel-bhavin patel-bhavin deleted the fix-perf-issues branch January 22, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improving Performance of Detection Rules That Are Using Broad tstats Filters

2 participants