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][Detection Alerts] Changes in-progress status to acknowledged #107972

Merged
merged 12 commits into from
Aug 18, 2021

Conversation

dplumlee
Copy link
Contributor

@dplumlee dplumlee commented Aug 9, 2021

Summary

Related to the RAC updates (#107923)

Updates alert status options to include acknowledged instead of in-progress

Screenshots

Screen Shot 2021-08-17 at 11 06 20 AM

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@dplumlee dplumlee added release_note:enhancement v8.0.0 Team:Detections and Resp Security Detection Response Team Feature:Detection Alerts Security Solution Detection Alerts Feature Theme: rac label obsolete Feature:RAC label obsolete v7.15.0 labels Aug 9, 2021
@dplumlee dplumlee self-assigned this Aug 9, 2021
@dplumlee dplumlee force-pushed the in-progress-acknowledged-switch branch 2 times, most recently from 5d05168 to 370ac1d Compare August 16, 2021 21:26
@dplumlee dplumlee requested a review from rylnd August 16, 2021 21:26
@dplumlee dplumlee marked this pull request as ready for review August 16, 2021 21:27
@dplumlee dplumlee requested review from a team as code owners August 16, 2021 21:27
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@dhurley14 dhurley14 left a comment

Choose a reason for hiding this comment

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

For the text changes proposed here, It would be great to see an integration test added to this file where we update an alert to have an 'acknowledged' status:

https://github.com/elastic/kibana/blob/f243b0540d954a53b1b0371feb22c1cfd5593de9/x-pack/test/detection_engine_api_integration/basic/tests/update_rac_alerts.ts

Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

I checked this out and observed behavior with existing alerts. We're broadening the validations here so we should be safe in terms of legacy data, and most logic appears to treat in-progress and acknowledged identically. At a high level this seems like an opportunity to apply some "transform on read" functionality to alerts, but totally understand if that's not feasible right now.

Like other reviewers I'd love to see an integration test that asserts something about the new status value; it's also a little concerning that none of the existing integration tests do so 😬 .

@dplumlee dplumlee force-pushed the in-progress-acknowledged-switch branch from da035ee to 51a4d0a Compare August 17, 2021 20:33
@@ -193,7 +194,8 @@ export const AlertsTableComponent: React.FC<AlertsTableComponentProps> = ({
title = i18n.OPENED_ALERT_FAILED_TOAST;
break;
case 'in-progress':
Copy link
Contributor

@michaelolo24 michaelolo24 Aug 17, 2021

Choose a reason for hiding this comment

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

Can you create a separate issue to remove the in-progress references later on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

issue here #109030

ctx._source.threat.enrichments.add(enrichment);
}
ctx._source.threat.remove("indicator");
}

// migrate status
if(ctx._source.signal?.status == "in-progress") {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏾


/**
* @deprecated
* TODO: Remove after `acknowledged` migration
Copy link
Contributor

Choose a reason for hiding this comment

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

This can go with the issue above. Just don't want us to lose track of this and have a build up of dead code

@dplumlee
Copy link
Contributor Author

@elasticmachine merge upstream

@dplumlee dplumlee added the auto-backport Deprecated - use backport:version if exact versions are needed label Aug 18, 2021
@@ -337,7 +337,9 @@ describe('EventsViewer', () => {
<EventsViewer
{...eventsViewerDefaultProps}
graphEventId={undefined}
headerFilterGroup={<AlertsTableFilterGroup onFilterGroupChanged={jest.fn()} />}
headerFilterGroup={
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we updating?

Copy link
Contributor

Choose a reason for hiding this comment

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

the headerFilterGroup should not be used anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the AlertsTableFilterGroup component updated, but we should probably delete/modify most of these since we don't use it this way in the app anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@XavierM we still have the property there though, no? I don't think we need this many tests anymore but it might be worthwhile to keep some around in case we use it with the component somewhere down the line.

</StatusFilterButton>
</StatusFilterGroup>
<EuiButtonGroup
legend="filter status"
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we need translations here

options={options}
idSelected={status}
data-test-subj="alerts-table-filter-group"
onChange={(id) => onFilterGroupChanged(id as Status)}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit -> use useCallback

<EuiFlexItem>
<Link
aria-label="markSelectedAlertsInProgress"
aria-label="markSelectedAlertsAcknowledged"
onClick={() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

use. useCallback

onClick={() => onClickUpdate(FILTER_IN_PROGRESS)}
key="acknowledge"
data-test-subj="acknowledged-alert-status"
onClick={() => onClickUpdate(FILTER_ACKNOWLEDGED)}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - use useCallback

Copy link
Contributor

@XavierM XavierM left a comment

Choose a reason for hiding this comment

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

Code looks good

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.

Really nice job with this and thanks for making all the changes. 🔥 🔥 🔥 Great job!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 6.5MB 6.5MB -1.5KB

Page load bundle

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

id before after diff
securitySolution 211.7KB 211.7KB +18.0B
timelines 318.3KB 318.3KB +63.0B
total +81.0B
Unknown metric groups

API count

id before after diff
timelines 959 960 +1

API count missing comments

id before after diff
timelines 839 840 +1

History

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

cc @dplumlee

@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Detection Alerts Security Solution Detection Alerts Feature Feature:RAC label obsolete release_note:enhancement Team:Detections and Resp Security Detection Response Team Theme: rac label obsolete v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants