Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Implement per-field text-based diffs for the prebuilt rule upgrade flyout #166489

Closed
17 tasks done
Tracked by #174167
nikitaindik opened this issue Sep 14, 2023 · 26 comments
Closed
17 tasks done
Tracked by #174167
Assignees
Labels
8.13 candidate Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.13.0 v8.14.0

Comments

@nikitaindik
Copy link
Contributor

nikitaindik commented Sep 14, 2023

Epics: https://github.com/elastic/security-team/issues/1974 (internal), #174167
Related to: #169160

Summary

The initial plan was to build a new tab in the prebuilt rule upgrade flyout where we'd show per-field diffs for rule fields using custom diff components. These custom components were designed within #166159. This ticket was originally for implementing these custom components.

To move faster and implement this tab as soon as possible, the team has decided to first implement it using text-based diffs based on the same mechanism used for showing JSON diffs (#169160).

Acceptance criteria

  • The tab with per-field diffs is hidden behind a new feature flag. When the flag is off, the tab does not appear in the flyout. The tab should work regardless of the value of jsonPrebuiltRulesDiffingEnabled.
  • Per-field diffs are read-only components. We don't need to let the user "merge" differences using these components.
  • Diffs for complex fields are rendered as JSON diffs using the same component used for rendering the JSON diff for the whole rule. This means this component should be abstracted away and should accept unknown values in props instead of RuleResponse.
  • Diffs for related fields are grouped or rendered close to each other. For example:
    • Index patterns + Data view id
    • Custom query + Filters + Language + Saved query id
  • The tab uses the response from the upgrade/_review API endpoint and doesn't need any other API calls to render itself.
  • The tab renders itself under 150ms.

Release progress

  • Initial implementation is done but the feature is hidden behind a feature flag. (PR)
  • Feature is covered with a test plan and automated tests written according to it. (test plan PR, tests PR)
  • Feature tour is implemented. (PR)
  • Feature is fully implemented and considered by the development team as ready to be released.
  • Acceptance testing is done and the feature is approved by @approksiu and @ARWNightingale.
  • Exploratory testing is done and the feature is approved by @vgomez-el.
  • Documentation is written for ESS and Serverless by @joepeeples. Two docs PRs are approved and ready to be merged. (ticket)
  • Feature flag is turned on by default. (PR)
  • Feature is released in Serverless.

Planned release date in Serverless: March 4th.
Planned release date in ESS: March 19th (v8.13.0).

Designs

Latest Figma Designs

@nikitaindik nikitaindik added needs design Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area 8.11 candidate v8.11.0 labels Sep 14, 2023
@nikitaindik nikitaindik self-assigned this Sep 14, 2023
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@banderror banderror changed the title [Security Solution] MITRE ATT&CK™ field diff: come with a design and technical implementation plan [Security Solution] Implement the MITRE ATT&CK™ field diff UI component Oct 17, 2023
@banderror banderror changed the title [Security Solution] Implement the MITRE ATT&CK™ field diff UI component [Security Solution] Implement UI components for showing diffs between versions of each rule field Oct 17, 2023
@banderror banderror changed the title [Security Solution] Implement UI components for showing diffs between versions of each rule field [Security Solution] Implement per-field text-based diffs for the prebuilt rule upgrade flyout Jan 3, 2024
@banderror
Copy link
Contributor

@dplumlee I updated the ticket description according to our recent discussions. cc @approksiu @nikitaindik @jpdjere

@dplumlee
Copy link
Contributor

dplumlee commented Jan 12, 2024

As a follow-up to the discussion held in the meeting yesterday, I'm listing out the field groups we are displaying in the upgrade flyout so we can determine how to order them. Currently, there's no discernible order to the fields, but we talked about either matching the order to that of an existing pattern (e.g. the field order of the rule details flyout or the rule creation form) or an order of "importance" (e.g. query fields more important, description fields less important). @approksiu @ARWNightingale

"Common" Fields

  • name
  • tags
  • description
  • severity
  • severity_mapping
  • risk_score
  • risk_score_mapping
  • references
  • false_positives
  • threat
  • note
  • setup
  • related_integrations
  • required_fields
  • author
  • license
  • rule_schedule
  • actions
  • throttle
  • exceptions_list
  • max_signals
  • type

"Per rule type" fields

(these field groupings will all be displayed in the same component for context)

  • kql_query
    • type
    • query
    • language
    • filters
  • eql_query
    • query
    • language
    • filters
  • event_category_override
  • timestamp_field
  • tiebreaker_field
  • esql_query
    • query
    • language
  • threat_query
    • type
    • query
    • language
    • filters
  • threshold
    • field
    • value
    • cardinality
  • machine_learning_job_id
  • anomaly_threshold
  • new_terms_fields
  • history_window_start
  • data_source
    • type
    • index_patterns OR data_view_id

@approksiu
Copy link

Reviewing.

dplumlee added a commit that referenced this issue Feb 12, 2024
## Summary

Addresses #166489
Docs issue: elastic/security-docs#4783

Adds per-field diffs for the rule upgrade flyout 

### Acceptance Criteria

- [x] The tab with per-field diffs is hidden behind a new feature flag.
When the flag is off, the tab does not appear in the flyout. The tab
should work regardless of the value of
`jsonPrebuiltRulesDiffingEnabled`.
- [x] Per-field diffs are read-only components. We don't need to let the
user "merge" differences using these components.
- [x] Diffs for complex fields are rendered as JSON diffs using the same
component used for rendering the JSON diff for the whole rule. This
means this component should be abstracted away and should accept
`unknown` values in props instead of `RuleResponse`.
- [x] Diffs for related fields are grouped or rendered close to each
other. For example:
  - [x] Index patterns + Data view id
  - [x] Custom query + Filters + Language + Saved query id
- [x] The tab uses the response from the `upgrade/_review` API endpoint
and doesn't need any other API calls to render itself.
- [x] The tab renders itself under 150ms.

### Screenshots

<img width="1587" alt="Screenshot 2024-02-07 at 1 36 34 AM"
src="https://github.com/elastic/kibana/assets/56367316/85dce529-064e-4025-b82c-2e89f6ec800b">
<img width="994" alt="Screenshot 2024-02-07 at 1 36 52 AM"
src="https://github.com/elastic/kibana/assets/56367316/c226973f-ad46-4565-90c0-437316b138b4">

### Checklist

Delete any items that are not applicable to this PR.

- [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/packages/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


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: jpdjere <[email protected]>
@dplumlee
Copy link
Contributor

@approksiu #176767 here is the PR for the tour

dplumlee added a commit that referenced this issue Feb 14, 2024
…176767)

## Summary
Issue: #166489

Adds a tour and tooltips highlighting and describing the new diff
features of the prebuilt rule update flyout.

#### To test: 
Enable the `jsonPrebuiltRulesDiffingEnabled` and/or
`perFieldPrebuiltRulesDiffingEnabled` feature flags and clear your
browser of the local storage
`securitySolution.rulesManagementPage.newFeaturesTour.v8.13` token. This
should allow you to see the tour and both new tabs highlighted by
tooltips as shown in the screenshots below.

### Screenshots
**Upgrade tour**
<img width="1406" alt="Screenshot 2024-02-13 at 2 14 07 PM"
src="https://github.com/elastic/kibana/assets/56367316/20d3fd8e-fc39-4ae2-a627-272ae14e9aac">

**Diff tab tooltips**
<img width="1176" alt="Screenshot 2024-02-13 at 2 14 22 PM"
src="https://github.com/elastic/kibana/assets/56367316/8810c17e-4dfb-4758-b4c7-199a44531a4e">



### Checklist

Delete any items that are not applicable to this PR.

- [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/packages/kbn-i18n/README.md)
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this issue Feb 15, 2024
## Summary

Addresses elastic#166489
Docs issue: elastic/security-docs#4783

Adds per-field diffs for the rule upgrade flyout 

### Acceptance Criteria

- [x] The tab with per-field diffs is hidden behind a new feature flag.
When the flag is off, the tab does not appear in the flyout. The tab
should work regardless of the value of
`jsonPrebuiltRulesDiffingEnabled`.
- [x] Per-field diffs are read-only components. We don't need to let the
user "merge" differences using these components.
- [x] Diffs for complex fields are rendered as JSON diffs using the same
component used for rendering the JSON diff for the whole rule. This
means this component should be abstracted away and should accept
`unknown` values in props instead of `RuleResponse`.
- [x] Diffs for related fields are grouped or rendered close to each
other. For example:
  - [x] Index patterns + Data view id
  - [x] Custom query + Filters + Language + Saved query id
- [x] The tab uses the response from the `upgrade/_review` API endpoint
and doesn't need any other API calls to render itself.
- [x] The tab renders itself under 150ms.

### Screenshots

<img width="1587" alt="Screenshot 2024-02-07 at 1 36 34 AM"
src="https://github.com/elastic/kibana/assets/56367316/85dce529-064e-4025-b82c-2e89f6ec800b">
<img width="994" alt="Screenshot 2024-02-07 at 1 36 52 AM"
src="https://github.com/elastic/kibana/assets/56367316/c226973f-ad46-4565-90c0-437316b138b4">

### Checklist

Delete any items that are not applicable to this PR.

- [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/packages/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


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: jpdjere <[email protected]>
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this issue Feb 15, 2024
…lastic#176767)

## Summary
Issue: elastic#166489

Adds a tour and tooltips highlighting and describing the new diff
features of the prebuilt rule update flyout.

#### To test: 
Enable the `jsonPrebuiltRulesDiffingEnabled` and/or
`perFieldPrebuiltRulesDiffingEnabled` feature flags and clear your
browser of the local storage
`securitySolution.rulesManagementPage.newFeaturesTour.v8.13` token. This
should allow you to see the tour and both new tabs highlighted by
tooltips as shown in the screenshots below.

### Screenshots
**Upgrade tour**
<img width="1406" alt="Screenshot 2024-02-13 at 2 14 07 PM"
src="https://github.com/elastic/kibana/assets/56367316/20d3fd8e-fc39-4ae2-a627-272ae14e9aac">

**Diff tab tooltips**
<img width="1176" alt="Screenshot 2024-02-13 at 2 14 22 PM"
src="https://github.com/elastic/kibana/assets/56367316/8810c17e-4dfb-4758-b4c7-199a44531a4e">



### Checklist

Delete any items that are not applicable to this PR.

- [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/packages/kbn-i18n/README.md)
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
@dplumlee
Copy link
Contributor

@vgomez-el we're hoping to get the remaining release progress steps checked off soon (ideally by end-of-week), do you have everything you need for exploratory testing on this?

@vgomez-el
Copy link

@dplumlee Just to clarify, will the feature be included in the next 8.13 BC2 planned for Feb 22nd? Or should I test the feature on the feature branch?

@banderror
Copy link
Contributor

@vgomez-el The feature is already available in 8.13 but hidden behind a feature flag. We can enable the feature flag by default today to make it enabled in BC2 w/o any extra configuration. However, we'd prefer testing on the 8.13 branch ASAP to get feedback faster. We only have 3 days left before the end of the week to complete all the work from the release progress checklist (see the description), and in case of any bugs found we'll need some time to fix them. Sorry for the short notice, we should have given a heads up last week.

The flag can be set in the kibana config this way:

xpack.securitySolution.enableExperimental: [
  'perFieldPrebuiltRulesDiffingEnabled'
]

@vgomez-el
Copy link

@banderror @dplumlee I have exploratory tested the feature activating the feature flag in a cloud environment after upgrading a 8.9.2 instance to 8.13 so I have several prebuilt rules to work with.
I have tested on a first round it using an admin user and a read-only user and everything worked fine. I have already submitted my approval for this task.
thank you!

dplumlee added a commit that referenced this issue Feb 22, 2024
## Summary

Addresses test coverage acceptance criteria for
#166489

Adds test coverage in accordance to the recently merged [test
plan](#176474)

[Flaky test
runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5279)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Feb 22, 2024
## Summary

Addresses test coverage acceptance criteria for
elastic#166489

Adds test coverage in accordance to the recently merged [test
plan](elastic#176474)

[Flaky test
runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5279)

(cherry picked from commit 3c34b53)
kibanamachine added a commit that referenced this issue Feb 22, 2024
…177645)

# Backport

This will backport the following commits from `main` to `8.13`:
- [[Security Solution] Per-field diffs test coverage
(#177399)](#177399)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Davis
Plumlee","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-02-22T19:57:41Z","message":"[Security
Solution] Per-field diffs test coverage (#177399)\n\n##
Summary\r\n\r\nAddresses test coverage acceptance criteria
for\r\nhttps://github.com//issues/166489\r\n\r\nAdds test
coverage in accordance to the recently merged
[test\r\nplan](https://github.com/elastic/kibana/pull/176474)\r\n\r\n[Flaky
test\r\nrunner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5279)","sha":"3c34b535ceac5a5c869719998d9e03a0d44ce21a","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","test-coverage","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","v8.13.0","v8.14.0"],"title":"[Security Solution] Per-field diffs
test
coverage","number":177399,"url":"https://github.com/elastic/kibana/pull/177399","mergeCommit":{"message":"[Security
Solution] Per-field diffs test coverage (#177399)\n\n##
Summary\r\n\r\nAddresses test coverage acceptance criteria
for\r\nhttps://github.com//issues/166489\r\n\r\nAdds test
coverage in accordance to the recently merged
[test\r\nplan](https://github.com/elastic/kibana/pull/176474)\r\n\r\n[Flaky
test\r\nrunner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5279)","sha":"3c34b535ceac5a5c869719998d9e03a0d44ce21a"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177399","number":177399,"mergeCommit":{"message":"[Security
Solution] Per-field diffs test coverage (#177399)\n\n##
Summary\r\n\r\nAddresses test coverage acceptance criteria
for\r\nhttps://github.com//issues/166489\r\n\r\nAdds test
coverage in accordance to the recently merged
[test\r\nplan](https://github.com/elastic/kibana/pull/176474)\r\n\r\n[Flaky
test\r\nrunner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5279)","sha":"3c34b535ceac5a5c869719998d9e03a0d44ce21a"}}]}]
BACKPORT-->

Co-authored-by: Davis Plumlee <[email protected]>
@banderror
Copy link
Contributor

@ARWNightingale @dplumlee How's it going with acceptance testing?

@ARWNightingale
Copy link

@banderror all looks good and everything as expected.

banderror added a commit that referenced this issue Feb 23, 2024
**Addresses:** #166489

## Summary

Turns on the `perFieldPrebuiltRulesDiffingEnabled` feature flag by
default.

This will enable the `Updates` tab containing per-field rule diffs in
the rule upgrade flyout. The feature will be enabled in `8.13.0` and
Serverless. See more info in the related ticket.


### Checklist

- [ ] [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
banderror added a commit to banderror/kibana that referenced this issue Feb 23, 2024
**Addresses:** elastic#166489

## Summary

Turns on the `perFieldPrebuiltRulesDiffingEnabled` feature flag by
default.

This will enable the `Updates` tab containing per-field rule diffs in
the rule upgrade flyout. The feature will be enabled in `8.13.0` and
Serverless. See more info in the related ticket.

### Checklist

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

(cherry picked from commit 61b7f67)

# Conflicts:
#	x-pack/plugins/security_solution/common/experimental_features.ts
banderror referenced this issue Feb 23, 2024
…177708)

# Backport

This will backport the following commits from `main` to `8.13`:
- [[Security Solution] Enable per field diffs feature
(#177495)](#177495)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Georgii
Gorbachev","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-02-23T12:28:22Z","message":"[Security
Solution] Enable per field diffs feature (#177495)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/166489\r\n\r\n##
Summary\r\n\r\nTurns on the `perFieldPrebuiltRulesDiffingEnabled`
feature flag by\r\ndefault.\r\n\r\nThis will enable the `Updates` tab
containing per-field rule diffs in\r\nthe rule upgrade flyout. The
feature will be enabled in `8.13.0` and\r\nServerless. See more info in
the related ticket.\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"61b7f67bda066d57455f5ca2ed69fd4e61657ffb","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","ci:cloud-deploy","ci:project-deploy-security","v8.13.0","v8.14.0"],"number":177495,"url":"https://github.com/elastic/kibana/pull/177495","mergeCommit":{"message":"[Security
Solution] Enable per field diffs feature (#177495)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/166489\r\n\r\n##
Summary\r\n\r\nTurns on the `perFieldPrebuiltRulesDiffingEnabled`
feature flag by\r\ndefault.\r\n\r\nThis will enable the `Updates` tab
containing per-field rule diffs in\r\nthe rule upgrade flyout. The
feature will be enabled in `8.13.0` and\r\nServerless. See more info in
the related ticket.\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"61b7f67bda066d57455f5ca2ed69fd4e61657ffb"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","labelRegex":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177495","number":177495,"mergeCommit":{"message":"[Security
Solution] Enable per field diffs feature (#177495)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/166489\r\n\r\n##
Summary\r\n\r\nTurns on the `perFieldPrebuiltRulesDiffingEnabled`
feature flag by\r\ndefault.\r\n\r\nThis will enable the `Updates` tab
containing per-field rule diffs in\r\nthe rule upgrade flyout. The
feature will be enabled in `8.13.0` and\r\nServerless. See more info in
the related ticket.\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"61b7f67bda066d57455f5ca2ed69fd4e61657ffb"}}]}]
BACKPORT-->
fkanout pushed a commit to fkanout/kibana that referenced this issue Mar 4, 2024
## Summary

Addresses elastic#166489
Docs issue: elastic/security-docs#4783

Adds per-field diffs for the rule upgrade flyout 

### Acceptance Criteria

- [x] The tab with per-field diffs is hidden behind a new feature flag.
When the flag is off, the tab does not appear in the flyout. The tab
should work regardless of the value of
`jsonPrebuiltRulesDiffingEnabled`.
- [x] Per-field diffs are read-only components. We don't need to let the
user "merge" differences using these components.
- [x] Diffs for complex fields are rendered as JSON diffs using the same
component used for rendering the JSON diff for the whole rule. This
means this component should be abstracted away and should accept
`unknown` values in props instead of `RuleResponse`.
- [x] Diffs for related fields are grouped or rendered close to each
other. For example:
  - [x] Index patterns + Data view id
  - [x] Custom query + Filters + Language + Saved query id
- [x] The tab uses the response from the `upgrade/_review` API endpoint
and doesn't need any other API calls to render itself.
- [x] The tab renders itself under 150ms.

### Screenshots

<img width="1587" alt="Screenshot 2024-02-07 at 1 36 34 AM"
src="https://github.com/elastic/kibana/assets/56367316/85dce529-064e-4025-b82c-2e89f6ec800b">
<img width="994" alt="Screenshot 2024-02-07 at 1 36 52 AM"
src="https://github.com/elastic/kibana/assets/56367316/c226973f-ad46-4565-90c0-437316b138b4">

### Checklist

Delete any items that are not applicable to this PR.

- [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/packages/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


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: jpdjere <[email protected]>
fkanout pushed a commit to fkanout/kibana that referenced this issue Mar 4, 2024
…lastic#176767)

## Summary
Issue: elastic#166489

Adds a tour and tooltips highlighting and describing the new diff
features of the prebuilt rule update flyout.

#### To test: 
Enable the `jsonPrebuiltRulesDiffingEnabled` and/or
`perFieldPrebuiltRulesDiffingEnabled` feature flags and clear your
browser of the local storage
`securitySolution.rulesManagementPage.newFeaturesTour.v8.13` token. This
should allow you to see the tour and both new tabs highlighted by
tooltips as shown in the screenshots below.

### Screenshots
**Upgrade tour**
<img width="1406" alt="Screenshot 2024-02-13 at 2 14 07 PM"
src="https://github.com/elastic/kibana/assets/56367316/20d3fd8e-fc39-4ae2-a627-272ae14e9aac">

**Diff tab tooltips**
<img width="1176" alt="Screenshot 2024-02-13 at 2 14 22 PM"
src="https://github.com/elastic/kibana/assets/56367316/8810c17e-4dfb-4758-b4c7-199a44531a4e">



### Checklist

Delete any items that are not applicable to this PR.

- [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/packages/kbn-i18n/README.md)
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
fkanout pushed a commit to fkanout/kibana that referenced this issue Mar 4, 2024
## Summary

Addresses test coverage acceptance criteria for
elastic#166489

Adds test coverage in accordance to the recently merged [test
plan](elastic#176474)

[Flaky test
runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5279)
fkanout pushed a commit to fkanout/kibana that referenced this issue Mar 4, 2024
**Addresses:** elastic#166489

## Summary

Turns on the `perFieldPrebuiltRulesDiffingEnabled` feature flag by
default.

This will enable the `Updates` tab containing per-field rule diffs in
the rule upgrade flyout. The feature will be enabled in `8.13.0` and
Serverless. See more info in the related ticket.


### Checklist

- [ ] [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
@banderror
Copy link
Contributor

The feature went live today 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.13 candidate Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.13.0 v8.14.0
Projects
None yet
Development

No branches or pull requests

9 participants