-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[SIEM] Import timeline fix #65448
[SIEM] Import timeline fix #65448
Conversation
fix unit tests apply failure checker clean up error message fix update template
86228e2
to
67e7406
Compare
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
Pinging @elastic/siem (Team:SIEM) |
…ne-fix # Conflicts: # x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts
x-pack/plugins/siem/server/lib/timeline/routes/utils/timeline_input.ts
Outdated
Show resolved
Hide resolved
} | ||
|
||
public getVersion() { | ||
return this.version; |
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.
does it support template timelines
?
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.
yes, timeline_input is a generic input for both timeline and template.
When we init this object for template, we send templateTimelineVersion instead of version
https://github.com/angorayc/kibana/blob/af212242578580adf9e460ec7c4db6dd4d2dd01c/x-pack/plugins/siem/server/lib/timeline/routes/update_timelines_route.ts#L58
x-pack/plugins/siem/server/lib/timeline/routes/utils/timeline_input.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/server/lib/timeline/routes/utils/timeline_input.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/server/lib/timeline/routes/create_timelines_route.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/server/lib/timeline/routes/update_timelines_route.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/server/lib/timeline/routes/update_timelines_route.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
Seems that the behaviour of add Note button is as expected. I checked on siem-dev, the add Note is disabled until we type something in the text box. But sure, I'll fix item 2. in another PR. |
Todos in follow up PR: #69972
|
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
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.
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
History
To update your PR or re-run it, just comment with: |
* fix import timeline and clean up fix unit tests apply failure checker clean up error message fix update template * add unit tests * clean up common libs * rename variables * add unit tests * fix types * Fix imports * rename file * poc * fix unit test * review * cleanup fallback values * cleanup * check if title exists * fix unit test * add unit test * lint error * put the flag for disableTemplate into common * add immutiable * fix unit * check templateTimelineVersion only when update via import * update template timeline via import with response * add template filter * add filter count * add filter numbers * rename * enable pin events and note under active status * disable comment and pinnedEvents for template timelines * add timelineType for openTimeline * enable note icon for template * add timeline type for propertyLeft * fix types * duplicate elastic template * update schema * fix status check * fix import * add templateTimelineType * disable note for immutable timeline * fix unit * fix error message * fix update * fix types * rollback change * rollback change * fix create template timeline * add i18n for error message * fix unit test * fix wording and disable delete btn for immutable timeline * fix unit test provider * fix types * fix toaster * fix notes and pins * add i18n * fix selected items * set disableTemplateto true * move templateInfo to helper * review + imporvement * fix review * fix types * fix types Co-authored-by: Patryk Kopycinski <[email protected]> Co-authored-by: Xavier Mouligneau <[email protected]> # Conflicts: # x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts
* fix import timeline and clean up fix unit tests apply failure checker clean up error message fix update template * add unit tests * clean up common libs * rename variables * add unit tests * fix types * Fix imports * rename file * poc * fix unit test * review * cleanup fallback values * cleanup * check if title exists * fix unit test * add unit test * lint error * put the flag for disableTemplate into common * add immutiable * fix unit * check templateTimelineVersion only when update via import * update template timeline via import with response * add template filter * add filter count * add filter numbers * rename * enable pin events and note under active status * disable comment and pinnedEvents for template timelines * add timelineType for openTimeline * enable note icon for template * add timeline type for propertyLeft * fix types * duplicate elastic template * update schema * fix status check * fix import * add templateTimelineType * disable note for immutable timeline * fix unit * fix error message * fix update * fix types * rollback change * rollback change * fix create template timeline * add i18n for error message * fix unit test * fix wording and disable delete btn for immutable timeline * fix unit test provider * fix types * fix toaster * fix notes and pins * add i18n * fix selected items * set disableTemplateto true * move templateInfo to helper * review + imporvement * fix review * fix types * fix types Co-authored-by: Patryk Kopycinski <[email protected]> Co-authored-by: Xavier Mouligneau <[email protected]> # Conflicts: # x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts
* master: (59 commits) [Lens] Fix broken test (elastic#70117) [SIEM] Import timeline fix (elastic#65448) [SECURITY SOLUTION][INGEST] UX update for ingest manager edit/create datasource for endpoint (elastic#70079) [Telemetry] Collector Schema (elastic#64942) [Endpoint] Add Endpoint empty states for onboarding (elastic#69626) Hide unused resolver buttons (elastic#70112) [Security] `Investigate in Resolver` Timeline Integration (elastic#70111) [Discover] Improve styling of graphs in sidebar (elastic#69440) [Metrics UI] Fix EuiTheme type issue (elastic#69735) skip failing suite (elastic#70104) (elastic#70103) [ENDPOINT] Hide the Timeline Flyout while on the Management Pages (elastic#69998) [SIEM][CASE] Persist callout when dismissed (elastic#68372) [SIEM][Exceptions] - Cleaned up and updated exception list item comment structure (elastic#69532) [Maps] remove indexing state from redux (elastic#69765) Add API integration test for deleting data streams. (elastic#70020) renames SIEM to Security Solution (elastic#70070) Adding saved_objects_page in OSS (elastic#69900) [Lens] Use accordion menus in field list for available and empty fields (elastic#68871) Dynamic uiActions & license support (elastic#68507) [SIEM] Update readme for timeline apis (elastic#67038) ...
…bana into alerting/consumer-based-rbac * 'alerting/consumer-based-rbac' of github.com:gmmorris/kibana: (25 commits) [Lens] Fix broken test (elastic#70117) [SIEM] Import timeline fix (elastic#65448) [SECURITY SOLUTION][INGEST] UX update for ingest manager edit/create datasource for endpoint (elastic#70079) [Telemetry] Collector Schema (elastic#64942) [Endpoint] Add Endpoint empty states for onboarding (elastic#69626) Hide unused resolver buttons (elastic#70112) [Security] `Investigate in Resolver` Timeline Integration (elastic#70111) [Discover] Improve styling of graphs in sidebar (elastic#69440) [Metrics UI] Fix EuiTheme type issue (elastic#69735) skip failing suite (elastic#70104) (elastic#70103) [ENDPOINT] Hide the Timeline Flyout while on the Management Pages (elastic#69998) [SIEM][CASE] Persist callout when dismissed (elastic#68372) [SIEM][Exceptions] - Cleaned up and updated exception list item comment structure (elastic#69532) [Maps] remove indexing state from redux (elastic#69765) Add API integration test for deleting data streams. (elastic#70020) renames SIEM to Security Solution (elastic#70070) Adding saved_objects_page in OSS (elastic#69900) [Lens] Use accordion menus in field list for available and empty fields (elastic#68871) Dynamic uiActions & license support (elastic#68507) [SIEM] Update readme for timeline apis (elastic#67038) ...
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
This PR is to allow template timeline updated via import,
and fix the case we had in #64439
How to verify this PR:
Error cases:
Import a new timeline (Create timeline via import)
timelineId
has to be null / empty or a timelineId that doesn't exist in SO - if given a timelineId that's already exist, therefor throwing error: savedObjectId: "${id}" already existstitle
must have - if not given, throw error: Title cannot be emptytimelineType
has to be null / default or not specified - if set to template, I'll assume it is trying to create a templatestatus
has to be null / 'active' or not specified - we don't expose this field to exported file. So far we do not block the 'immutable' status as we need that when installing Elastic template. Ifstatus
is given as draft, throw error Cannot create a draft timelineImport an existing timeline (Update existing timeline via import)
Import a new template (Create custom template via import)
templateTimelineId
has to be given a uuid that doesn't exist in SO, if given a timelineId that's already exist, therefor throwing error: savedObjectId: "${id}" already exists; if not given a templateTimelineId, throw error: Create template timeline without a template timeline ID is not allowedtitle
must have - if not given, throw error: Title cannot be emptytimelineType
has to be template - if set to others, I'll assume it is trying to create a default timelinestatus
has to be null / 'active' or not specified - we don't expose this field to exported file. So far we do not block the 'immutable' status as we need that when installing Elastic template. Ifstatus
is given as draft, throw error Cannot create a draft timelineImport an existing template
timelineType
has to be the same as existing template timeline, otherwise throw error: 'Update timelineType is not allowed'status
has to be the same as existing template timeline. Otherwise throw error Update status is not allowedtemplateTimelineId
has to be given a uuid that matches an exist in SO.if given a timelineId that's not exist, therefor throwing error: CREATE template timeline with PATCH is not allowed, please use POST instead (Given template timeline doesn't exist)Checklist
Delete any items that are not applicable to this PR.
Documentation was added for features that require explanation or tutorialsThis was checked for keyboard-only and screenreader accessibilityThis renders correctly on smaller devices using a responsive layout. (You can test this in your browserThis was checked for cross-browser compatibility, including a check against IE11For maintainers
This was checked for breaking API changes and was labeled appropriately