Skip to content

Conversation

@christineweng
Copy link
Contributor

@christineweng christineweng commented Aug 26, 2025

Summary

This is part 2 of the auto-extract observables work. Dependency: #236028 to be merged first.

This PR adds functionality to auto-extract case observables when attaching alerts to a case via alert flyout. This is enabled in security solution cases only. The toggle should not appear in Observability and Stack cases.

With platinum+ license, users in security can now:

  • See a toggle to auto-extract observables when attaching alert to a case
  • Configure the toggle in case templates
  • Access the toggle in case view
  • Access the default observables type to ecs mapping via the gear icon

This feature is disabled by default, to enable it, revert this commit efc88aa
Fixes #234513

Screen.Recording.2025-09-10.at.11.53.14.PM.mov

Not in scope in this PR

  • Adding toggle in alerts table (bulk actions and row actions)
  • Observable actions in activity (X observables were extracted)
  • Currently the case setting activity include both sync alert and auto-extract observables, they can be split into their own user actions
  • When user toggle it on in case view, perform a look back and extract all the net new observables

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@christineweng christineweng force-pushed the cases-extract-observables branch from 3dad123 to efb3103 Compare August 28, 2025 19:55
@christineweng christineweng force-pushed the cases-extract-observables branch from efb3103 to a78f5bb Compare September 11, 2025 04:40
@christineweng christineweng self-assigned this Sep 11, 2025
@christineweng christineweng changed the title [Cases] POC - Automatically extract cases observables in add to case workflow [Cases] Auto-extract cases observables in add to case workflow Sep 11, 2025
@christineweng christineweng added backport:skip This PR does not require backporting release_note:feature Makes this part of the condensed release notes Team:Cases Security Solution Cases team 9.2 candidate labels Sep 11, 2025
} as const;

export const OBSERVABLE_TYPE_HOSTNAME = {
label: 'Host name',
Copy link
Contributor Author

@christineweng christineweng Sep 11, 2025

Choose a reason for hiding this comment

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

Updated label from Hostname to Host name. this should be fine, right? @lgestc

@christineweng christineweng added ci:cloud-deploy Create or update a Cloud deployment ci:cloud-persist-deployment Persist cloud deployment indefinitely labels Sep 11, 2025
@christineweng christineweng force-pushed the cases-extract-observables branch 4 times, most recently from 9a5172e to c358fe4 Compare September 12, 2025 23:31
alerts: { sync: casesConfiguration?.syncAlerts ?? false },
observables: {
enabled: true,
autoExtract: false,
Copy link
Contributor Author

@christineweng christineweng Sep 15, 2025

Choose a reason for hiding this comment

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

Use this flag to enable/disable auto extract observables in alerts table. Currently add to case from row action is working as expected, but bulk action isn't working yet and will be tackled in a separate PR

@christineweng christineweng force-pushed the cases-extract-observables branch from 2a0cb68 to 3723204 Compare September 15, 2025 21:44
@kibanamachine
Copy link
Contributor

Cloud deployment initiated, see credentials at: https://buildkite.com/elastic/kibana-deploy-cloud-from-pr/builds/416

@christineweng christineweng marked this pull request as ready for review September 16, 2025 01:05
@christineweng christineweng requested review from a team as code owners September 16, 2025 01:05
@christineweng christineweng removed the ci:cloud-persist-deployment Persist cloud deployment indefinitely label Sep 25, 2025
@christineweng christineweng mentioned this pull request Sep 26, 2025
10 tasks

export const convertCaseToCamelCase = (theCase: Case): CaseUI => {
const { comments, ...restCase } = theCase;
const settings = restCase.settings;
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand why you would do this here, but I would actually create it's own dedicated function for it rather than making the mutation a side effect of a separate function.

Technically, we shouldn't need this anymore with the backfill, but this is a safeguard?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah it was added pre-backfill. removed and confirm it's not breaking anything

history: History;
}

const features = { observables: { enabled: true, autoExtract: false } } as const;
Copy link
Contributor

@michaelolo24 michaelolo24 Sep 26, 2025

Choose a reason for hiding this comment

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

Suggestion. Create a case config file or similar in security that exports
const observablesFeatureConfig = { observables: { enabled: true, autoExtract: false } } as const and use everywhere in security where you have to pass that config currently

It looks like it's only 2 places. Here and cases/pages/index.tsx

featureId: CASES_FEATURE_ID,
owner: [APP_ID],
syncAlerts: true,
extractObservables: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be set to false until the other alerts table pr is resolved?

VladimirFilonov pushed a commit to VladimirFilonov/kibana that referenced this pull request Sep 26, 2025
…236028)

## Summary

This is part 1 of introducing auto-extract observables in cases. This PR
adds mapping and default value of false to a new setting called
`extractObservables`.

Part 2 that introduces the actual feature is in
elastic#233027

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
@christineweng christineweng force-pushed the cases-extract-observables branch from efc88aa to b6d91e9 Compare September 26, 2025 18:15
);
});

it('shows an info toast when the api call is successful and the maximum number of observables is reached', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

👌🏾

},
});

const res = flattenCaseSavedObject({
Copy link
Contributor

Choose a reason for hiding this comment

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

future enhancement: We can return the Observables that weren't added, so users can decide if they're important or not

observablesMap.set(key, {
...observable,
id: v4(),
createdAt: new Date().toISOString(),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can just run this once and use the same value for both.

Copy link
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

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

Awesome work with this @christineweng 👏🏾 👏🏾 . Only had a few minor nits left, but nothing blocking.

@michaelolo24 michaelolo24 enabled auto-merge (squash) September 29, 2025 19:18
niros1 pushed a commit that referenced this pull request Sep 30, 2025
## Summary

This is part 1 of introducing auto-extract observables in cases. This PR
adds mapping and default value of false to a new setting called
`extractObservables`.

Part 2 that introduces the actual feature is in
#233027

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
@elasticmachine
Copy link
Contributor

elasticmachine commented Sep 30, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
cases 1166 1172 +6

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/securitysolution-ecs 351 352 +1

Async chunks

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

id before after diff
cases 1.4MB 1.4MB +6.8KB
embeddableAlertsTable 1004.5KB 1004.6KB +40.0B
ml 5.4MB 5.4MB +62.0B
observability 1.6MB 1.6MB +40.0B
securitySolution 10.8MB 10.8MB -2.1KB
triggersActionsUi 1.6MB 1.6MB +40.0B
total +4.9KB

Page load bundle

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

id before after diff
cases 137.7KB 141.7KB +4.0KB
securitySolution 97.4KB 97.3KB -126.0B
total +3.8KB
Unknown metric groups

API count

id before after diff
@kbn/securitysolution-ecs 355 356 +1

async chunk count

id before after diff
securitySolution 104 101 -3

History

cc @christineweng

@michaelolo24 michaelolo24 merged commit 8b8d972 into elastic:main Sep 30, 2025
12 checks passed
michaelolo24 pushed a commit that referenced this pull request Oct 1, 2025
## Summary

Dependency: #233027 to be merged
first.

This PR enables auto-extract toggle in alerts table when user adds
alerts to a case. This applies to row actions and bulk actions.

To enable the feature in security update the [case
configuration](https://github.com/elastic/kibana/blob/b37878b28188ba72f42f2d0fd1271024dc3a6fd9/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/index.tsx#L143)
to `extractObservables: true,`

<img width="1490" height="730" alt="image"
src="https://github.com/user-attachments/assets/1c31cfee-a086-490b-b2d8-69306eb3ae4c"
/>

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <[email protected]>
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
…236028)

## Summary

This is part 1 of introducing auto-extract observables in cases. This PR
adds mapping and default value of false to a new setting called
`extractObservables`.

Part 2 that introduces the actual feature is in
elastic#233027

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
…ic#233027)

## Summary

This is part 2 of the auto-extract observables work. Dependency:
elastic#236028 to be merged first.

This PR adds functionality to auto-extract case observables when
attaching alerts to a case via alert flyout. This is enabled in security
solution cases only. The toggle should not appear in Observability and
Stack cases.

With platinum+ license, users in security can now:
- See a toggle to auto-extract observables when attaching alert to a
case
- Configure the toggle in case templates
- Access the toggle in case view
- Access the default observables type to ecs mapping via the gear icon

This feature is disabled by default, to enable it, revert this commit
efc88aa
Fixes elastic#234513



https://github.com/user-attachments/assets/d74eb7bc-feb7-4208-8f4c-a99495563609



#### Not in scope in this PR
- Adding toggle in alerts table (bulk actions and row actions)
- Observable actions in activity (X observables were extracted)
- Currently the case setting activity include both sync alert and
auto-extract observables, they can be split into their own user actions
- When user toggle it on in case view, perform a look back and extract
all the net new observables


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: Michael Olorunnisola <[email protected]>
Co-authored-by: lgestc <[email protected]>
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
## Summary

Dependency: elastic#233027 to be merged
first.

This PR enables auto-extract toggle in alerts table when user adds
alerts to a case. This applies to row actions and bulk actions.

To enable the feature in security update the [case
configuration](https://github.com/elastic/kibana/blob/50299491246af6cc8055a1ff8a975ce82b114495/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/index.tsx#L143)
to `extractObservables: true,`

<img width="1490" height="730" alt="image"
src="https://github.com/user-attachments/assets/1c31cfee-a086-490b-b2d8-69306eb3ae4c"
/>

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

9.2 candidate backport:skip This PR does not require backporting release_note:feature Makes this part of the condensed release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. Team:Cases Security Solution Cases team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cases] Sync alert status does not reflect actual value in template