-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
ESQL searches only case-sensitive #107
Comments
Please note I have incurred another big problem with LIKE operators in ESQL: We definitely need to do some work on this project here to make Sigma fully work with ESQL. |
Oh my...Elastic case-sensitiveness really drives me crazy 🙁 Just to clarify, this:
Is falsified by your insights, correct?
|
Hi Thomas, unfortunately the statement
is true and also confirmed my results from the little experiment. The only case-insensitive operator that I have found in Since the Elastic-support wrote that I agree with you, this topic is a real pain :( Anyways, happy new year in advance :) |
Hi, I wanted to share the latest information from the Elastic Support regarding ESQL:
Given the lack of alternatives, I have begun updating the ESQL backend to incorporate these functions (you can find the progress here: https://github.com/Mat0vu/pySigma-backend-elasticsearch/tree/case-insensitive-esql). This still requires some additional work and will contain a lot of changes because all unit tests must also be revised to accommodate the need for lowercase search strings. It is probably needed to include a warning indicating that ESQL may not be the best option for basic search operations and that users are encouraged to consider alternative languages when possible. Especially if the rule does not exclusively utilize the |
Hi everyone,
last week I discovered some issues regarding case-insensitive search in Elasticsearch using
ESQL
.I was testing something with a very simple rule, trying to find a commandline containing
git.exe
:which resulted in
... | where process.command_line Like "*git.exe*"
(using the ecs pipeline) and was working as expected until I´ve changed the search term for*Git.exe*
. With this there was no hit using ESQL.In the ecs documentation I found that the regular
process.command_line
is of type keyword but contains a.text
subfield which should be case-insensitive. So I did some experiments with both fields and using ESQL in comparison to KQL..text
subfield is case-insensitive forKQL
;ESQL
is still case-sensitiveI was expecting that when I use the
.text
subfield I would also find something with ESQL, because the field should allow for case-insensitive searches but this was not the case.After some digging in the github repo of Elastic I found out that they had case-insensitive operators implemented for ESQL but they were disabled again and there doesn´t seem to be any current developments (elastic/elasticsearch#105603).
We got in contact with the support to check how we can get a case-insensitive search behaviour using ESQL and got the feedback that:
like
andrlike
operators are case-sensitive inESQL
TO_LOWER
orTO_UPPER
function in combination with a lower-case/upper-case search term, e.g. to matchIntelliJ
one could use... | Where TO_LOWER(process.command_line) Like "*intellij*"
I tested this approach and it is working although I think it is not very nice to need such a function.
To sum it up, currently the
ESQL
backend is searching case-sensitive which is not following the sigma specification to treat all strings as case-insensitive and it will lead to missed detections.Probably the only way to get case-insensitive behaviour is by following the suggestion from the support and implement these functions in the backend. What do you think?
The text was updated successfully, but these errors were encountered: