-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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][Exceptions] - ExceptionsViewer UI component part 2 #68294
Conversation
…to exceptions-viewer-2
@@ -5,6 +5,8 @@ | |||
*/ |
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.
NOTE: As mentioned in the 'part 1' PR, these types will get cleaned once the exceptions structure is updated.
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Show resolved
Hide resolved
export interface ExceptionsApi { | ||
deleteExceptionItem: (arg: ApiCallMemoProps) => Promise<void>; | ||
deleteExceptionList: (arg: ApiCallMemoProps) => Promise<void>; | ||
getExceptionItem: ( | ||
arg: ApiCallMemoProps & { onSuccess: (arg: ExceptionListItemSchema) => void } | ||
) => Promise<void>; | ||
getExceptionList: ( | ||
arg: ApiCallMemoProps & { onSuccess: (arg: ExceptionListSchema) => void } | ||
) => Promise<void>; | ||
} |
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.
Nice way of exposing the list API's! Makes for a clean separation of concerns between usage in hooks, and exposing the plugin's API as a whole 🙂
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.
Yea, the other way felt strange and saw this pattern elsewhere.
...ns/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Show resolved
Hide resolved
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.
Checked out and tested locally, and also performed a code review -- looking good here! 😀 Thanks for the continued cleanup, updates to tests, and new auto_id
exception list json's for testing -- they really help getting set up and quickly testing out the UI!
Also.... 👏 👏 👏 on leveraging storybooks! We haven't used them much on the SIEM side, but I've heard great things. It was nice to be able to click through and test all the different states.
LGTM! Thanks @yctercero! 👍 🚀
@elasticmachine merge upstream |
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Show resolved
Hide resolved
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
) ### Summary This PR is a follow up to elastic#68027 . It brings it all together to complete the exceptions viewer component. This component is meant to display all exception items and allow a user to create, edit, delete, and search these exception items. - Moves ExceptionItem (from part 1) into its own folder - Adds exceptions_viewer_header component that includes the search, list toggle, and add exception buttons - Adds actual ExceptionViewer component - Updates the useExceptionList hook refresh function logic. Noticed that the previous version was creating some issues
…68729) ### Summary This PR is a follow up to #68027 . It brings it all together to complete the exceptions viewer component. This component is meant to display all exception items and allow a user to create, edit, delete, and search these exception items. - Moves ExceptionItem (from part 1) into its own folder - Adds exceptions_viewer_header component that includes the search, list toggle, and add exception buttons - Adds actual ExceptionViewer component - Updates the useExceptionList hook refresh function logic. Noticed that the previous version was creating some issues
* master: (22 commits) Partial revert of "Sync Kerberos + Anonymous access tests with the latest `security/_authenticate` API (user roles now include roles of anonymous user)." (elastic#68624) adapt some snapshot test (elastic#68489) [APM] Service maps - Fix missing ML status for services with jobs but no anomalies (elastic#68486) [skip test] apis Kerberos security Kerberos authentication finishing SPNEGO should properly set cookie and authenticate user [SIEM][Exceptions] - ExceptionsViewer UI component part 2 (elastic#68294) Surface data streams in Index Management. (elastic#67806) Fix edit datasource not working following changes in elastic#67234 (elastic#68583) [Logs + Metrics UI] Clean up async plugin initialization (elastic#67654) APM Storybook fixes (elastic#68671) Upgrade EUI to v24.1.0 (elastic#68141) [ML] DF Analytics: Creation wizard part 2 (elastic#68462) [Uptime] Fix race on overview page query (elastic#67843) Prefer using npm_execpath when spawning Yarn (elastic#68673) [Security] [Cases] Attach timeline to existing case (elastic#68580) Use Search API in Vega (elastic#68257) [Component templates] Table view (elastic#68031) [Uptime] Added relative date info in cert status column (elastic#67612) [Endpoint] Re-enable Functional test case for Endpoint related pages (elastic#68445) run page_load_metrics tests in visual regresssion jobs (elastic#68570) Enable exhaustive-deps; correct any lint warnings (elastic#68453) ...
Thanks @peluja1012 and @spong for the in depth review. I added follow ups to your comments in this pr #68739 |
### Summary - Adds missing unit tests for relevant files missing them - Changes filter search to fire request on 'Enter' - Breaks out the main ExceptionViewer component into smaller components to make more readable and better tested - Updates utility bar to have the specific list description text next to it as proposed by @spong in #68294 (comment) - Adds loading state any time async request occurs - Now fetches list on list type toggle (if user selects to view either only detections or endpoint items), before was simply filtering already fetched items
### Summary - Adds missing unit tests for relevant files missing them - Changes filter search to fire request on 'Enter' - Breaks out the main ExceptionViewer component into smaller components to make more readable and better tested - Updates utility bar to have the specific list description text next to it as proposed by @spong in elastic#68294 (comment) - Adds loading state any time async request occurs - Now fetches list on list type toggle (if user selects to view either only detections or endpoint items), before was simply filtering already fetched items
### Summary - Adds missing unit tests for relevant files missing them - Changes filter search to fire request on 'Enter' - Breaks out the main ExceptionViewer component into smaller components to make more readable and better tested - Updates utility bar to have the specific list description text next to it as proposed by @spong in #68294 (comment) - Adds loading state any time async request occurs - Now fetches list on list type toggle (if user selects to view either only detections or endpoint items), before was simply filtering already fetched items
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
This PR is a follow up to #68027 . It brings it all together to complete the exceptions viewer component. This component is meant to display all exception items and allow a user to create, edit, delete, and search these exception items.
exceptions_viewer_header
component that includes the search, list toggle, and add exception buttonsExceptionViewer
componentuseExceptionList
hook refresh function logic. Noticed that the previous version was creating some issuesNote
TODO
s in areas I'll have to update.rule.exceptionLists
would be an array of{ id: '', type: 'detections', namespaceType: 'single' }
. I can update once that final structure is figured out as well.x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx
is due for a refactor, as this PR is already getting big, should be a follow upTo Do
ExceptionViewer
componentTesting
To turn on lists plugin - in kibana.dev.yml
Use the scripts in
x-pack/plugins/lists/server/scripts
to create some sample exception lists and items. You can use the following:./post_exception_list.sh ./exception_lists/new/exception_list_detection.json
./post_exception_list_item.sh ./exception_lists/new/exception_list_item_detection_auto_id.json
- this script auto generates theitem_id
so you can run it as many times as you like to create multiple items associated with the list generated in step 1./post_exception_list.sh
./post_exception_list_item.sh ./exception_lists/new/exception_list_item_auto_id.json
- this script auto generates theitem_id
so you can run it as many times as you like to create multiple items associated with the list generated in step 3./find_exception_lists.sh
to get theid
of the two lists you createdExceptionsViewer
component inx-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx
to something like the following:Navigate to the rules details page and click on the 'Exceptions' tab. Voila!
Screenshots
Empty
Items exist
Checklist