-
Notifications
You must be signed in to change notification settings - Fork 587
[FR] [DAC] Update default KQL parsing behavior to normalize keywords for custom rule directories. #3816
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
Conversation
These should not just default to that behavior simply based on the presence of the custom rules envvar, as that may not be the desired behavior. Please update to expose a new config parameter where these can be set and pushed down as needed |
Sure, happy to update it to be a parameter instead. I was basing the initial approach off of your description in the issue.
And I understood that to mean that you wanted a default based on the presence of custom rules. |
Updated to now have a separate environment variable Another considered approach was to put the value in the config file; however, this would require fairly significant restructuring of the detection rules logic flow (specifically how we use |
Upon further consideration, while the original POC decision for the config setup has merit, the enhanced usability for the end user of being able to specify the variable in the config, warrants modifying this structure to support it. Updating shortly. |
I concur and think it requires it. We should strive to make the use of environmental variables optional (with configs), where possible to minimize complexity of calls |
Updated to use the config. As a note to my prior comment, the restructuring was already done in another PR so this PR should be small. 🚀 |
As a note, this will require an accompanying docs PR since we are updating the config. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lgtm. The only other question I had was if we wanted the config generation to also add this field or not. Since its optional and we default, I dont think its necessary, (sometimes less is more), but figured id bring it up.
Made an issue to update documentation (elastic/DaC-Reference#15) as it does not appear that config options are currently discussed in the read the docs. |
This is a good point, I think for the default config less it more to reduce complexity to get started, but this definitely needs to be called out in documentation. Thanks! |
Related Issue:
#3624
Related PRs:
#3574
Summary
This PR updates the default KQL parsing behavior when a custom rule directory is set. Now when the
NORMALIZE_KQL_KEYWORDS
environment variable is set, the normalization flag is set toTrue
Testing
Make a custom KQL rule and modify the keyword to be upper case and test with view rule.
Example KQL Rule
Output