-
Notifications
You must be signed in to change notification settings - Fork 516
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
[Rule Tuning] EQL bugs using regex and backslashes (Windows Paths) #2260
Comments
@w0rk3r I had a question about the expected solution. Are you expecting to get rid of regex to work around for the bug/breaking change discussed in the SDH? |
Yeah, as it seems to be a no-fix, and our use here is to exclude paths, I'll replace the regex expressions with wildcards or just an OR condition on |
hello team! it's been a while 😉 As long as you use It looks like there are a lot of issues here that are linked but not public so I can't grasp the full context. Everything I can see points to Is there any (public) documentation for how this breaks existing rules? All the existing rules should be using |
Thanks @rw-access, that sounds spot on! I did a review of all existing rules using ...
winlog.event_data.AttributeValue regex~ "[0-9]{15}([1-9a-f]).*"
... The original source of the issue was centered around custom rules, which were not triple quoting. I think we can close #2284 with no further action beyond continuing to ensure proper syntax in our own rules |
Yeah, just validated our cases and seems there are really no issues on them (sorry and thanks!)... But the initial bug was something like this, but using single quotes: Query:
I suggested using triple quotes: Which doesn't throw any error, but doesn't match the condition neither: When I use a single backslach for
Any clues around this? |
not sure about the exception to be honest. it does look like you have also, keep in mind that it will have different results for different versions of Lucene and Elasticsearch because you could also do |
I'm doing some more testing, and seems that the problem is that I can't use Wdyt, is this a bug that we should track somewhere? I'm working with the docs team to adjust this to be more precise about the bug we got on the SDH, how should we report this? @rw-access @brokensound77 |
Personally, I would switch to |
@luigidellaquila I just tested the following query in a new 8.4.1 and got the same error:
Diving a bit more, I just saw that it works normal with |
@w0rk3r yes, the problem seems to be specific to wildcard fields. |
@w0rk3r I can confirm that the problem happens specifically on wildcard fields.
the query works fine if I think I found the problem in the code and a possible fix, I'll keep you updated |
Hi all, the PR with the fix was just merged on main branch (8.5) |
Awesome, I'll keep this one open until we have the BC for testing. @nastasha-solomon I think @luigidellaquila may give you a better picture of the bug/limitation to get elastic/security-docs#2337 right, let me know if any input from my side is needed. |
Already worked with Nastasha and Luigi via Slack to get the bug properly documented, so I'm closing this as completed. |
Rules affected
Description
A change in Lucene seems to break the usage of
\
in regex conditions and marked as a no-fix, so we need to adjust the logic of these rules accordindly. The impact is low, as these regex conditions are used as exceptions on our rules and not the main logic, but they can cause FPs.The use of triple quotes seems to prevent the rule from throwing a error, but the regex will not working based on my testing.
SDH issue for context.
The text was updated successfully, but these errors were encountered: