-
Notifications
You must be signed in to change notification settings - Fork 76
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
[BUG] Error when using aggregation expression in sigma rules #458
Comments
@dnhodgson Can you please share your Detector payload? Did you call |
Here is the detector, basically empty except for the one new rule.
Yes, I missed that in my steps but, create the index, create the security mapping, create the new rules, create the detector, start loading records. |
@petardz is looking into it |
@dnhodgson Your call to In your case, you don't have to apply any mappings or call mappings APIs if your index already has field of type date called timestamp:
Also regarding your rule, count agg with field is not supported currently. You can find supported examples here: link |
ok, I see you can do a updated detection rule
I tried to be more specific by adding in the specific user name but that doesn't seem to make any difference. |
More investigations into the errors, the first error, When I look into that monitor
I can run the query manually and get results however it looks like the trigger condition is incorrect. If I create the same monitor and trigger with the API it also fails with the same errors. It seems that one problem with the trigger condition buckets_path should be If I use the editor to create a monitor with the same functionality I can get it to work, the only different seems to be the aggregation, From the detector created monitor, trigger input and output:
from the manual created monitor that works creating alerts.
|
Also note, I can't manually update the detector monitor with the API to test because it changes the monitor sources back to the |
Thank you for this analysis! As you concluded, issue was that bucket_path. Terms agg returns field called _count and not _cnt. I fixed that and I am able to generate Findings/Alerts with your modified rule(replaced field inside count with *). I'll push a quick PR soon for this. |
Is this patch going to make it into the 2.9.0 release? |
What is the bug?
Error when using aggregation expression in sigma rules
When creating a detector with an aggregation rule I get the following error even when manually creating a timestamp alias in the security_analytics/mappings
When the job runs I get the following error
How can one reproduce the bug?
1) Create an index called "logs"
2) Create a detection rule as follows:
3) Create a detector for the logs index with this rule enabled.
4) Start creating simple documents like the following example
What is the expected behavior?
detector should count that there are events matching the rule and create some findings
What is your host/environment?
The text was updated successfully, but these errors were encountered: