-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution][Detections] Convert EQL validation to use search strategy #79538
Conversation
These are the same types with a different name. However, the benefit is that they exist in a non-restricted path (the top level of the plugin).
Rather than calling our custom EQL validation endpoint, we can instead leverage the EQL search strategy. The downside is that we have to move our response parsing logic to the frontend, but the benefit is that there's no backend to maintain.
We're keeping our io-ts schemas for now since they're still being used to type the I/O of our client function.
I'm not aware of a way to pass react context to the form lib validator functions, so for now we have to pass this the ugly way :(
We were keeping these around for the types, but they're so simple that it's really not worth the overhead. The tests are similarly for functionality that is no longer used, so no hard feelings there.
We only care about the query's validity, so we can tell the response handler to do less work here.
Without passing transport options to .get, a query with an `ignore` would succeed if it completed in the `waitForCompletionTimeout` window, but fail (with the ignored error) on the subsequent request if it became async.
Pinging @elastic/siem (Team:SIEM) |
Common values cannot be consumed directly by client code (compilation error), so we need to re-export them from data_enhanced's public module.
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.
AppArch changes LGTM
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.
Thanks for helping us search strategy support for EQL Rules! Code looks good. Pull down the branch and tested locally, validation continues to work as expected :)
@@ -4,8 +4,7 @@ | |||
* you may not use this file except in compliance with the Elastic License. | |||
*/ | |||
|
|||
import get from 'lodash/get'; | |||
import has from 'lodash/has'; | |||
import { get, has } from 'lodash'; |
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.
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! 👍 Thanks @rylnd! 🙂
Conflicts: x-pack/plugins/security_solution/public/common/hooks/eql/api.ts x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
distributable file count
page load bundle size
History
To update your PR or re-run it, just comment with: |
…strategy (#79538) (#79806) * Rename types from the top-level plugin These are the same types with a different name. However, the benefit is that they exist in a non-restricted path (the top level of the plugin). * Convert our validation function to use the EQL search strategy Rather than calling our custom EQL validation endpoint, we can instead leverage the EQL search strategy. The downside is that we have to move our response parsing logic to the frontend, but the benefit is that there's no backend to maintain. * Remove server code related to our EQL validation endpoint We're keeping our io-ts schemas for now since they're still being used to type the I/O of our client function. * Add the data contract to our KibanaServices I'm not aware of a way to pass react context to the form lib validator functions, so for now we have to pass this the ugly way :( * Remove io-ts types corresponding to our defunct validation endpoint We were keeping these around for the types, but they're so simple that it's really not worth the overhead. The tests are similarly for functionality that is no longer used, so no hard feelings there. * Ensure that our validation does not bother generating hits We only care about the query's validity, so we can tell the response handler to do less work here. * Pass transport options when retrieving an existing search Without passing transport options to .get, a query with an `ignore` would succeed if it completed in the `waitForCompletionTimeout` window, but fail (with the ignored error) on the subsequent request if it became async. * Use constant for our strategy key * Export search strategy constants for client consumption Common values cannot be consumed directly by client code (compilation error), so we need to re-export them from data_enhanced's public module.
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
common
, as that's now done on the clientChecklist
For maintainers