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] - Initial updates to exceptions viewer UX #138770

Merged
merged 57 commits into from
Sep 8, 2022

Conversation

yctercero
Copy link
Contributor

@yctercero yctercero commented Aug 12, 2022

Summary

This does not complete the planned rule details exceptions tab changes planned, but it is a shippable start:

API changes

  • Adds API for determining the list-rule references. New endpoint returns something like:
{
        references: [
          {
            'my-list-id': [
              {
                exception_lists: [
                  {
                    id: 'myListId',
                    list_id: 'my-list-id',
                    namespace_type: 'single',
                    type: 'detection',
                  },
                ],
                id: '4656dc92-5832-11ea-8e2d-0242ac130003',
                name: 'My rule',
                rule_id: 'my-rule-id',
              },
            ],
          },
        ],
      }
  • Updates the exception items find api to include the search param which allows for simple search queries - used with the EUI search bar

UI updates

  • Moved the exception components into new rule_exceptions folder per suggested folder structure updates listed here
  • Updates the rule details tabs to split endpoint and rule exceptions into their own tabs
  • Updates the viewer utilities header now that these different exception types are split
  • Updates exception item UI to match new designs
  • Updates the UI for when there are no items
  • Removes use_exception_list_items hook as it is no longer in use
  • Flyouts (add/edit) remain untouched

Things to test

  • Any regressions, all existing functionality should continue to work
    • Can add an exception from an alert
    • Can add an exception from rule details exceptions tab
      • Success toast or error toast on add
      • On success, user is still on the exceptions tab and new item is shown
    • Can edit an exception item from rule details exceptions tab
      • Success toast or error toast on edit
      • On success, user is still on the exceptions tab
    • Can delete an exception item from rule details exceptions tab
      • While deleting, exception item action buttons are disabled
      • Success toast or error toast on delete
  • Exception items are separated into rule exceptions and endpoint exceptions
    • Appropriate flyout shows when selecting to add a new endpoint exception vs rule exception
    • Only endpoint exceptions show on endpoint exceptions tab
  • Can search items using simple query search
  • Exception items show user how many rules each exception item affects

Addresses:

Changes to come:

Screenshots

Loading screen

Screen Shot 2022-08-25 at 3 24 13 PM

No exceptions exist screen

Screen Shot 2022-08-25 at 11 27 40 AM

Screen Shot 2022-08-25 at 11 27 47 AM

No search results found screen

Screen Shot 2022-08-25 at 3 26 38 PM

Screen Shot 2022-08-25 at 3 26 47 PM

Search in progress screen

Screen Shot 2022-08-25 at 3 27 21 PM

Error screen

Screen Shot 2022-08-25 at 11 29 50 AM

Detections exceptions

Screen Shot 2022-08-25 at 11 30 25 AM

Endpoint exceptions

Screen Shot 2022-08-25 at 11 30 37 AM

Checklist

@yctercero yctercero self-assigned this Aug 12, 2022
@yctercero yctercero added Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. release_note:feature Makes this part of the condensed release notes Team:Security Solution Platform Security Solution Platform Team v8.5.0 ci:cloud-deploy Create or update a Cloud deployment labels Aug 12, 2022
@yctercero yctercero requested a review from a team August 12, 2022 20:59
Copy link
Contributor

@joepeeples joepeeples left a comment

Choose a reason for hiding this comment

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

Thanks for tagging the docs team! The screenshots above look great, just a small edit suggested for the empty state text.

@@ -123,6 +124,18 @@ describe('find_list_item_schema', () => {
expect(message.schema).toEqual(expected);
});

test('it should validate with search missing', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Non-breaking change. It's a new field that is optional.

@@ -324,7 +322,7 @@ export { fetchExceptionListByIdWithValidation as fetchExceptionListById };
* @param http Kibana http service
* @param listIds ExceptionList list_ids (not ID)
* @param namespaceTypes ExceptionList namespace_types
* @param filterOptions optional - filter by field or tags
* @param filter optional
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unit test updated here: x-pack/plugins/lists/public/exceptions/api.test.ts

@yctercero yctercero marked this pull request as ready for review August 25, 2022 18:37
cy.get(EXCEPTIONS_TAB).click();
};

export const editException = () => {
cy.get(EXCEPTION_ITEM_ACTIONS_BUTTON).click({ force: true });
cy.get(EXCEPTION_ITEM_ACTIONS_BUTTON).eq(0).click({ force: true });
Copy link
Member

Choose a reason for hiding this comment

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

Do we have more than one element now with the same locator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do, there's a test with multiple exception items in the items table. Updated to take an index.


{
"type": "doc",
Copy link
Member

Choose a reason for hiding this comment

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

Do we strictly need 2 documents? If not, I would suggest extending the current document :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added 2 because I wanted to update the tests to more explicitly show that the matching alert is not created and the non matching one is. Let me know if you think that's not necessary and I can update.

Copy link
Member

@MadameSheema MadameSheema left a comment

Choose a reason for hiding this comment

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

security-engineering-productivity changes reviewed!!

Left some nit comments and improvements that do not block the PR to be merged (but would be niche to be addressed/taken into consideration) :)

@yctercero
Copy link
Contributor Author

@elasticmachine merge upstream

@yctercero
Copy link
Contributor Author

security-engineering-productivity changes reviewed!!

Left some nit comments and improvements that do not block the PR to be merged (but would be niche to be addressed/taken into consideration) :)

Thanks @MadameSheema ! I'll be sure to follow up - with the size, I'd like to just get this in and follow up on any non-blocker feedback.

Copy link
Contributor

@marshallmain marshallmain left a comment

Choose a reason for hiding this comment

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

Alerts area changes LGTM

@michaelolo24
Copy link
Contributor

michaelolo24 commented Sep 8, 2022

A couple things:

  1. Might be weirdness with the test data being endpoint data without an endpoint installed, but the endpoint exception tab wasn't visible for a non Endpoint Security rule even though I could add an endpoint exception. It show's up if I refresh the page though.
  2. Just that one minor change and for posterity, I think it might be good to have the search functionality auto-update? Was tempted to click on the add exceptions button to run the search. That can be done in a follow up PR though 👍🏾

@yctercero
Copy link
Contributor Author

@elasticmachine merge upstream

@yctercero yctercero enabled auto-merge (squash) September 8, 2022 17:12
@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 8, 2022

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #9 / apis uptime uptime REST endpoints uptime CRUD routes [PUT] /internal/uptime/service/monitors handles private location errors and does not update the monitor if integration policy is unable to be updated

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 3057 3063 +6

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/securitysolution-io-ts-list-types 452 457 +5
@kbn/securitysolution-list-hooks 44 42 -2
total +3

Async chunks

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

id before after diff
lists 148.8KB 148.9KB +48.0B
securitySolution 6.4MB 6.4MB -1.7KB
total -1.7KB

Page load bundle

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

id before after diff
securitySolution 259.9KB 260.0KB +102.0B
Unknown metric groups

API count

id before after diff
@kbn/securitysolution-io-ts-list-types 465 470 +5
@kbn/securitysolution-list-hooks 56 53 -3
total +2

ESLint disabled line counts

id before after diff
@kbn/securitysolution-list-hooks 2 1 -1

miscellaneous assets size

id before after diff
securitySolution 4.1MB 4.2MB +126.3KB

Total ESLint disabled count

id before after diff
@kbn/securitysolution-list-hooks 2 1 -1

History

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

cc @yctercero

Copy link
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

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

LGTM!

@yctercero yctercero merged commit 194e0d7 into elastic:main Sep 8, 2022
@michaelolo24 michaelolo24 deleted the update_viewer branch September 8, 2022 20:41
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 8, 2022
@yctercero
Copy link
Contributor Author

@kqualters-elastic @michaelolo24 @MadameSheema

Thank you thank you for your feedback. I've opened a follow up PR addressing it here.

guskovaue pushed a commit to guskovaue/kibana that referenced this pull request Sep 12, 2022
…r UX (elastic#138770)

## Summary

**API changes**
- Adds API for determining the list-rule references. 
- Updates the exception items find api to include the `search` param which allows for simple search queries - used with the EUI search bar

**UI updates**
- Moved the exception components into new `rule_exceptions` folder per suggested folder structure updates listed [here](elastic#138600)
- Updates the rule details tabs to split endpoint and rule exceptions into their own tabs
- Updates the viewer utilities header now that these different exception types are split
- Updates exception item UI to match new designs
- Updates the UI for when there are no items
- Removes `use_exception_list_items` hook as it is no longer in use
- Flyouts (add/edit) remain untouched
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:cloud-redeploy Always create a new Cloud deployment release_note:feature Makes this part of the condensed release notes Team:Security Solution Platform Security Solution Platform Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.