-
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
[Security Solution] host isolation exceptions listing under policy integration details tab #120361
[Security Solution] host isolation exceptions listing under policy integration details tab #120361
Conversation
Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt) |
…ion-exceptions-policy-tab
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.
This new tab is awesome 👍 I have a few questions that I'd like to understand; and a suggestion about reusing an empty state component. 😅
Note: I took this for a spin and noticed that I don't see the Host Isolation exceptions
menu item even after adding an exception item. Also, I think it is a bit odd to not see this menu item to start with. It looks especially odd when I'm on the add exception flyout with the correct breadcrumb, but no menu item to match. Not sure if this is being addressed in a later PR.
(Refreshing the whole app did work and shows the new menu item)
Here's what I saw.
...lic/management/pages/policy/view/host_isolation_exceptions/components/empty_non_existent.tsx
Outdated
Show resolved
Hide resolved
...ck/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/hooks.ts
Show resolved
Hide resolved
...blic/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.test.tsx
Outdated
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.
This new tab is awesome 👍 I have a few questions that I'd like to understand; and a suggestion about reusing an empty state component. 😅
Note: I took this for a spin and noticed that I don't see the Host Isolation exceptions
menu item even after adding an exception item. Also, I think it is a bit odd to not see this menu item to start with. It looks especially odd when I'm on the add exception flyout with the correct breadcrumb, but no menu item to match. Not sure if this is being addressed in a later PR.
(Refreshing the whole app did work and shows the new menu item)
Here's what I saw.
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.
🚀 🐑
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.
This is looking good!! 🔥 Left some comments (mostly minor ones) 🙂
x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.mock.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/management/common/utils.ts
Outdated
Show resolved
Hide resolved
...blic/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.test.tsx
Outdated
Show resolved
Hide resolved
...ion/public/management/pages/policy/store/policy_details/selectors/policy_common_selectors.ts
Outdated
Show resolved
Hide resolved
...lic/management/pages/policy/view/host_isolation_exceptions/components/empty_non_existent.tsx
Outdated
Show resolved
Hide resolved
...y_solution/public/management/pages/policy/view/host_isolation_exceptions/components/list.tsx
Outdated
Show resolved
Hide resolved
...y_solution/public/management/pages/policy/view/host_isolation_exceptions/components/list.tsx
Outdated
Show resolved
Hide resolved
...y_solution/public/management/pages/policy/view/host_isolation_exceptions/components/list.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/policy_tabs.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/policy_tabs.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.
lgtm! Thanks for do the changes 🔥
|
||
const [expandedItemsMap, setExpandedItemsMap] = useState<Map<string, boolean>>(new Map()); | ||
|
||
const pagination = { |
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.
Suggestion:memoize this in order to prevent unnecessary component re-renders due to shallow diffs
|
||
const artifactCardPolicies = useEndpointPoliciesToArtifactPolicies(policiesRequest.data?.items); | ||
|
||
const provideCardProps: ArtifactCardGridProps['cardComponentProps'] = (item) => { |
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.
same here
}; | ||
}; | ||
|
||
const handleExpandCollapse: ArtifactCardGridProps['onExpandCollapse'] = ({ |
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.
can you use useCallback()
here?
import { PolicyHostIsolationExceptionsTab } from './host_isolation_exceptions_tab'; | ||
|
||
jest.mock('../../../host_isolation_exceptions/service'); | ||
jest.mock('../../../../../common/components/user_privileges/endpoint/use_endpoint_privileges'); |
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.
I had been trying to remove mocking this "internal" hook to the useUserPrivileges
. Any change you can mock that instead and not access this one directly?
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.
i am not really using this mock. I had to mock it because the http request that this component is doing was failing my tests.
@paul-tavares I checked your suggestions for useCallback and memo but they won't make any difference since those values dependencies change basically any time the component has to re-render anyway. |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
…tegration details tab (elastic#120361)
Summary
Shows a list of related host isolation exceptions to a policy inside the policy settings view:
Shows an empty status when no assigned exceptions to the policy:
Shows an empty status when no exceptions exists:
This PR introduces:
To be introduced in follow up PRs:
Note: this PR intentionally doesn't cover licensing validations. A follow up PR will be done for that.
Checklist
Delete any items that are not applicable to this PR.