[Cases] Add extract observables setting to cases SO mapping#236028
[Cases] Add extract observables setting to cases SO mapping#236028christineweng merged 2 commits intoelastic:mainfrom
Conversation
aea46d5 to
225c562
Compare
|
Pinging @elastic/kibana-cases (Team:Cases) |
PhilippeOberti
left a comment
There was a problem hiding this comment.
Code review only (a single Cypress file owned by our team). LGTM for the @elastic/security-threat-hunting team
225c562 to
a6c33c0
Compare
a6c33c0 to
3afd7f7
Compare
Files by Code Owner (non-cases teams)elastic/appex-qa
elastic/kibana-core
elastic/security-detections-response
elastic/security-threat-hunting
|
rylnd
left a comment
There was a problem hiding this comment.
Detection engine change (to a mock Case object in our cypress suite) LGTM.
csr
left a comment
There was a problem hiding this comment.
x-pack/platform/test/serverless/api_integration/services/svl_cases/api.ts LGTM 👍
There was a problem hiding this comment.
SO data migrations LGTM.
Part 2 that introduces the actual feature is in #233027
Just note that this data migration will need to be released separately from the feature code that depends on it (i.e., target the following serverless release). Otherwise you can start writing feature code that treats the new field as optional to unblock your progress.
| { | ||
| type: 'mappings_addition', | ||
| addedMappings: { | ||
| settings: { | ||
| properties: { | ||
| extractObservables: { | ||
| type: 'boolean', | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| type: 'data_backfill', | ||
| backfillFn: (doc) => { | ||
| const settings = doc.attributes.settings; | ||
| return { attributes: { settings: { ...settings, extractObservables: false } } }; | ||
| }, | ||
| }, |
There was a problem hiding this comment.
My apologies for not calling this out in my first pass. These new mappings will need to be added in a new model version. Model version 6. And they should not aim to be released along with model version 5.
There was a problem hiding this comment.
Hey @jloleysens . Model Version 5 hasn't gone out into serverless yet. I merged that yesterday just in case.
This PR: #235290
jloleysens
left a comment
There was a problem hiding this comment.
Thanks for raising and confirming 5 hasn't been released @christineweng and @michaelolo24 !
You might just consider bundling them together in one change object, other than that I think this change makes sense.
jloleysens
left a comment
There was a problem hiding this comment.
Thanks for raising and confirming 5 hasn't been released @christineweng and @michaelolo24 !
You might just consider bundling them together in one change object, other than that I think this change makes sense.
543dd3c to
bfad673
Compare
bfad673 to
40ba7d2
Compare
| }, | ||
| overrides: { | ||
| severity: 10, // Severity value that matches v1 schema (10, 20, 30, 40) | ||
| // @ts-expect-error: total_events is not defined in the attributes |
There was a problem hiding this comment.
@lgestc we may want to add this field to the actual attributes for the mapping per what was done for alerts here: #223992 and it's utility in the analytics indices. Fyi @janmonschke
| const query = CaseSettingsRt.decode({ syncAlerts: false, foo: 'bar' }); | ||
| // Stripping additional attributes require a stricter rt type | ||
| // This test cannot be passed because we want extractObservables to be optional | ||
| it.skip('removes foo:bar attributes from request', () => { |
There was a problem hiding this comment.
spoke offline about this, but I think we can fix this in this PR or a follow up with:
rt.intersection([
rt.strict({
syncAlerts: rt.boolean,
}),
rt.exact(
rt.partial({
extractObservables: rt.boolean,
})
),
]);
michaelolo24
left a comment
There was a problem hiding this comment.
Nice work! @christineweng and I were able to test the upgrade scenario via the qaf update util and the backfill worked as expect both on existing older cases in the cluster, as well as imported older cases as well. Nice work!
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
History
|
…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) - [ ] ...
…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) - [ ] ...
…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) - [ ] ...
…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) - [ ] ...
## 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) - [ ] ...
## 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 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 <michael.olorunnisola@elastic.co> Co-authored-by: lgestc <11671118+lgestc@users.noreply.github.com>
…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) - [ ] ...
…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 <michael.olorunnisola@elastic.co> Co-authored-by: lgestc <11671118+lgestc@users.noreply.github.com>
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.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*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.