Skip to content
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

[Detection Engine][Rule Suppression] Disable EQL sequence suppression #178531

Conversation

WafaaNasr
Copy link
Contributor

@WafaaNasr WafaaNasr commented Mar 12, 2024

Summary

  • UI:
DisableSequenceEqlsuppression.mov

TODO:

WafaaNasr and others added 30 commits February 7, 2024 14:39
WafaaNasr and others added 5 commits March 22, 2024 18:04
…sequence

 Conflicts:
	x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx
	x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/eql.ts
	x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/event_correlation_rule_suppression_ess_basic.cy.ts
It's official, we've now got way too much happening in this component!
At its core, this is driven by `useFormData` (as I think a lot of
complexity in this form could be):

* We use the current, updated value of `queryBar`, along with the
  `groupByFields`, to determine whether the suppression fields should be
  disabled. The core logic here is the same as before.
* We move the _validity_ of the groupByFields field into the form
  validations. Again, the logic here is the same, but it's now done a)
  only when the relevant fields change, and b) without the need for
  manually calling `validateFields` or `setFieldErrors`.

Other notes:
* Adds an `isEqlSequenceQuery` helper for explicitness.
* Removes callback hook from query bar, since we now get this info
  directly from the form.
@rylnd
Copy link
Contributor

rylnd commented Apr 5, 2024

/ci

@rylnd
Copy link
Contributor

rylnd commented Apr 5, 2024

/ci

These were duplicated since their inception, but CI was never run so it
wasn't caught until now.
@rylnd
Copy link
Contributor

rylnd commented Apr 5, 2024

/ci

@rylnd rylnd self-assigned this Apr 5, 2024
@rylnd
Copy link
Contributor

rylnd commented Apr 5, 2024

/ci

rylnd added 2 commits April 5, 2024 15:38
Removes tests around deleted prop, fixes imports
@rylnd rylnd force-pushed the eql-suppression-disable-sequence branch from 21fec57 to 0d1b024 Compare April 5, 2024 20:40
@rylnd
Copy link
Contributor

rylnd commented Apr 5, 2024

/ci

@rylnd
Copy link
Contributor

rylnd commented Apr 8, 2024

/ci

rylnd added 2 commits April 8, 2024 17:52
This one snuck through the myriad merges/conflict resolutions on this
branch.
@rylnd
Copy link
Contributor

rylnd commented Apr 9, 2024

/ci

rylnd added 3 commits April 8, 2024 22:35
input

This tooltip was previously wrapping several form fields (all of those
related to alert suppression, which:

1. Caused strange UX when attempting to hover disabled elements
  * Because many EUI disabled elements have `pointer-events: none`, you
    could only trigger the tooltip in certain areas of the form
  * I suspect there might've been some interaction with nested tooltips,
    where if you hovered the inner, the outer would also open and they
    would cancel each other out.
2. Caused existing cypress tests around suppression tooltips to fail,
   mainly due to the above.

For these reasons, I've limited the scope of this tooltip to only show
on hover of the alert suppression (group by) input, which is both more
consistent and much more robust, UX-wise.

The only downside here is that if you're on a basic license AND you type
a sequence query, you'll get one of the two tooltips depending on where
you hover, but that was already the case before this.
…abled"

This reverts commit f974273.

See previous commit about our fixing of the tooltip.
@rylnd
Copy link
Contributor

rylnd commented Apr 9, 2024

/ci

@kibana-ci
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [6a729ea]

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @rylnd @WafaaNasr

@rylnd rylnd merged commit 8e3b753 into elastic:security/eql-suppression Apr 9, 2024
34 of 35 checks passed
@rylnd
Copy link
Contributor

rylnd commented Apr 9, 2024

This is green as of the latest commit (ignoring the merge-base issue with CI); this is now merged into the main branch: #176422

rylnd added a commit that referenced this pull request Apr 17, 2024
…nce based queries (#176422)

# Summary

- Address adding suppression to EQL rules
https://github.com/elastic/security-team/issues/7773
- Milestone details https://github.com/elastic/security-team/issues/8432

## Checklist
- [x] Functional changes are hidden behind a feature flag. If not
hidden, the PR explains why these changes are being implemented in a
long-living feature branch.
- [x] Functional changes are covered with a test plan and automated
tests. [Test plan](https://github.com/elastic/security-team/pull/9155)
- [ ] Stability of new and changed tests is verified using the [Flaky
Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner) in
both ESS and Serverless. By default, use 200 runs for ESS and 200 runs
for Serverless.
* Cypress ESS:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5686
* Cypress Serverless:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5687
* FTR ESS:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5688
* FTR Serverless:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5689
- [x] 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.
- [x] 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.
- [ ] (OPTIONAL) OpenAPI specs changes include detailed descriptions and
examples of usage and are ready to be released on
https://docs.elastic.co/api-reference. NOTE: This is optional because at
the moment we don't have yet any OpenAPI specs that would be fully
"documented" and "GA-ready" for publishing on
https://docs.elastic.co/api-reference.
- [x] Functional changes are communicated to the Docs team. A ticket is
opened in https://github.com/elastic/security-docs using the [`Internal
documentation request (Elastic
employees)`](https://github.com/elastic/security-docs/issues/new?assignees=&labels=&projects=&template=docs-request-internal.yaml&title=%5BRequest%5D+)
template. The following information is included: feature flags used,
target ESS version, planned timing for ESS and Serverless releases.
- [x] Check if in timeline we can show the suppression count column when
the user clicks on investigate on timeline for Eql suppressed Alerts
(#180976)

## Related Issues
* Sub-PRs
- Address EQL schema changes PR
#176391
- Adding Feature flag PR and updating the Frontend Part in Rule
Create/Edit #176398
- Adding Backend changes and FTR tests
#176597
- Fix Investigate in Timeline for the Suppressed Alerts
#177839
- Add Cypress e2e tests #177870
- Disable EQL sequence suppression in the UI and fix Cypress `after`
esArchive path #178531
- Docs Issue elastic/security-docs#4977
- Test plan https://github.com/elastic/security-team/pull/9155

## Screenshots/recordings

### Non-Sequence Suppression

1. Rule creation, Suppression based on a single value


https://github.com/elastic/kibana/assets/12671903/8d168bce-15d3-45c2-a5dc-238b3ac01626

2. Rule creation, Suppression based on an array of values
  

https://github.com/elastic/kibana/assets/12671903/0e3312a9-4eae-476b-9c1e-c68189bbaf95

3. Investigate In Timeline


https://github.com/elastic/kibana/assets/12671903/e10c8668-4d5b-4748-b8a1-678603b4a8a5


### Disabled Sequence Suppression

1. UI


https://github.com/elastic/kibana/assets/12671903/01faa649-ca8b-43e4-a398-42ab242e7a72

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants