forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Classify EQL verification and ML job missing erro…
…rs as user errors (elastic#180094) ## Summary Building on elastic#180040 Detection rules commonly fail when prebuilt rules are imported and enabled without the appropriate indices (for EQL) or ML jobs (for ML rules). EQL rules fail with a `verification_exception` because the EQL search API validates the fields in the search request against the indices in the request; if there are no indices then it returns an exception. ML rules fail with a `<job name> missing` exception on the search request if the job is not found. Both of these errors do not mean that the system is overloaded or performing incorrectly in some way, but they are still showing up in large volumes on SLO dashboards. This PR builds on elastic#180040, which introduces the ability to classify errors as "user errors" when the error is not due to some kind of system malfunction, but more related to incorrect (or insufficient) user actions. ### Testing #### EQL 1. Create 2 indices, `test` and `test2` ``` PUT /test { "mappings": { "properties": { "@timestamp": { "type": "date" } } } } PUT /test2 { "mappings": { "properties": { "@timestamp": { "type": "date" }, "event.category": { "type": "keyword" } } } } ``` 2. Create (disabled) an EQL rule that queries `test*` and uses a simple query like `file where true` 3. Delete the index `test2` 4. Enable the rule. The rule will fail with a `verification_exception` because `test` does not have `event.category`. 5. Use your favorite debugging method to verify that `userError` was `true` in `addLastRunError` in `x-pack/plugins/alerting/server/monitoring/rule_result_service.ts` (hopefully this property will be added to the rule SO so we can check it there in API integration tests) #### ML rules 1. Import a prebuilt ML rule (`Unusual Process Spawned by a User`, for example) 2. Enable the rule. The rule will fail with `An error occurred during rule execution: message: "problem_child_rare_process_by_user missing"` 3. Use your favorite debugging method to verify that `userError` was `true` in `addLastRunError` in `x-pack/plugins/alerting/server/monitoring/rule_result_service.ts` (hopefully this property will be added to the rule SO so we can check it there in API integration tests)
- Loading branch information
1 parent
8ef7deb
commit 9242afb
Showing
10 changed files
with
217 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.