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

[SecuritySolution] override timerange for prebuilt templates #82468

Merged
merged 19 commits into from
Nov 16, 2020

Conversation

angorayc
Copy link
Contributor

@angorayc angorayc commented Nov 3, 2020

Summary

Problem:
The timerange of Elastic prebuilt templates are fixed, plus they are immutable from UI, so users cannot change them when needed. It's not useful so we are fixing it in this PR.

Solution is to override the timerange when installing the templates to 24 hours ago to now, so when users duplicate the template,
they will get the same timerange.

Also when user clicking on the prebuilt timelines, we override it again to 24 hours ago to now.

Steps to verify:

  1. Go to kibana/x-pack/plugins/security_solution/server/lib/detection_engine/scripts
  2. sh ./timelines/delete_all_timelines.sh to delete all the timelines and templates
  3. Landing on timelines page, templates tab, and click on each prebuilt templates.
  4. Checking if the timerange is set to 24hours ago to now in the datepicker in flyout.
  5. Try duplicate a prebuilt template, and make sure the time range you have is 7days ago to now.

Checklist

Delete any items that are not applicable to this PR.

@angorayc angorayc added Team:Threat Hunting Security Solution Threat Hunting Team v7.10.1 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. labels Nov 3, 2020
@angorayc
Copy link
Contributor Author

angorayc commented Nov 4, 2020

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

angorayc commented Nov 4, 2020

@elasticmachine merge upstream

@angorayc angorayc marked this pull request as ready for review November 5, 2020 17:35
@angorayc angorayc requested review from a team as code owners November 5, 2020 17:35
@angorayc angorayc added the release_note:skip Skip the PR/issue when compiling release notes label Nov 5, 2020
@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@patrykkopycinski
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@patrykkopycinski patrykkopycinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @angorayc! Tested locally and everything seems to be working fine :)

…pen_timeline/helpers.ts

Co-authored-by: Patryk Kopyciński <[email protected]>
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 7.9MB 7.9MB +1.6KB

History

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

@angorayc angorayc merged commit 7b49658 into elastic:master Nov 16, 2020
angorayc added a commit to angorayc/kibana that referenced this pull request Nov 16, 2020
…#82468)

* override timerange for prebuilt templates

* add unit test

* add unit tests

* make sure it is template

* check timelineType

* overwrite prebuilt template's timerange

* update mock path

* override with relative timerange

* Update x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts

Co-authored-by: Patryk Kopyciński <[email protected]>

* review

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Patryk Kopyciński <[email protected]>
angorayc added a commit to angorayc/kibana that referenced this pull request Nov 16, 2020
…#82468)

* override timerange for prebuilt templates

* add unit test

* add unit tests

* make sure it is template

* check timelineType

* overwrite prebuilt template's timerange

* update mock path

* override with relative timerange

* Update x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts

Co-authored-by: Patryk Kopyciński <[email protected]>

* review

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Patryk Kopyciński <[email protected]>
angorayc added a commit that referenced this pull request Nov 16, 2020
…#83453)

* override timerange for prebuilt templates

* add unit test

* add unit tests

* make sure it is template

* check timelineType

* overwrite prebuilt template's timerange

* update mock path

* override with relative timerange

* Update x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts

Co-authored-by: Patryk Kopyciński <[email protected]>

* review

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Patryk Kopyciński <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Patryk Kopyciński <[email protected]>
angorayc added a commit that referenced this pull request Nov 17, 2020
…82468) (#83454)

* [SecuritySolution] override timerange for prebuilt templates (#82468)

* override timerange for prebuilt templates

* add unit test

* add unit tests

* make sure it is template

* check timelineType

* overwrite prebuilt template's timerange

* update mock path

* override with relative timerange

* Update x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts

Co-authored-by: Patryk Kopyciński <[email protected]>

* review

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Patryk Kopyciński <[email protected]>

* add limits

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Patryk Kopyciński <[email protected]>
phillipb added a commit to phillipb/kibana that referenced this pull request Nov 19, 2020
…ode-details

* 'master' of github.com:elastic/kibana:
  Remove dependency of tests on strict SyntaxKind values (elastic#83440)
  [SecuritySolution] override timerange for prebuilt templates (elastic#82468)
  [Enterprise Search] Added a shouldShowActiveForSubroutes option (elastic#83338)
  [Lens] Make the dimension flyout panel stay close on outside click (elastic#83059)
  [Security Solution] Gracefully handle errors in detection rules install (elastic#83306)
  Fix advanced settings category sorting (elastic#83394)
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 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v7.10.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants