-
Notifications
You must be signed in to change notification settings - Fork 525
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] Query validation failing to capture InSet edge case with ip field types #3572
[Bug] Query validation failing to capture InSet edge case with ip field types #3572
Conversation
…-inset-edge-case-with-ip-field-types
It will be good to double check if this is an issue with just up types or the inSet function. I thought the original issue was that the field type have to match the value types in the set. If this is the case, the solution may be less about IPs and more about matching types. |
…-inset-edge-case-with-ip-field-types
…-inset-edge-case-with-ip-field-types
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.
@eric-forte-elastic can you add a unit test to demonstrate when this should / should not fail?
Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
…-inset-edge-case-with-ip-field-types
…-inset-edge-case-with-ip-field-types
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.
LGTM
…-inset-edge-case-with-ip-field-types
🟢 Manual Test Looks Good.
|
…-inset-edge-case-with-ip-field-types
…-inset-edge-case-with-ip-field-types
…-inset-edge-case-with-ip-field-types
…-inset-edge-case-with-ip-field-types
…-inset-edge-case-with-ip-field-types
Issues
#3540
Summary
This PR addresses an issue where the eql library's
inSet
method does not catch a type comparison mismatch that will cause an error in Kibana over the "IP" type (see the issue for more detail). This PR wraps theLarkToEQL.in_set
method with a custom in set method that supports this comparison and adds an Extended Type hint enum to provide the IP type.Thanks @Mikaayenson for the great patches and discussion in the issue! 🙇
Testing
Modify a rule such as
rules/windows/execution_scheduled_task_powershell_source.toml
that hasdestination.address
to instead readdestination.ip
. After doing this run view rule on this modified rule. Originally, this would not result in an error. This PR addresses the issue if this does result in an error.Added unit test should also look to catch this.