[SIEM][Exceptions] - Cleaned up and updated exception list item comment structure#69532
Merged
yctercero merged 16 commits intoelastic:masterfrom Jun 26, 2020
Merged
[SIEM][Exceptions] - Cleaned up and updated exception list item comment structure#69532yctercero merged 16 commits intoelastic:masterfrom
yctercero merged 16 commits intoelastic:masterfrom
Conversation
…void empty comments
yctercero
commented
Jun 18, 2020
| t.array(commentPartial).is, | ||
| (input, context): Either<t.Errors, CommentsPartialArray> => | ||
| input == null ? t.success([]) : t.array(commentPartial).validate(input, context), | ||
| t.array(comments).is, |
Contributor
Author
There was a problem hiding this comment.
NOTE: Previously had the different comment schemas all in one doc, but started to feel really messy. Broke out into their own docs, tests, and mocks.
Contributor
|
Pinging @elastic/siem (Team:SIEM) |
peluja1012
reviewed
Jun 24, 2020
| if (validatedRequest != null) { | ||
| try { | ||
| const response = await http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_URL, { | ||
| const response = await http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_ITEM_URL, { |
peluja1012
approved these changes
Jun 24, 2020
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
History
To update your PR or re-run it, just comment with: |
yctercero
added a commit
to yctercero/kibana
that referenced
this pull request
Jun 26, 2020
…nt structure (elastic#69532) ### Summary This PR is a follow up to elastic#68864 . That PR used a partial to differentiate between new and existing comments, this meant that comments could be updated when they shouldn't. It was decided in our discussion of exception list schemas that comments should be append only. This PR assures that's the case, but also leaves it open to editing comments (via API). It checks to make sure that users can only update their own comments.
rylnd
added a commit
to rylnd/kibana
that referenced
this pull request
Jun 26, 2020
* master: 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)
yctercero
added a commit
that referenced
this pull request
Jun 26, 2020
…nt structure (#69532) (#70107) ### Summary This PR is a follow up to #68864 . That PR used a partial to differentiate between new and existing comments, this meant that comments could be updated when they shouldn't. It was decided in our discussion of exception list schemas that comments should be append only. This PR assures that's the case, but also leaves it open to editing comments (via API). It checks to make sure that users can only update their own comments.
gmmorris
added a commit
to gmmorris/kibana
that referenced
this pull request
Jun 29, 2020
* 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) ...
gmmorris
added a commit
to gmmorris/kibana
that referenced
this pull request
Jun 29, 2020
…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) ...
Contributor
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is a follow up to #68864 . That PR used a partial to differentiate between new and existing comments, this meant that comments could be updated when they shouldn't. It was decided in our discussion of exception list schemas that comments should be append only. This PR assures that's the case, but also leaves it open to editing comments (via API). It checks to make sure that users can only update their own comments.
Created 3 different schemas for comments, during creation, should only accept comments of following schema:
Saved comments must be of the following schema:
Much of the added logic deals with updating comments (PUT), the exception list item
commentscan include a mix of the two above schemas, but the added logic ensures that:updated_atandupdated_bycreated_at, andcreated_byLooking over the tests is helpful in understanding the logic, and may help you help me find any logic I've missed. 😄
I chose to separate out the different schemas into their own files to maintain readability and maintainability. It looked a little icky when putting everything into one file.
Testing
I added unit tests to confirm the logic, but also used the existing scripts.
To turn on lists plugin - in kibana.dev.yml
Use the scripts in
x-pack/plugins/lists/server/scriptsto create some sample exception lists and items. You can use the following:./post_exception_list.sh./post_exception_list_item.sh./update_exception_list_item.shYou can update the scripts to try different edge cases (deleting comments, updating different user comments, etc).
If you want to view the comments in the UI:
./find_exception_lists.shto get the id of the two lists you createdExceptionsViewercomponent inx-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsxto something like the following:Navigate to the rules details page and click on the 'Exceptions' tab. Voila!
Checklist
Delete any items that are not applicable to this PR.
For maintainers
(It is a breaking change, however this API is not yet public and behind feature flag, only devs working on this feature would be affected)