-
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] Add more actions to alerts flyout #105767
Conversation
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.
c580050
to
51bef34
Compare
2a6c5a9
to
0aaece0
Compare
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
...curity_solution/public/detections/components/alerts_table/timeline_actions/add_exception.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.
LGTM!
{ | ||
name: isolateHostTitle, | ||
onClick: isolateHostHandler, | ||
disabled: loadingHostIsolationStatus || agentStatus === HostStatus.UNENROLLED, |
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 found a fix for why the Isolate host
options always remain disabled after some digging. It looks like the loadingHostIsolationStatus
is always true b/c of some code I wrote before that no longer works. If you could modify the use_isolation_status.tsx
file with the below diff, the isolate host option should work again. Let me know if you want me to send you a patch file, otherwise i just copy and pasted the diff below!
index 6a40898d0a1..0631964660b 100644
--- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_host_isolation_status.tsx
+++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_host_isolation_status.tsx
@@ -37,6 +37,7 @@ export const useHostIsolationStatus = ({
const abortCtrl = new AbortController();
// isMounted tracks if a component is mounted before changing state
let isMounted = true;
+ setLoading(true);
let fleetAgentId: string;
const fetchData = async () => {
try {
@@ -73,15 +74,10 @@ export const useHostIsolationStatus = ({
}
};
- setLoading((prevState) => {
- if (prevState) {
- return prevState;
- }
- if (!isEmpty(agentId)) {
- fetchData();
- }
- return true;
- });
+ if (!isEmpty(agentId)) {
+ fetchData();
+ }
+
return () => {
// updates to show component is unmounted
isMounted = false;
const alertIds = useMemo(() => [actionsData.eventId], [actionsData.eventId]); | ||
const isEvent = actionsData.eventKind === 'event'; | ||
|
||
const isEndpointAlert = useMemo((): boolean => { |
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's actually a helper function written in public/common/utils/endpoint_alert_check.ts
that you could use
import { useExceptionActions } from '../alerts_table/timeline_actions/use_add_exception_actions'; | ||
import { useAlertsActions } from '../alerts_table/timeline_actions/use_alerts_actions'; | ||
import { useInvestigateInTimeline } from '../alerts_table/timeline_actions/use_investigate_in_timeline'; | ||
/* Todo: Uncomment case action after getAddToCaseAction is split into action and modal |
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 for another PR?
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.
That was planed to be part of this PR, but there is still another dependency.
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
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.
Code LTGM! I tested cases actions. Everything is working as expected.
* add investigate in timeline action to flyout * close context menu on item clicked * add investigate in timeline * add investigat in timeline button * fix failing tests * add alerts status actions * update unit test * export alerts actions from hook * add disable props * add case action items * clean up * split alert status hook and hide add to case action * add useHoseIsolationAction hook * move out take action dropdown * refeactor hooks to only manage one thing * apply hooks to alerts table * clean up * fix unit tests * replace euiCodeBlock * take actions from case * fetch ecs in flyout footer * move fetch alert ecs to container * add AddExceptionModalWrapperData interface * fix cypress tests * update snapshot for json view * fix cypress test * update AddEndpointExceptionComponent * fix data retrieved from event details * fix host isolation action * use endpointAlertCheck Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
) * add investigate in timeline action to flyout * close context menu on item clicked * add investigate in timeline * add investigat in timeline button * fix failing tests * add alerts status actions * update unit test * export alerts actions from hook * add disable props * add case action items * clean up * split alert status hook and hide add to case action * add useHoseIsolationAction hook * move out take action dropdown * refeactor hooks to only manage one thing * apply hooks to alerts table * clean up * fix unit tests * replace euiCodeBlock * take actions from case * fetch ecs in flyout footer * move fetch alert ecs to container * add AddExceptionModalWrapperData interface * fix cypress tests * update snapshot for json view * fix cypress test * update AddEndpointExceptionComponent * fix data retrieved from event details * fix host isolation action * use endpointAlertCheck Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com> Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
* add investigate in timeline action to flyout * close context menu on item clicked * add investigate in timeline * add investigat in timeline button * fix failing tests * add alerts status actions * update unit test * export alerts actions from hook * add disable props * add case action items * clean up * split alert status hook and hide add to case action * add useHoseIsolationAction hook * move out take action dropdown * refeactor hooks to only manage one thing * apply hooks to alerts table * clean up * fix unit tests * replace euiCodeBlock * take actions from case * fetch ecs in flyout footer * move fetch alert ecs to container * add AddExceptionModalWrapperData interface * fix cypress tests * update snapshot for json view * fix cypress test * update AddEndpointExceptionComponent * fix data retrieved from event details * fix host isolation action * use endpointAlertCheck Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Summary
This PR is to implement take action button for alert flyout.
Add
Investigate in timeline
option inTake action
button on alert flyout. - [Security Solution][Enhancement] Investigate timeline button should be available under Quick alert details fly out. #104581Add actions for alert status
Add exception modal
Replace EuiCodeEditor with EuiCodeBlock, as EuiCodeEditor will be deprecated.
The action button should be available from case view and alerts table: