Skip to content

[Attack discovery] Optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries#225029

Merged
andrew-goldstein merged 11 commits intoelastic:mainfrom
andrew-goldstein:attack_discovery_close_related_alerts
Jun 25, 2025
Merged

[Attack discovery] Optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries#225029
andrew-goldstein merged 11 commits intoelastic:mainfrom
andrew-goldstein:attack_discovery_close_related_alerts

Conversation

@andrew-goldstein
Copy link
Contributor

@andrew-goldstein andrew-goldstein commented Jun 24, 2025

[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:

update_attack_discovery_alerts

Users may (optionally) update all alerts for a single attack discovery, or just update the discovery itself:

update_one_attack_discovery

When multiple attack discoveries are selected, users may also (optionally) update the status of all their related alerts via the bulk action menu:

update_multiple_discoveries

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 and alert_schema.

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:

visibility_menu_disabled

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:

alerts_tab_workflow_status

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
- 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
- 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
- Sharing status (kibana.alert.attack_discovery.users) is updated
user name of the user that last updated the alert
@timestamp - Attack discoveries are created
- Sharing status (kibana.alert.attack_discovery.users) is updated
ECS @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:

feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true

recommended: securitySolution.assistantAttackDiscoverySchedulingEnabled: true

Also enable the recommended assistantAttackDiscoverySchedulingEnabled feature flag in config/kibana.dev.yml:

feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true

@andrew-goldstein andrew-goldstein self-assigned this Jun 24, 2025
@andrew-goldstein andrew-goldstein added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Jun 24, 2025
@andrew-goldstein andrew-goldstein requested a review from a team as a code owner June 24, 2025 09:18
@andrew-goldstein andrew-goldstein added the release_note:feature Makes this part of the condensed release notes label Jun 24, 2025
@andrew-goldstein andrew-goldstein requested a review from a team as a code owner June 24, 2025 09:18
@andrew-goldstein andrew-goldstein added the Team:Security Generative AI Security Generative AI label Jun 24, 2025
@andrew-goldstein andrew-goldstein requested review from a team as code owners June 24, 2025 09:18
@andrew-goldstein andrew-goldstein added the backport:version Backport to applied version labels label Jun 24, 2025
@andrew-goldstein andrew-goldstein requested a review from a team as a code owner June 24, 2025 09:18
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@andrew-goldstein
Copy link
Contributor Author

andrew-goldstein commented Jun 24, 2025

Files by Code Owner

elastic/obs-ux-management-team

  • src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.ts
  • x-pack/platform/plugins/shared/rule_registry/common/assets/field_maps/technical_rule_field_map.test.ts

elastic/response-ops

  • src/platform/packages/shared/kbn-alerts-as-data-utils/src/field_maps/alert_field_map.ts
  • src/platform/packages/shared/kbn-alerts-as-data-utils/src/schemas/generated/alert_schema.ts
  • src/platform/packages/shared/kbn-alerts-as-data-utils/src/schemas/generated/security_schema.ts
  • src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.ts
  • x-pack/platform/plugins/shared/alerting/common/alert_schema/field_maps/mapping_from_field_map.test.ts
  • x-pack/platform/plugins/shared/alerting/server/integration_tests/snapshots/alert_as_data_fields.test.ts.snap
  • x-pack/platform/plugins/shared/rule_registry/common/assets/field_maps/technical_rule_field_map.test.ts
  • x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group4/alerts_as_data/alerts_as_data_dynamic_templates.ts

elastic/security-detection-engine

  • x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.19.0/index.ts

elastic/security-detections-response

  • src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.ts

elastic/security-generative-ai

  • x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.gen.ts
  • x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/attack_discovery_alert.schema.yaml
  • x-pack/solutions/security/plugins/elastic_assistant/server/mocks/attack_discovery_alert_document_response.ts
  • x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/get_update_attack_discovery_alerts_query/index.test.ts
  • x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/get_update_attack_discovery_alerts_query/index.ts
  • x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/persistence/transforms/transform_search_response_to_alerts/index.test.ts
  • x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/persistence/transforms/transform_search_response_to_alerts/index.ts
  • x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/persistence/transforms/transform_to_alert_documents/index.test.ts
  • x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/persistence/transforms/transform_to_alert_documents/index.ts
  • x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/schedules/fields/field_map.ts
  • x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/schedules/types.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/panel_header/primary_interactions/badges/shared_badge/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/panel_header/primary_interactions/badges/shared_badge/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/panel_header/primary_interactions/badges/shared_badge/translations.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/update_alerts_modal/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/update_alerts_modal/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/update_alerts_modal/translations.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/use_update_alerts_status/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/use_update_alerts_status/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/use_update_alerts_status/translations.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery_bulk/index.test.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery_bulk/index.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery_bulk/translations.ts

elastic/security-solution

  • x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.19.0/index.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/panel_header/primary_interactions/badges/shared_badge/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/panel_header/primary_interactions/badges/shared_badge/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/panel_header/primary_interactions/badges/shared_badge/translations.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/update_alerts_modal/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/update_alerts_modal/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/update_alerts_modal/translations.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/use_update_alerts_status/index.test.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/use_update_alerts_status/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/take_action/use_update_alerts_status/translations.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery_bulk/index.test.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery_bulk/index.ts
  • x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery_bulk/translations.ts

@andrew-goldstein andrew-goldstein force-pushed the attack_discovery_close_related_alerts branch from 7b1d12c to cdacea7 Compare June 24, 2025 09:45
@banderror banderror requested review from a team and dhurley14 June 24, 2025 10:57
Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

Response Ops changes LGTM. 3 new alert as data fields added. Code review only.

Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

This is a cool feature! Desk tested and things work nicely!

I left a couple of comments though: unless I'm mistaken, either some code is missing or we can undo the changes in a few files are they are not used anywhere.
If I'm correct and those changes are unused, you won't need approval from the @elastic/security-threat-hunting-investigations team anymore 😄

Copy link
Contributor

@e40pud e40pud left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you for pairing on review and testing it together 🚀

@andrew-goldstein andrew-goldstein force-pushed the attack_discovery_close_related_alerts branch 2 times, most recently from 5681b31 to 04d6844 Compare June 24, 2025 18:16
Copy link
Contributor

@PhilippeOberti PhilippeOberti 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 undoing the unnecessary changes!

@andrew-goldstein andrew-goldstein removed the request for review from a team June 24, 2025 18:26
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.

Fields need to be added to the alert schema for 8.19.

Comment on lines +74 to +82
// kibana.alert.updated_at - timestamp when the alert was last updated
const ALERT_UPDATED_AT = `${ALERT_NAMESPACE}.updated_at` as const;

// kibana.alert.updated_by.user.id - user id of the user that last updated the alert
const ALERT_UPDATED_BY_USER_ID = `${ALERT_NAMESPACE}.updated_by.user.id` as const;

// kibana.alert.updated_by.user.name - user name of the user that last updated the alert
const ALERT_UPDATED_BY_USER_NAME = `${ALERT_NAMESPACE}.updated_by.user.name` as const;

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@andrew-goldstein it looks like we will need to add these common alert fields here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @dhurley14 and @e40pud!

The new fields were added to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.19.0/index.ts in commit 693ca30

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.

LGTM! Code review.

@andrew-goldstein andrew-goldstein force-pushed the attack_discovery_close_related_alerts branch 2 times, most recently from 99c834e to 8fd395a Compare June 24, 2025 19:30
…schemas/generated/streams_schema.ts` via output from running `node scripts/functional_test_runner --config=x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group4/config.ts --grep "check alert schemas"`
@andrew-goldstein andrew-goldstein force-pushed the attack_discovery_close_related_alerts branch from f43eddd to ebc1355 Compare June 24, 2025 22:39
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #125 / Dataset Quality Dataset quality handles user privileges User can read logs-* User can monitor some data streams shows underprivileged warning when size cannot be accessed for some data streams

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 7760 7764 +4

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/rule-data-utils 185 191 +6

Async chunks

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

id before after diff
observability 1.3MB 1.3MB +132.0B
securitySolution 9.7MB 9.7MB +6.1KB
slo 991.8KB 991.9KB +132.0B
synthetics 1.0MB 1.0MB +135.0B
total +6.5KB

Page load bundle

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

id before after diff
observability 93.5KB 93.7KB +105.0B
slo 32.5KB 32.6KB +105.0B
synthetics 27.9KB 28.0KB +105.0B
timelines 177.7KB 177.9KB +210.0B
total +525.0B
Unknown metric groups

API count

id before after diff
@kbn/rule-data-utils 198 204 +6

ESLint disabled line counts

id before after diff
securitySolution 629 630 +1

Total ESLint disabled count

id before after diff
securitySolution 727 728 +1

History

cc @andrew-goldstein

@andrew-goldstein andrew-goldstein merged commit ea7d174 into elastic:main Jun 25, 2025
10 checks passed
@andrew-goldstein andrew-goldstein deleted the attack_discovery_close_related_alerts branch June 25, 2025 00:47
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15864637000

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- chore(streams): Significant events advanced settings (#221316)

Manual backport

To create the backport manually run:

node scripts/backport --pr 225029

Questions ?

Please refer to the Backport tool documentation

akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request Jun 25, 2025
…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:

![update_attack_discovery_alerts](https://github.com/user-attachments/assets/5974fc4e-50b4-43e9-9939-885f9577c153)

Users may (optionally) update all alerts for a single attack discovery, or just update the discovery itself:

![update_one_attack_discovery](https://github.com/user-attachments/assets/fd774ae7-976d-4649-a97d-b9bae8d359ad)

When multiple attack discoveries are selected, users may also (optionally) update the status of all their related alerts via the bulk action menu:

![update_multiple_discoveries](https://github.com/user-attachments/assets/71463945-f201-4810-9798-2646751dc919)

### 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:

![visibility_menu_disabled](https://github.com/user-attachments/assets/168db75c-de8f-4bf1-9490-7e3995faed9d)

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:

![alerts_tab_workflow_status](https://github.com/user-attachments/assets/264647d0-5782-444f-ad0e-c5485fae1e96)

### 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
```
@andrew-goldstein andrew-goldstein added backport:version Backport to applied version labels and removed backport:version Backport to applied version labels labels Jun 25, 2025
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15883285163

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 25, 2025
…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:

![update_attack_discovery_alerts](https://github.com/user-attachments/assets/5974fc4e-50b4-43e9-9939-885f9577c153)

Users may (optionally) update all alerts for a single attack discovery, or just update the discovery itself:

![update_one_attack_discovery](https://github.com/user-attachments/assets/fd774ae7-976d-4649-a97d-b9bae8d359ad)

When multiple attack discoveries are selected, users may also (optionally) update the status of all their related alerts via the bulk action menu:

![update_multiple_discoveries](https://github.com/user-attachments/assets/71463945-f201-4810-9798-2646751dc919)

### 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:

![visibility_menu_disabled](https://github.com/user-attachments/assets/168db75c-de8f-4bf1-9490-7e3995faed9d)

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:

![alerts_tab_workflow_status](https://github.com/user-attachments/assets/264647d0-5782-444f-ad0e-c5485fae1e96)

### 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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 25, 2025
…w_status` of alerts associated with Attack discoveries (#225029) (#225349)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Attack discovery] Optionally update the
`kibana.alert.workflow_status` of alerts associated with Attack
discoveries (#225029)](#225029)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Andrew
Macri","email":"andrew.macri@elastic.co"},"sourceCommit":{"committedDate":"2025-06-25T00:47:10Z","message":"[Attack
discovery] Optionally update the `kibana.alert.workflow_status` of
alerts associated with Attack discoveries (#225029)\n\n## [Attack
discovery] Optionally update the `kibana.alert.workflow_status` of
alerts associated with Attack discoveries\n\nThis 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:\n\n![update_attack_discovery_alerts](https://github.com/user-attachments/assets/5974fc4e-50b4-43e9-9939-885f9577c153)\n\nUsers
may (optionally) update all alerts for a single attack discovery, or
just update the discovery
itself:\n\n![update_one_attack_discovery](https://github.com/user-attachments/assets/fd774ae7-976d-4649-a97d-b9bae8d359ad)\n\nWhen
multiple attack discoveries are selected, users may also (optionally)
update the status of all their related alerts via the bulk action
menu:\n\n![update_multiple_discoveries](https://github.com/user-attachments/assets/71463945-f201-4810-9798-2646751dc919)\n\n###
Alert document enhancements\n\nAttack discoveries generated via the
Attack discovery page, and scheduled Attack discoveries (generated via
the alerting framework), are persisted as alert documents.\n\nTo support
the new UI, this PR populates Attack discovery alert documents with two
additional (existing, but unused by Attack discovery) alert document
fields:\n\n1) `kibana.alert.start` - timestamp when Attack discoveries
are created\n\n2) `kibana.alert.workflow_status_updated_at` - timestamp
when the `kibana.alert.workflow_status` was last updated\n\nThis 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:\n\n1) `kibana.alert.updated_at` - timestamp
when the alert was last updated\n\n2) `kibana.alert.updated_by.user.id`
- user id of the user that last updated the alert\n\n3)
`kibana.alert.updated_by.user.name` - user name of the user that last
updated the alert\n\nThe three new alert fields above are updated when
Attack discovery users update:\n\n- The `kibana.alert.workflow_status`
status of Attack discoveries\n- The visibility (sharing) status of
Attack discoveries (`kibana.alert.attack_discovery.users`)\n\nThe 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).\n\nUsing
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.\n\n###
@timestamp updated when sharing status changes\n\nTo 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.\n\n(The original time an Attack discovery was generated is
represented by the `kibana.alert.start` field, which is not
mutated.)\n\n### Visibility menu changes\n\nThis PR disables the
visibility menu items for shared Attack discoveries, as illustrated by
the screenshot
below:\n\n![visibility_menu_disabled](https://github.com/user-attachments/assets/168db75c-de8f-4bf1-9490-7e3995faed9d)\n\nThe
disabled menu has a tooltip that reads:\n\n```\nThe visibility of shared
discoveries cannot be changed\n```\n\nNote: The internal Attack
discovery bulk API still (intentionally) allows changes to the
visibility of shared attack discoveries.\n\n###
`kibana.alert.workflow_status` added to default `Alerts` tab
columns\n\nThe `kibana.alert.workflow_status` field was added to default
`Alerts` tab columns, as illustrated by the screenshot
below:\n\n![alerts_tab_workflow_status](https://github.com/user-attachments/assets/264647d0-5782-444f-ad0e-c5485fae1e96)\n\n###
Summary of field updates\n\nThe following table describes when fields
are updated (via this PR):\n\n| Field | Updated when | Description
|\n|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|\n|
`kibana.alert.start` | - Attack discoveries are created | timestamp when
Attack discoveries are created |\n|
`kibana.alert.workflow_status_updated_at` | - Workflow status
(`kibana.alert.workflow_status`) is updated | timestamp when
`kibana.alert.workflow_status` was last updated |\n|
`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 |\n| `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 |\n|
`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 |\n| `@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 |\n\n### Feature flags\n\nThe _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.\n\n### required:
`securitySolution.attackDiscoveryAlertsEnabled`\n\nEnable the required
`securitySolution.attackDiscoveryAlertsEnabled` feature flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n```\n\n###
recommended:
`securitySolution.assistantAttackDiscoverySchedulingEnabled:
true`\n\nAlso enable the recommended
`assistantAttackDiscoverySchedulingEnabled` feature flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n
securitySolution.assistantAttackDiscoverySchedulingEnabled:
true\n```","sha":"ea7d174e3c5c80ff74c70c4d9bdc7a9825e7c135","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:
SecuritySolution","release_note:feature","Team:Security Generative
AI","backport:version","v9.1.0","v8.19.0"],"title":"[Attack discovery]
Optionally update the `kibana.alert.workflow_status` of alerts
associated with Attack
discoveries","number":225029,"url":"https://github.com/elastic/kibana/pull/225029","mergeCommit":{"message":"[Attack
discovery] Optionally update the `kibana.alert.workflow_status` of
alerts associated with Attack discoveries (#225029)\n\n## [Attack
discovery] Optionally update the `kibana.alert.workflow_status` of
alerts associated with Attack discoveries\n\nThis 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:\n\n![update_attack_discovery_alerts](https://github.com/user-attachments/assets/5974fc4e-50b4-43e9-9939-885f9577c153)\n\nUsers
may (optionally) update all alerts for a single attack discovery, or
just update the discovery
itself:\n\n![update_one_attack_discovery](https://github.com/user-attachments/assets/fd774ae7-976d-4649-a97d-b9bae8d359ad)\n\nWhen
multiple attack discoveries are selected, users may also (optionally)
update the status of all their related alerts via the bulk action
menu:\n\n![update_multiple_discoveries](https://github.com/user-attachments/assets/71463945-f201-4810-9798-2646751dc919)\n\n###
Alert document enhancements\n\nAttack discoveries generated via the
Attack discovery page, and scheduled Attack discoveries (generated via
the alerting framework), are persisted as alert documents.\n\nTo support
the new UI, this PR populates Attack discovery alert documents with two
additional (existing, but unused by Attack discovery) alert document
fields:\n\n1) `kibana.alert.start` - timestamp when Attack discoveries
are created\n\n2) `kibana.alert.workflow_status_updated_at` - timestamp
when the `kibana.alert.workflow_status` was last updated\n\nThis 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:\n\n1) `kibana.alert.updated_at` - timestamp
when the alert was last updated\n\n2) `kibana.alert.updated_by.user.id`
- user id of the user that last updated the alert\n\n3)
`kibana.alert.updated_by.user.name` - user name of the user that last
updated the alert\n\nThe three new alert fields above are updated when
Attack discovery users update:\n\n- The `kibana.alert.workflow_status`
status of Attack discoveries\n- The visibility (sharing) status of
Attack discoveries (`kibana.alert.attack_discovery.users`)\n\nThe 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).\n\nUsing
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.\n\n###
@timestamp updated when sharing status changes\n\nTo 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.\n\n(The original time an Attack discovery was generated is
represented by the `kibana.alert.start` field, which is not
mutated.)\n\n### Visibility menu changes\n\nThis PR disables the
visibility menu items for shared Attack discoveries, as illustrated by
the screenshot
below:\n\n![visibility_menu_disabled](https://github.com/user-attachments/assets/168db75c-de8f-4bf1-9490-7e3995faed9d)\n\nThe
disabled menu has a tooltip that reads:\n\n```\nThe visibility of shared
discoveries cannot be changed\n```\n\nNote: The internal Attack
discovery bulk API still (intentionally) allows changes to the
visibility of shared attack discoveries.\n\n###
`kibana.alert.workflow_status` added to default `Alerts` tab
columns\n\nThe `kibana.alert.workflow_status` field was added to default
`Alerts` tab columns, as illustrated by the screenshot
below:\n\n![alerts_tab_workflow_status](https://github.com/user-attachments/assets/264647d0-5782-444f-ad0e-c5485fae1e96)\n\n###
Summary of field updates\n\nThe following table describes when fields
are updated (via this PR):\n\n| Field | Updated when | Description
|\n|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|\n|
`kibana.alert.start` | - Attack discoveries are created | timestamp when
Attack discoveries are created |\n|
`kibana.alert.workflow_status_updated_at` | - Workflow status
(`kibana.alert.workflow_status`) is updated | timestamp when
`kibana.alert.workflow_status` was last updated |\n|
`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 |\n| `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 |\n|
`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 |\n| `@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 |\n\n### Feature flags\n\nThe _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.\n\n### required:
`securitySolution.attackDiscoveryAlertsEnabled`\n\nEnable the required
`securitySolution.attackDiscoveryAlertsEnabled` feature flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n```\n\n###
recommended:
`securitySolution.assistantAttackDiscoverySchedulingEnabled:
true`\n\nAlso enable the recommended
`assistantAttackDiscoverySchedulingEnabled` feature flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n
securitySolution.assistantAttackDiscoverySchedulingEnabled:
true\n```","sha":"ea7d174e3c5c80ff74c70c4d9bdc7a9825e7c135"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225029","number":225029,"mergeCommit":{"message":"[Attack
discovery] Optionally update the `kibana.alert.workflow_status` of
alerts associated with Attack discoveries (#225029)\n\n## [Attack
discovery] Optionally update the `kibana.alert.workflow_status` of
alerts associated with Attack discoveries\n\nThis 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:\n\n![update_attack_discovery_alerts](https://github.com/user-attachments/assets/5974fc4e-50b4-43e9-9939-885f9577c153)\n\nUsers
may (optionally) update all alerts for a single attack discovery, or
just update the discovery
itself:\n\n![update_one_attack_discovery](https://github.com/user-attachments/assets/fd774ae7-976d-4649-a97d-b9bae8d359ad)\n\nWhen
multiple attack discoveries are selected, users may also (optionally)
update the status of all their related alerts via the bulk action
menu:\n\n![update_multiple_discoveries](https://github.com/user-attachments/assets/71463945-f201-4810-9798-2646751dc919)\n\n###
Alert document enhancements\n\nAttack discoveries generated via the
Attack discovery page, and scheduled Attack discoveries (generated via
the alerting framework), are persisted as alert documents.\n\nTo support
the new UI, this PR populates Attack discovery alert documents with two
additional (existing, but unused by Attack discovery) alert document
fields:\n\n1) `kibana.alert.start` - timestamp when Attack discoveries
are created\n\n2) `kibana.alert.workflow_status_updated_at` - timestamp
when the `kibana.alert.workflow_status` was last updated\n\nThis 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:\n\n1) `kibana.alert.updated_at` - timestamp
when the alert was last updated\n\n2) `kibana.alert.updated_by.user.id`
- user id of the user that last updated the alert\n\n3)
`kibana.alert.updated_by.user.name` - user name of the user that last
updated the alert\n\nThe three new alert fields above are updated when
Attack discovery users update:\n\n- The `kibana.alert.workflow_status`
status of Attack discoveries\n- The visibility (sharing) status of
Attack discoveries (`kibana.alert.attack_discovery.users`)\n\nThe 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).\n\nUsing
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.\n\n###
@timestamp updated when sharing status changes\n\nTo 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.\n\n(The original time an Attack discovery was generated is
represented by the `kibana.alert.start` field, which is not
mutated.)\n\n### Visibility menu changes\n\nThis PR disables the
visibility menu items for shared Attack discoveries, as illustrated by
the screenshot
below:\n\n![visibility_menu_disabled](https://github.com/user-attachments/assets/168db75c-de8f-4bf1-9490-7e3995faed9d)\n\nThe
disabled menu has a tooltip that reads:\n\n```\nThe visibility of shared
discoveries cannot be changed\n```\n\nNote: The internal Attack
discovery bulk API still (intentionally) allows changes to the
visibility of shared attack discoveries.\n\n###
`kibana.alert.workflow_status` added to default `Alerts` tab
columns\n\nThe `kibana.alert.workflow_status` field was added to default
`Alerts` tab columns, as illustrated by the screenshot
below:\n\n![alerts_tab_workflow_status](https://github.com/user-attachments/assets/264647d0-5782-444f-ad0e-c5485fae1e96)\n\n###
Summary of field updates\n\nThe following table describes when fields
are updated (via this PR):\n\n| Field | Updated when | Description
|\n|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|\n|
`kibana.alert.start` | - Attack discoveries are created | timestamp when
Attack discoveries are created |\n|
`kibana.alert.workflow_status_updated_at` | - Workflow status
(`kibana.alert.workflow_status`) is updated | timestamp when
`kibana.alert.workflow_status` was last updated |\n|
`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 |\n| `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 |\n|
`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 |\n| `@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 |\n\n### Feature flags\n\nThe _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.\n\n### required:
`securitySolution.attackDiscoveryAlertsEnabled`\n\nEnable the required
`securitySolution.attackDiscoveryAlertsEnabled` feature flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n```\n\n###
recommended:
`securitySolution.assistantAttackDiscoverySchedulingEnabled:
true`\n\nAlso enable the recommended
`assistantAttackDiscoverySchedulingEnabled` feature flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n
securitySolution.assistantAttackDiscoverySchedulingEnabled:
true\n```","sha":"ea7d174e3c5c80ff74c70c4d9bdc7a9825e7c135"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Andrew Macri <andrew.macri@elastic.co>
andrew-goldstein added a commit to andrew-goldstein/kibana that referenced this pull request Jul 9, 2025
… user to update the `kibana.alert.workflow_status` of alerts

This PR updates Attack discovery for AI4DSOC projects, such that it does NOT prompt the user with a modal to [optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries](elastic#225029), as illustrated by the animated gif below:

![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)

_Above: AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT updated_

The animated gif above illustrates that in AI4DSOC projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is NOT displayed
- Only the workflow status of the Attack discovery is updated

### All other serverless projects

All other (non-AI4DSOC) serverless projects display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)

_Above: All other serverless projects: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for all other serverless projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Elastic Cloud and self manged

Elastic Cloud and self manged deployments display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)

_Above: Self managed: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for Elastic cloud and self manged:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Feature flags

Enable the required and recommended `assistantAttackDiscoverySchedulingEnabled` features flag in `config/kibana.dev.yml`:

```yaml
feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```

### AI4DSOC

- To test with an AI4DSOC project, add the following setting to `config/serverless.security.dev.yaml`:

```yaml
xpack.securitySolutionServerless.productTypes:
[
  { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
]
```

### Desk testing

1) Navigate to Security > Attack discovery

2) Click `Generate` to generate attack discoveries

3) Click the `Take action` dropdown on an Attack discovery

4) Click `Mark as acknowledged`

**Expected result**

The modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |

5) Select (at least) 2 discoveries via their checkboxes

6) Click the `Selected 2 Attack discoveries` popover menu

7) Click `Mark as closed` from the popover menu

**Expected result**

Once again, the modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |
andrew-goldstein added a commit to andrew-goldstein/kibana that referenced this pull request Jul 10, 2025
…oes NOT prompt the user with a modal to [optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries](elastic#225029), as illustrated by the animated gif below:

![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)

_Above: AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT updated_

The animated gif above illustrates that in AI4DSOC projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is NOT displayed
- Only the workflow status of the Attack discovery is updated

All other (non-AI4DSOC) serverless projects display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)

_Above: All other serverless projects: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for all other serverless projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

Elastic Cloud and self manged deployments display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)

_Above: Self managed: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for Elastic cloud and self manged:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

Enable the required and recommended `assistantAttackDiscoverySchedulingEnabled` features flag in `config/kibana.dev.yml`:

```yaml
feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```

- To test with an AI4DSOC project, add the following setting to `config/serverless.security.dev.yaml`:

```yaml
xpack.securitySolutionServerless.productTypes:
[
  { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
]
```

1) Navigate to Security > Attack discovery

2) Click `Generate` to generate attack discoveries

3) Click the `Take action` dropdown on an Attack discovery

4) Click `Mark as acknowledged`

**Expected result**

The modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |

5) Select (at least) 2 discoveries via their checkboxes

6) Click the `Selected 2 Attack discoveries` popover menu

7) Click `Mark as closed` from the popover menu

**Expected result**

Once again, the modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |
andrew-goldstein added a commit to andrew-goldstein/kibana that referenced this pull request Jul 11, 2025
…oes NOT prompt the user with a modal to [optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries](elastic#225029), as illustrated by the animated gif below:

![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)

_Above: AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT updated_

The animated gif above illustrates that in AI4DSOC projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is NOT displayed
- Only the workflow status of the Attack discovery is updated

All other (non-AI4DSOC) serverless projects display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)

_Above: All other serverless projects: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for all other serverless projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

Elastic Cloud and self manged deployments display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)

_Above: Self managed: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for Elastic cloud and self manged:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

Enable the required and recommended `assistantAttackDiscoverySchedulingEnabled` features flag in `config/kibana.dev.yml`:

```yaml
feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```

- To test with an AI4DSOC project, add the following setting to `config/serverless.security.dev.yaml`:

```yaml
xpack.securitySolutionServerless.productTypes:
[
  { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
]
```

1) Navigate to Security > Attack discovery

2) Click `Generate` to generate attack discoveries

3) Click the `Take action` dropdown on an Attack discovery

4) Click `Mark as acknowledged`

**Expected result**

The modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |

5) Select (at least) 2 discoveries via their checkboxes

6) Click the `Selected 2 Attack discoveries` popover menu

7) Click `Mark as closed` from the popover menu

**Expected result**

Once again, the modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |
andrew-goldstein added a commit that referenced this pull request Jul 11, 2025
…er to update the `kibana.alert.workflow_status` of alerts (#227326)

## [AI4DSOC] [Attack discovery] In AI4DSOC projects, don't prompt the user to update the `kibana.alert.workflow_status` of alerts

This PR updates Attack discovery for AI4DSOC projects, such that it does NOT prompt the user with a modal to [optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries](#225029), as illustrated by the animated gif below:

![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)

_Above: AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT updated_

The animated gif above illustrates that in AI4DSOC projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is NOT displayed
- Only the workflow status of the Attack discovery is updated

### All other serverless projects

All other (non-AI4DSOC) serverless projects display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)

_Above: All other serverless projects: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for all other serverless projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Elastic Cloud and self manged

Elastic Cloud and self manged deployments display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)

_Above: Self managed: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for Elastic cloud and self manged:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Feature flags

Enable the required and recommended `assistantAttackDiscoverySchedulingEnabled` features flag in `config/kibana.dev.yml`:

```yaml
feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```

### AI4DSOC

- To test with an AI4DSOC project, add the following setting to `config/serverless.security.dev.yaml`:

```yaml
xpack.securitySolutionServerless.productTypes:
[
  { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
]
```

### Desk testing

1) Navigate to Security > Attack discovery

2) Click `Generate` to generate attack discoveries

3) Click the `Take action` dropdown on an Attack discovery

4) Click `Mark as acknowledged`

**Expected result**

The modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |

5) Select (at least) 2 discoveries via their checkboxes

6) Click the `Selected 2 Attack discoveries` popover menu

7) Click `Mark as closed` from the popover menu

**Expected result**

Once again, the modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 11, 2025
…er to update the `kibana.alert.workflow_status` of alerts (elastic#227326)

## [AI4DSOC] [Attack discovery] In AI4DSOC projects, don't prompt the user to update the `kibana.alert.workflow_status` of alerts

This PR updates Attack discovery for AI4DSOC projects, such that it does NOT prompt the user with a modal to [optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries](elastic#225029), as illustrated by the animated gif below:

![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)

_Above: AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT updated_

The animated gif above illustrates that in AI4DSOC projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is NOT displayed
- Only the workflow status of the Attack discovery is updated

### All other serverless projects

All other (non-AI4DSOC) serverless projects display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)

_Above: All other serverless projects: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for all other serverless projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Elastic Cloud and self manged

Elastic Cloud and self manged deployments display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)

_Above: Self managed: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for Elastic cloud and self manged:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Feature flags

Enable the required and recommended `assistantAttackDiscoverySchedulingEnabled` features flag in `config/kibana.dev.yml`:

```yaml
feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```

### AI4DSOC

- To test with an AI4DSOC project, add the following setting to `config/serverless.security.dev.yaml`:

```yaml
xpack.securitySolutionServerless.productTypes:
[
  { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
]
```

### Desk testing

1) Navigate to Security > Attack discovery

2) Click `Generate` to generate attack discoveries

3) Click the `Take action` dropdown on an Attack discovery

4) Click `Mark as acknowledged`

**Expected result**

The modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |

5) Select (at least) 2 discoveries via their checkboxes

6) Click the `Selected 2 Attack discoveries` popover menu

7) Click `Mark as closed` from the popover menu

**Expected result**

Once again, the modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |

(cherry picked from commit a4aa6a0)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 11, 2025
…er to update the `kibana.alert.workflow_status` of alerts (elastic#227326)

## [AI4DSOC] [Attack discovery] In AI4DSOC projects, don't prompt the user to update the `kibana.alert.workflow_status` of alerts

This PR updates Attack discovery for AI4DSOC projects, such that it does NOT prompt the user with a modal to [optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries](elastic#225029), as illustrated by the animated gif below:

![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)

_Above: AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT updated_

The animated gif above illustrates that in AI4DSOC projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is NOT displayed
- Only the workflow status of the Attack discovery is updated

### All other serverless projects

All other (non-AI4DSOC) serverless projects display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)

_Above: All other serverless projects: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for all other serverless projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Elastic Cloud and self manged

Elastic Cloud and self manged deployments display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)

_Above: Self managed: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for Elastic cloud and self manged:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Feature flags

Enable the required and recommended `assistantAttackDiscoverySchedulingEnabled` features flag in `config/kibana.dev.yml`:

```yaml
feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```

### AI4DSOC

- To test with an AI4DSOC project, add the following setting to `config/serverless.security.dev.yaml`:

```yaml
xpack.securitySolutionServerless.productTypes:
[
  { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
]
```

### Desk testing

1) Navigate to Security > Attack discovery

2) Click `Generate` to generate attack discoveries

3) Click the `Take action` dropdown on an Attack discovery

4) Click `Mark as acknowledged`

**Expected result**

The modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |

5) Select (at least) 2 discoveries via their checkboxes

6) Click the `Selected 2 Attack discoveries` popover menu

7) Click `Mark as closed` from the popover menu

**Expected result**

Once again, the modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |

(cherry picked from commit a4aa6a0)
kibanamachine added a commit that referenced this pull request Jul 11, 2025
…the user to update the `kibana.alert.workflow_status` of alerts (#227326) (#227721)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[AI4DSOC] [Attack discovery] In AI4DSOC projects, don't prompt the
user to update the `kibana.alert.workflow_status` of alerts
(#227326)](#227326)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Andrew
Macri","email":"andrew.macri@elastic.co"},"sourceCommit":{"committedDate":"2025-07-11T20:16:59Z","message":"[AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts (#227326)\n\n## [AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts\n\nThis PR updates Attack
discovery for AI4DSOC projects, such that it does NOT prompt the user
with a modal to [optionally update the kibana.alert.workflow_status of
alerts associated with Attack
discoveries](#225029), as
illustrated by the animated gif
below:\n\n![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)\n\n_Above:
AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT
updated_\n\nThe animated gif above illustrates that in AI4DSOC
projects:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is NOT displayed\n- Only the
workflow status of the Attack discovery is updated\n\n### All other
serverless projects\n\nAll other (non-AI4DSOC) serverless projects
display the modal, and optionally update the workflow status of the
alerts, as illustrated by the animated gif
below:\n\n![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)\n\n_Above:
All other serverless projects: The modal is displayed, and the
associated alerts are updated_\n\nThe animated gif above illustrates
that for all other serverless projects:\n\n- The modal prompting the
user to update the `kibana.alert.workflow_status` of alerts is
displayed\n- The workflow status of the Attack discovery is (optionally)
updated\n\n### Elastic Cloud and self manged\n\nElastic Cloud and self
manged deployments display the modal, and optionally update the workflow
status of the alerts, as illustrated by the animated gif
below:\n\n![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)\n\n_Above:
Self managed: The modal is displayed, and the associated alerts are
updated_\n\nThe animated gif above illustrates that for Elastic cloud
and self manged:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is displayed\n- The workflow
status of the Attack discovery is (optionally) updated\n\n### Feature
flags\n\nEnable the required and recommended
`assistantAttackDiscoverySchedulingEnabled` features flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n
securitySolution.assistantAttackDiscoverySchedulingEnabled:
true\n```\n\n### AI4DSOC\n\n- To test with an AI4DSOC project, add the
following setting to
`config/serverless.security.dev.yaml`:\n\n```yaml\nxpack.securitySolutionServerless.productTypes:\n[\n
{ product_line: 'ai_soc', product_tier: 'search_ai_lake'
},\n]\n```\n\n### Desk testing\n\n1) Navigate to Security > Attack
discovery\n\n2) Click `Generate` to generate attack discoveries\n\n3)
Click the `Take action` dropdown on an Attack discovery\n\n4) Click
`Mark as acknowledged`\n\n**Expected result**\n\nThe modal is displayed,
and alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅ |\n\n5) Select (at least) 2 discoveries
via their checkboxes\n\n6) Click the `Selected 2 Attack discoveries`
popover menu\n\n7) Click `Mark as closed` from the popover
menu\n\n**Expected result**\n\nOnce again, the modal is displayed, and
alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅
|","sha":"a4aa6a04c3db7d793e334fd1b38273cfca141c09","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of
alerts","number":227326,"url":"https://github.com/elastic/kibana/pull/227326","mergeCommit":{"message":"[AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts (#227326)\n\n## [AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts\n\nThis PR updates Attack
discovery for AI4DSOC projects, such that it does NOT prompt the user
with a modal to [optionally update the kibana.alert.workflow_status of
alerts associated with Attack
discoveries](#225029), as
illustrated by the animated gif
below:\n\n![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)\n\n_Above:
AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT
updated_\n\nThe animated gif above illustrates that in AI4DSOC
projects:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is NOT displayed\n- Only the
workflow status of the Attack discovery is updated\n\n### All other
serverless projects\n\nAll other (non-AI4DSOC) serverless projects
display the modal, and optionally update the workflow status of the
alerts, as illustrated by the animated gif
below:\n\n![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)\n\n_Above:
All other serverless projects: The modal is displayed, and the
associated alerts are updated_\n\nThe animated gif above illustrates
that for all other serverless projects:\n\n- The modal prompting the
user to update the `kibana.alert.workflow_status` of alerts is
displayed\n- The workflow status of the Attack discovery is (optionally)
updated\n\n### Elastic Cloud and self manged\n\nElastic Cloud and self
manged deployments display the modal, and optionally update the workflow
status of the alerts, as illustrated by the animated gif
below:\n\n![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)\n\n_Above:
Self managed: The modal is displayed, and the associated alerts are
updated_\n\nThe animated gif above illustrates that for Elastic cloud
and self manged:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is displayed\n- The workflow
status of the Attack discovery is (optionally) updated\n\n### Feature
flags\n\nEnable the required and recommended
`assistantAttackDiscoverySchedulingEnabled` features flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n
securitySolution.assistantAttackDiscoverySchedulingEnabled:
true\n```\n\n### AI4DSOC\n\n- To test with an AI4DSOC project, add the
following setting to
`config/serverless.security.dev.yaml`:\n\n```yaml\nxpack.securitySolutionServerless.productTypes:\n[\n
{ product_line: 'ai_soc', product_tier: 'search_ai_lake'
},\n]\n```\n\n### Desk testing\n\n1) Navigate to Security > Attack
discovery\n\n2) Click `Generate` to generate attack discoveries\n\n3)
Click the `Take action` dropdown on an Attack discovery\n\n4) Click
`Mark as acknowledged`\n\n**Expected result**\n\nThe modal is displayed,
and alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅ |\n\n5) Select (at least) 2 discoveries
via their checkboxes\n\n6) Click the `Selected 2 Attack discoveries`
popover menu\n\n7) Click `Mark as closed` from the popover
menu\n\n**Expected result**\n\nOnce again, the modal is displayed, and
alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅
|","sha":"a4aa6a04c3db7d793e334fd1b38273cfca141c09"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227326","number":227326,"mergeCommit":{"message":"[AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts (#227326)\n\n## [AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts\n\nThis PR updates Attack
discovery for AI4DSOC projects, such that it does NOT prompt the user
with a modal to [optionally update the kibana.alert.workflow_status of
alerts associated with Attack
discoveries](#225029), as
illustrated by the animated gif
below:\n\n![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)\n\n_Above:
AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT
updated_\n\nThe animated gif above illustrates that in AI4DSOC
projects:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is NOT displayed\n- Only the
workflow status of the Attack discovery is updated\n\n### All other
serverless projects\n\nAll other (non-AI4DSOC) serverless projects
display the modal, and optionally update the workflow status of the
alerts, as illustrated by the animated gif
below:\n\n![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)\n\n_Above:
All other serverless projects: The modal is displayed, and the
associated alerts are updated_\n\nThe animated gif above illustrates
that for all other serverless projects:\n\n- The modal prompting the
user to update the `kibana.alert.workflow_status` of alerts is
displayed\n- The workflow status of the Attack discovery is (optionally)
updated\n\n### Elastic Cloud and self manged\n\nElastic Cloud and self
manged deployments display the modal, and optionally update the workflow
status of the alerts, as illustrated by the animated gif
below:\n\n![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)\n\n_Above:
Self managed: The modal is displayed, and the associated alerts are
updated_\n\nThe animated gif above illustrates that for Elastic cloud
and self manged:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is displayed\n- The workflow
status of the Attack discovery is (optionally) updated\n\n### Feature
flags\n\nEnable the required and recommended
`assistantAttackDiscoverySchedulingEnabled` features flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n
securitySolution.assistantAttackDiscoverySchedulingEnabled:
true\n```\n\n### AI4DSOC\n\n- To test with an AI4DSOC project, add the
following setting to
`config/serverless.security.dev.yaml`:\n\n```yaml\nxpack.securitySolutionServerless.productTypes:\n[\n
{ product_line: 'ai_soc', product_tier: 'search_ai_lake'
},\n]\n```\n\n### Desk testing\n\n1) Navigate to Security > Attack
discovery\n\n2) Click `Generate` to generate attack discoveries\n\n3)
Click the `Take action` dropdown on an Attack discovery\n\n4) Click
`Mark as acknowledged`\n\n**Expected result**\n\nThe modal is displayed,
and alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅ |\n\n5) Select (at least) 2 discoveries
via their checkboxes\n\n6) Click the `Selected 2 Attack discoveries`
popover menu\n\n7) Click `Mark as closed` from the popover
menu\n\n**Expected result**\n\nOnce again, the modal is displayed, and
alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅
|","sha":"a4aa6a04c3db7d793e334fd1b38273cfca141c09"}}]}] BACKPORT-->

Co-authored-by: Andrew Macri <andrew.macri@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 14, 2025
… the user to update the `kibana.alert.workflow_status` of alerts (#227326) (#227720)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[AI4DSOC] [Attack discovery] In AI4DSOC projects, don't prompt the
user to update the `kibana.alert.workflow_status` of alerts
(#227326)](#227326)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Andrew
Macri","email":"andrew.macri@elastic.co"},"sourceCommit":{"committedDate":"2025-07-11T20:16:59Z","message":"[AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts (#227326)\n\n## [AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts\n\nThis PR updates Attack
discovery for AI4DSOC projects, such that it does NOT prompt the user
with a modal to [optionally update the kibana.alert.workflow_status of
alerts associated with Attack
discoveries](#225029), as
illustrated by the animated gif
below:\n\n![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)\n\n_Above:
AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT
updated_\n\nThe animated gif above illustrates that in AI4DSOC
projects:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is NOT displayed\n- Only the
workflow status of the Attack discovery is updated\n\n### All other
serverless projects\n\nAll other (non-AI4DSOC) serverless projects
display the modal, and optionally update the workflow status of the
alerts, as illustrated by the animated gif
below:\n\n![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)\n\n_Above:
All other serverless projects: The modal is displayed, and the
associated alerts are updated_\n\nThe animated gif above illustrates
that for all other serverless projects:\n\n- The modal prompting the
user to update the `kibana.alert.workflow_status` of alerts is
displayed\n- The workflow status of the Attack discovery is (optionally)
updated\n\n### Elastic Cloud and self manged\n\nElastic Cloud and self
manged deployments display the modal, and optionally update the workflow
status of the alerts, as illustrated by the animated gif
below:\n\n![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)\n\n_Above:
Self managed: The modal is displayed, and the associated alerts are
updated_\n\nThe animated gif above illustrates that for Elastic cloud
and self manged:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is displayed\n- The workflow
status of the Attack discovery is (optionally) updated\n\n### Feature
flags\n\nEnable the required and recommended
`assistantAttackDiscoverySchedulingEnabled` features flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n
securitySolution.assistantAttackDiscoverySchedulingEnabled:
true\n```\n\n### AI4DSOC\n\n- To test with an AI4DSOC project, add the
following setting to
`config/serverless.security.dev.yaml`:\n\n```yaml\nxpack.securitySolutionServerless.productTypes:\n[\n
{ product_line: 'ai_soc', product_tier: 'search_ai_lake'
},\n]\n```\n\n### Desk testing\n\n1) Navigate to Security > Attack
discovery\n\n2) Click `Generate` to generate attack discoveries\n\n3)
Click the `Take action` dropdown on an Attack discovery\n\n4) Click
`Mark as acknowledged`\n\n**Expected result**\n\nThe modal is displayed,
and alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅ |\n\n5) Select (at least) 2 discoveries
via their checkboxes\n\n6) Click the `Selected 2 Attack discoveries`
popover menu\n\n7) Click `Mark as closed` from the popover
menu\n\n**Expected result**\n\nOnce again, the modal is displayed, and
alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅
|","sha":"a4aa6a04c3db7d793e334fd1b38273cfca141c09","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of
alerts","number":227326,"url":"https://github.com/elastic/kibana/pull/227326","mergeCommit":{"message":"[AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts (#227326)\n\n## [AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts\n\nThis PR updates Attack
discovery for AI4DSOC projects, such that it does NOT prompt the user
with a modal to [optionally update the kibana.alert.workflow_status of
alerts associated with Attack
discoveries](#225029), as
illustrated by the animated gif
below:\n\n![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)\n\n_Above:
AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT
updated_\n\nThe animated gif above illustrates that in AI4DSOC
projects:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is NOT displayed\n- Only the
workflow status of the Attack discovery is updated\n\n### All other
serverless projects\n\nAll other (non-AI4DSOC) serverless projects
display the modal, and optionally update the workflow status of the
alerts, as illustrated by the animated gif
below:\n\n![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)\n\n_Above:
All other serverless projects: The modal is displayed, and the
associated alerts are updated_\n\nThe animated gif above illustrates
that for all other serverless projects:\n\n- The modal prompting the
user to update the `kibana.alert.workflow_status` of alerts is
displayed\n- The workflow status of the Attack discovery is (optionally)
updated\n\n### Elastic Cloud and self manged\n\nElastic Cloud and self
manged deployments display the modal, and optionally update the workflow
status of the alerts, as illustrated by the animated gif
below:\n\n![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)\n\n_Above:
Self managed: The modal is displayed, and the associated alerts are
updated_\n\nThe animated gif above illustrates that for Elastic cloud
and self manged:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is displayed\n- The workflow
status of the Attack discovery is (optionally) updated\n\n### Feature
flags\n\nEnable the required and recommended
`assistantAttackDiscoverySchedulingEnabled` features flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n
securitySolution.assistantAttackDiscoverySchedulingEnabled:
true\n```\n\n### AI4DSOC\n\n- To test with an AI4DSOC project, add the
following setting to
`config/serverless.security.dev.yaml`:\n\n```yaml\nxpack.securitySolutionServerless.productTypes:\n[\n
{ product_line: 'ai_soc', product_tier: 'search_ai_lake'
},\n]\n```\n\n### Desk testing\n\n1) Navigate to Security > Attack
discovery\n\n2) Click `Generate` to generate attack discoveries\n\n3)
Click the `Take action` dropdown on an Attack discovery\n\n4) Click
`Mark as acknowledged`\n\n**Expected result**\n\nThe modal is displayed,
and alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅ |\n\n5) Select (at least) 2 discoveries
via their checkboxes\n\n6) Click the `Selected 2 Attack discoveries`
popover menu\n\n7) Click `Mark as closed` from the popover
menu\n\n**Expected result**\n\nOnce again, the modal is displayed, and
alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅
|","sha":"a4aa6a04c3db7d793e334fd1b38273cfca141c09"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227326","number":227326,"mergeCommit":{"message":"[AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts (#227326)\n\n## [AI4DSOC]
[Attack discovery] In AI4DSOC projects, don't prompt the user to update
the `kibana.alert.workflow_status` of alerts\n\nThis PR updates Attack
discovery for AI4DSOC projects, such that it does NOT prompt the user
with a modal to [optionally update the kibana.alert.workflow_status of
alerts associated with Attack
discoveries](#225029), as
illustrated by the animated gif
below:\n\n![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)\n\n_Above:
AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT
updated_\n\nThe animated gif above illustrates that in AI4DSOC
projects:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is NOT displayed\n- Only the
workflow status of the Attack discovery is updated\n\n### All other
serverless projects\n\nAll other (non-AI4DSOC) serverless projects
display the modal, and optionally update the workflow status of the
alerts, as illustrated by the animated gif
below:\n\n![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)\n\n_Above:
All other serverless projects: The modal is displayed, and the
associated alerts are updated_\n\nThe animated gif above illustrates
that for all other serverless projects:\n\n- The modal prompting the
user to update the `kibana.alert.workflow_status` of alerts is
displayed\n- The workflow status of the Attack discovery is (optionally)
updated\n\n### Elastic Cloud and self manged\n\nElastic Cloud and self
manged deployments display the modal, and optionally update the workflow
status of the alerts, as illustrated by the animated gif
below:\n\n![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)\n\n_Above:
Self managed: The modal is displayed, and the associated alerts are
updated_\n\nThe animated gif above illustrates that for Elastic cloud
and self manged:\n\n- The modal prompting the user to update the
`kibana.alert.workflow_status` of alerts is displayed\n- The workflow
status of the Attack discovery is (optionally) updated\n\n### Feature
flags\n\nEnable the required and recommended
`assistantAttackDiscoverySchedulingEnabled` features flag in
`config/kibana.dev.yml`:\n\n```yaml\nfeature_flags.overrides:\n
securitySolution.attackDiscoveryAlertsEnabled: true\n
securitySolution.assistantAttackDiscoverySchedulingEnabled:
true\n```\n\n### AI4DSOC\n\n- To test with an AI4DSOC project, add the
following setting to
`config/serverless.security.dev.yaml`:\n\n```yaml\nxpack.securitySolutionServerless.productTypes:\n[\n
{ product_line: 'ai_soc', product_tier: 'search_ai_lake'
},\n]\n```\n\n### Desk testing\n\n1) Navigate to Security > Attack
discovery\n\n2) Click `Generate` to generate attack discoveries\n\n3)
Click the `Take action` dropdown on an Attack discovery\n\n4) Click
`Mark as acknowledged`\n\n**Expected result**\n\nThe modal is displayed,
and alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅ |\n\n5) Select (at least) 2 discoveries
via their checkboxes\n\n6) Click the `Selected 2 Attack discoveries`
popover menu\n\n7) Click `Mark as closed` from the popover
menu\n\n**Expected result**\n\nOnce again, the modal is displayed, and
alerts are (optionally) updated for the deployment, for the
deployment-type in the table below:\n\n| Deployment | Modal displayed |
Alerts (optionally) updated
|\n|-------------------------------|-----------------|-----------------------------|\n|
AI4DSOC | ❌ | ❌ |\n| All other serverless projects | ✅ | ✅ |\n| Elastic
Cloud and self manged | ✅ | ✅
|","sha":"a4aa6a04c3db7d793e334fd1b38273cfca141c09"}}]}] BACKPORT-->

Co-authored-by: Andrew Macri <andrew.macri@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…er to update the `kibana.alert.workflow_status` of alerts (elastic#227326)

## [AI4DSOC] [Attack discovery] In AI4DSOC projects, don't prompt the user to update the `kibana.alert.workflow_status` of alerts

This PR updates Attack discovery for AI4DSOC projects, such that it does NOT prompt the user with a modal to [optionally update the kibana.alert.workflow_status of alerts associated with Attack discoveries](elastic#225029), as illustrated by the animated gif below:

![ai_for_soc_take_action](https://github.com/user-attachments/assets/1c58632f-f18d-4164-a31a-e8fbbd90bae2)

_Above: AI4DSOC: The modal is NOT displayed, and the associated alerts are NOT updated_

The animated gif above illustrates that in AI4DSOC projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is NOT displayed
- Only the workflow status of the Attack discovery is updated

### All other serverless projects

All other (non-AI4DSOC) serverless projects display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![serverless](https://github.com/user-attachments/assets/d3dc067f-3fc3-461c-a7b5-a0640f82cc68)

_Above: All other serverless projects: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for all other serverless projects:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Elastic Cloud and self manged

Elastic Cloud and self manged deployments display the modal, and optionally update the workflow status of the alerts, as illustrated by the animated gif below:

![self-managed](https://github.com/user-attachments/assets/0aeb7d4e-81a7-44ca-bdb5-86573d8ad3c9)

_Above: Self managed: The modal is displayed, and the associated alerts are updated_

The animated gif above illustrates that for Elastic cloud and self manged:

- The modal prompting the user to update the `kibana.alert.workflow_status` of alerts is displayed
- The workflow status of the Attack discovery is (optionally) updated

### Feature flags

Enable the required and recommended `assistantAttackDiscoverySchedulingEnabled` features flag in `config/kibana.dev.yml`:

```yaml
feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```

### AI4DSOC

- To test with an AI4DSOC project, add the following setting to `config/serverless.security.dev.yaml`:

```yaml
xpack.securitySolutionServerless.productTypes:
[
  { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
]
```

### Desk testing

1) Navigate to Security > Attack discovery

2) Click `Generate` to generate attack discoveries

3) Click the `Take action` dropdown on an Attack discovery

4) Click `Mark as acknowledged`

**Expected result**

The modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |

5) Select (at least) 2 discoveries via their checkboxes

6) Click the `Selected 2 Attack discoveries` popover menu

7) Click `Mark as closed` from the popover menu

**Expected result**

Once again, the modal is displayed, and alerts are (optionally) updated for the deployment, for the deployment-type in the table below:

| Deployment                    | Modal displayed | Alerts (optionally) updated |
|-------------------------------|-----------------|-----------------------------|
| AI4DSOC                       | ❌               | ❌                           |
| All other serverless projects | ✅               | ✅                           |
| Elastic Cloud and self manged | ✅               | ✅                           |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:feature Makes this part of the condensed release notes Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants