Skip to content

Comments

[9.1] [Security Solution][THI] Create hook to fetch security default patterns and replace useTimelineFilters usage (#226314)#227307

Merged
kibanamachine merged 1 commit intoelastic:9.1from
kibanamachine:backport/9.1/pr-226314
Jul 9, 2025
Merged

[9.1] [Security Solution][THI] Create hook to fetch security default patterns and replace useTimelineFilters usage (#226314)#227307
kibanamachine merged 1 commit intoelastic:9.1from
kibanamachine:backport/9.1/pr-226314

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 9.1:

Questions ?

Please refer to the Backport tool documentation

…ns and replace useTimelineFilters usage (elastic#226314)

## Summary

Ref: elastic#225925,
elastic#226312

This PR creates a hook to return the id and index patterns of the
security default data view. This is the default indices specified in
advanced settings plus alert index. They are meant to be static across
sessions, versus the `SourcererScopeName.default` is based on the data
view selected in the data view picker.

Additionally, there are features that require security default patterns.
It was previously done via `useTimelineFilters`, but it relies on the
analyzer scope - when user changes the data view in analyzer, features
like the prevalence table, ancestry correlations and entity analytic
flyouts are impacted.

Changes inclue:
- Created a `useSecurityDefaultPatterns` hook in data view manager
- Removed `selectedPatterns` in `useTimelineFilters`
- Replaced the index patterns with the security default patterns where
applicable
- Renamed some variables to be more explicit, and separate from the
patterns return based on `SourcererScopeName.default`

Enable `newDataViewPickerEnabled`

### After

Investigating an event always opens timeline with the default security
data view. Opening a timeline from timelines page should have the
specified data view

https://github.com/user-attachments/assets/5ea88e6e-0266-4b6b-802e-5c299c03b894

Changing data view in analyzer does not change the results observed host
table

https://github.com/user-attachments/assets/33646b24-8235-4740-975f-a423f2dcfd3f

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 73e1264)
@kibanamachine kibanamachine merged commit d3365e6 into elastic:9.1 Jul 9, 2025
16 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] x-pack/platform/test/alerting_api_integration/security_and_spaces/group1/config.ts / alerting api integration security and spaces enabled Alerts - Group 1 alerts rule gaps get gaps summary by rule ids superuser at space1 get gaps summary by rule ids (superuser at space1) should return gaps summary for multiple rules

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 7827 7828 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 9.8MB 9.8MB +1.5KB

cc @christineweng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants