[8.19] [Attack discovery] Optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries (#225029)#225349
Merged
kibanamachine merged 1 commit intoelastic:8.19from Jun 25, 2025
Conversation
…s` of alerts associated with Attack discoveries (elastic#225029) ## [Attack discovery] Optionally update the `kibana.alert.workflow_status` of alerts associated with Attack discoveries This PR introduces a new UI to optionally update the `kibana.alert.workflow_status` of alerts associated with Attack discoveries, as illustrated by the animated gif below:  Users may (optionally) update all alerts for a single attack discovery, or just update the discovery itself:  When multiple attack discoveries are selected, users may also (optionally) update the status of all their related alerts via the bulk action menu:  ### Alert document enhancements Attack discoveries generated via the Attack discovery page, and scheduled Attack discoveries (generated via the alerting framework), are persisted as alert documents. To support the new UI, this PR populates Attack discovery alert documents with two additional (existing, but unused by Attack discovery) alert document fields: 1) `kibana.alert.start` - timestamp when Attack discoveries are created 2) `kibana.alert.workflow_status_updated_at` - timestamp when the `kibana.alert.workflow_status` was last updated This PR introduces three new alert document fields to capture metadata about when alerts are updated. Attack discovery is the first implementation to use these new fields, however any consumer of the alerting framework may utilize them in the future: 1) `kibana.alert.updated_at` - timestamp when the alert was last updated 2) `kibana.alert.updated_by.user.id` - user id of the user that last updated the alert 3) `kibana.alert.updated_by.user.name` - user name of the user that last updated the alert The three new alert fields above are updated when Attack discovery users update: - The `kibana.alert.workflow_status` status of Attack discoveries - The visibility (sharing) status of Attack discoveries (`kibana.alert.attack_discovery.users`) The three new fields above were added to the [alert_field_map](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-alerts-as-data-utils/src/field_maps/alert_field_map.ts) and [alert_schema](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-alerts-as-data-utils/src/schemas/generated/alert_schema.ts). Using the `default` space as an example, the fields above may be observed in the `.adhoc.alerts-security.attack.discovery.alerts-default` data stream for Attack discoveries generated on the Attack discovery page, and scheduled discoveries for the same space are found in the `.alerts-security.attack.discovery.alerts-default` data stream. ### @timestamp updated when sharing status changes To ensure newly-shared Attack discoveries are bumped to the top of search results, the `@timestamp` field is updated when the visibility (sharing) status of Attack discoveries (`kibana.alert.attack_discovery.users`) is updated. (The original time an Attack discovery was generated is represented by the `kibana.alert.start` field, which is not mutated.) ### Visibility menu changes This PR disables the visibility menu items for shared Attack discoveries, as illustrated by the screenshot below:  The disabled menu has a tooltip that reads: ``` The visibility of shared discoveries cannot be changed ``` Note: The internal Attack discovery bulk API still (intentionally) allows changes to the visibility of shared attack discoveries. ### `kibana.alert.workflow_status` added to default `Alerts` tab columns The `kibana.alert.workflow_status` field was added to default `Alerts` tab columns, as illustrated by the screenshot below:  ### Summary of field updates The following table describes when fields are updated (via this PR): | Field | Updated when | Description | |-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------| | `kibana.alert.start` | - Attack discoveries are created | timestamp when Attack discoveries are created | | `kibana.alert.workflow_status_updated_at` | - Workflow status (`kibana.alert.workflow_status`) is updated | timestamp when `kibana.alert.workflow_status` was last updated | | `kibana.alert.updated_at` | - Workflow status (`kibana.alert.workflow_status`) is updated<br>- Sharing status (`kibana.alert.attack_discovery.users`) is updated | timestamp when the alert was last updated | | `kibana.alert.updated_by.user.id` | - Workflow status (`kibana.alert.workflow_status`) is updated<br>- Sharing status (`kibana.alert.attack_discovery.users`) is updated | user id of the user that last updated the alert | | `kibana.alert.updated_by.user.name` | - Workflow status (`kibana.alert.workflow_status`) is updated<br>- Sharing status (`kibana.alert.attack_discovery.users`) is updated | user name of the user that last updated the alert | | `@timestamp` | - Attack discoveries are created<br>- Sharing status (`kibana.alert.attack_discovery.users`) is updated | ECS [`@timestamp`](https://www.elastic.co/docs/reference/ecs/ecs-base#field-timestamp) field | ### Feature flags The _required_ feature flag below is necessary to desk test with Ad hoc attack discoveries. The _recommended_ feature flag below enables testing with scheduled Attack discoveries. ### required: `securitySolution.attackDiscoveryAlertsEnabled` Enable the required `securitySolution.attackDiscoveryAlertsEnabled` feature flag in `config/kibana.dev.yml`: ```yaml feature_flags.overrides: securitySolution.attackDiscoveryAlertsEnabled: true ``` ### recommended: `securitySolution.assistantAttackDiscoverySchedulingEnabled: true` Also enable the recommended `assistantAttackDiscoverySchedulingEnabled` feature flag in `config/kibana.dev.yml`: ```yaml feature_flags.overrides: securitySolution.attackDiscoveryAlertsEnabled: true securitySolution.assistantAttackDiscoverySchedulingEnabled: true ``` (cherry picked from commit ea7d174)
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:kibana.alert.workflow_statusof alerts associated with Attack discoveries (#225029)Questions ?
Please refer to the Backport tool documentation