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

[Security Solution][Exceptions][Builder] -Move exception builder entry item exceptions ui over to lists #94515

Merged
merged 5 commits into from
Mar 26, 2021

Conversation

yctercero
Copy link
Contributor

@yctercero yctercero commented Mar 12, 2021

Summary

Beginning to move the exceptions UI out of the security solution plugin and into the lists plugin. In order to keep PRs (relatively) small, I plan to move single components at a time. This should also then help more easily pinpoint the source of any issues that come up along the way.

The next couple PRs will focus on the exception builder. This one in particular is focused on moving over the BuilderEntryItem which deals with rendering the individual exception item entries. An entry can be of type match, match_any, list, exists, or nested. The component makes use of the autocomplete fields which use the index patterns to display possible fields and field values.

One of the decisions made in this PR was to have consumers of the BuilderEntryItem pass through the autocomplete service as opposed to the lists plugin adding it as a dependency. The reason being that it is likely that plugins using the lists plugin will already be consuming either the data plugin or if alerting takes exceptions in, then they'll be consuming alerting. In an effort to avoid some possible icky circular dependency issues, though it best to make the service passed in, as we had already been doing with the hooks in the lists plugin.

Quick Summary:

  • x-pack/plugins/security_solution/public/common/components/exceptions/builder/entry_item.tsx x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx
    • Corresponding unit test file moved as well
    • Updated security solution exception builder to pull BuilderEntryItem from lists plugin
  • Copied x-pack/plugins/security_solution/public/common/components/autocomplete/ to x-pack/plugins/lists/public/exceptions/components/autocomplete/
    • As these components are also used in non exceptions flows in security solution, did not remove there
    • Working on creating an issue to see if these components can be taken up by EUI (reached out to the team and they suggested this as a first step)
    • Unskips cypress exceptions modal test
Entry Item (THIS PR DEALS WITH 👇🏽)

Screen Shot 2021-03-14 at 11 31 04 PM

Exception Item

Screen Shot 2021-03-14 at 11 32 15 PM

Builder Buttons

Screen Shot 2021-03-14 at 11 32 39 PM

Exception Item Comments

Screen Shot 2021-03-14 at 11 33 11 PM

Builder Modal

Screen Shot 2021-03-14 at 11 33 30 PM

Notes

  • There may still be work to do to get the component working for all use cases, however, for the moment being, concentrating on moving existing functionality over
  • The autocomplete components that were moved into the lists plugin here I think could live elsewhere. Personally, I think it'd be best if they were components that EUI supported as they are consumed in numerous other places within the security app. To avoid disrupting these other consumers, I did a copy paste of them for now to be used by the lists plugin. [EUI][Data] - Add index field selectors to EUI or Data #94875

Testing

Prior to making these changes, added a number of tests to ensure coverage of existing functionality. For manual testing, please checkout PR and play around with the following:

  • Add/edit an exception item
    • if an existing item, make sure that it populates as expected in the modal
  • Add/edit different entry types like match, match_any, nested etc.
  • Play around with the component in storybook

Checklist

@yctercero yctercero changed the title [Security Solution][Exceptions] -Move exception builder entry item exceptions ui over to lists [Security Solution][Exceptions][Builder] -Move exception builder entry item exceptions ui over to lists Mar 15, 2021
@yctercero yctercero self-assigned this Mar 15, 2021
@yctercero yctercero added release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detections and Resp Security Detection Response Team v7.13.0 v8.0.0 labels Mar 17, 2021
@yctercero yctercero marked this pull request as ready for review March 23, 2021 16:22
@yctercero yctercero requested review from a team as code owners March 23, 2021 16:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lists 134 149 +15
securitySolution 2209 2204 -5
total +10

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.2MB 7.2MB -26.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
lists 135.5KB 176.6KB +41.1KB

History

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

cc @yctercero

Copy link
Contributor

@dplumlee dplumlee left a comment

Choose a reason for hiding this comment

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

Already added review to builder pr but this section of it looks like it works good with all manual testing 👍

@yctercero yctercero merged commit 2aae753 into elastic:master Mar 26, 2021
yctercero added a commit to yctercero/kibana that referenced this pull request Mar 26, 2021
…y item exceptions ui over to lists (elastic#94515)

## Summary

Beginning to move the exceptions UI out of the security solution plugin and into the lists plugin. In order to keep PRs (relatively) small, I plan to move single components at a time. This should also then help more easily pinpoint the source of any issues that come up along the way.

The next couple PRs will focus on the exception builder. This one in particular is focused on moving over the `BuilderEntryItem` which deals with rendering the individual exception item entries. An entry can be of type `match`, `match_any`, `list`, `exists`, or `nested`. The component makes use of the autocomplete fields which use the index patterns to display possible fields and field values. 

One of the decisions made in this PR was to have consumers of the `BuilderEntryItem` pass through the autocomplete service as opposed to the `lists` plugin adding it as a dependency. The reason being that it is likely that plugins using the lists plugin will already be consuming either the data plugin or if alerting takes exceptions in, then they'll be consuming alerting. In an effort to avoid some possible icky circular dependency issues, though it best to make the service passed in, as we had already been doing with the hooks in the `lists` plugin.
yctercero added a commit that referenced this pull request Mar 27, 2021
…y item exceptions ui over to lists (#94515) (#95585)

## Summary

Beginning to move the exceptions UI out of the security solution plugin and into the lists plugin. In order to keep PRs (relatively) small, I plan to move single components at a time. This should also then help more easily pinpoint the source of any issues that come up along the way.

The next couple PRs will focus on the exception builder. This one in particular is focused on moving over the `BuilderEntryItem` which deals with rendering the individual exception item entries. An entry can be of type `match`, `match_any`, `list`, `exists`, or `nested`. The component makes use of the autocomplete fields which use the index patterns to display possible fields and field values. 

One of the decisions made in this PR was to have consumers of the `BuilderEntryItem` pass through the autocomplete service as opposed to the `lists` plugin adding it as a dependency. The reason being that it is likely that plugins using the lists plugin will already be consuming either the data plugin or if alerting takes exceptions in, then they'll be consuming alerting. In an effort to avoid some possible icky circular dependency issues, though it best to make the service passed in, as we had already been doing with the hooks in the `lists` plugin.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@yctercero yctercero deleted the rac_exceptions_ui branch October 13, 2021 06:27
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:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants