-
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][Detection Engine] adds alert suppression to ES|QL rule type #180927
[Security Solution][Detection Engine] adds alert suppression to ES|QL rule type #180927
Conversation
# Conflicts: # x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_experimental_feature_fields_transform.ts # x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.test.tsx # x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.tsx # x-pack/test/security_solution_cypress/config.ts
…italiidm/kibana into de_8_15/esql_alert_suppression
x-pack/plugins/security_solution/public/detection_engine/rule_creation/logic/esql_validator.ts
Outdated
Show resolved
Hide resolved
…creation/logic/esql_validator.ts Co-authored-by: Nikita Indik <[email protected]>
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#6011[✅] Security Solution Detection Engine - Cypress: 100/100 tests passed. |
…italiidm/kibana into de_8_15/esql_alert_suppression
# Conflicts: # x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.ts # x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.ts # x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx
…italiidm/kibana into de_8_15/esql_alert_suppression
This reverts commit b13f923.
Flaky Test Runner Stats🟠 Some tests failed. - kibana-flaky-test-suite-runner#6029[❌] Security Solution Detection Engine - Cypress: 74/100 tests passed. |
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.
desk tested and code LGTM for the Threat Hunting Investigations team!
@@ -337,6 +337,7 @@ describe('Detection rules, Prebuilt Rules Installation and Update workflow', () | |||
type: 'esql', | |||
language: 'esql', | |||
query: 'FROM .alerts-security.alerts-default | STATS count = COUNT(@timestamp) BY @timestamp', | |||
alert_suppression: undefined, |
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.
Why not pass a mock alert_suppression
object here and then check that it's rendered like we do for custom query rules?
Also, I think we need to add alert suppression properties in the test plan under "ESQL" here.
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.
added in 8702a48
Encountered a weird rule preview behaviour while doing local testing. Sometimes rule preview displayed different alerts for me after clicking "Refresh". I made a screen recording once it started happening, but I couldn't reproduce it. Not sure if it's a bug and if it's related to rule suppression or not. Perhaps the screen recording might give @vitaliidm a hint on what might be going on. rule_preview.mov |
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.
Reviewed the code with focus on the Rule Management owned files. The changes LGTM. Left a couple comments.
Not enough information to figure out what's going on here. I wasn't able to reproduce
|
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @vitaliidm |
Summary
Demo
host.ip
host.ip
, hence same results_esql.suppression.mov
Limitations
Since suppressed alerts deduplication relies on alert timestamps, sorting of results other than
@timestamp asc
in ES|QL query may impact on number of suppressed alerts, when number of possible alerts more than max_signals.This affects only non-aggregating queries, since suppression boundaries for these alerts set as rule execution time
Checklist
Functional changes are hidden behind a feature flag
Feature flag
alertSuppressionForEsqlRuleEnabled
Functional changes are covered with a test plan and automated tests.
Stability of new and changed tests is verified using the Flaky Test Runner.
Comprehensive manual testing is done by two engineers: the PR author and one of the PR reviewers. Changes are tested in both ESS and Serverless.
Mapping changes are accompanied by a technical design document. It can be a GitHub issue or an RFC explaining the changes. The design document is shared with and approved by the appropriate teams and individual stakeholders.
Existing AlertSuppression schema field is used for ES|QL rule, the one that already used for Query, New terms and IM rules.
where
Functional changes are communicated to the Docs team. A ticket or PR is opened in https://github.com/elastic/security-docs. The following information is included: any feature flags used, affected environments (Serverless, ESS, or both).