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] Display cardinality for threshold rules #201162

Merged
merged 15 commits into from
Nov 27, 2024

Conversation

jkelas
Copy link
Contributor

@jkelas jkelas commented Nov 21, 2024

Resolves #161576

Summary

This PR fixes the description of threshold rules. The problem was that if a threshold rule contained 'Count' (cardinality) it wasn't displayed neither in a summary while creating the rule, nor in the rule details page. This PR fixes these two places, introducing similar logic to the two places in the code, to display the cardinality if it is present in the threshold object.

BEFORE

  1. overview page
image
  1. rule details page
image

AFTER

  1. overview page
image
  1. rule details page
image

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@jkelas jkelas changed the title 161576 Add showing count field for threshold rule if present Nov 21, 2024
@jkelas jkelas changed the title Add showing count field for threshold rule if present Add showing count field for threshold rules if present Nov 21, 2024
@jkelas jkelas changed the title Add showing count field for threshold rules if present [Security Solution] Add showing count field for threshold rules if present Nov 21, 2024
@jkelas jkelas added 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 v9.0.0 v8.18.0 Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area release_note:fix labels Nov 22, 2024
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7464

[✅] Security Solution Rule Management - Cypress: 25/25 tests passed.
[✅] Security Solution Rule Management - Prebuilt Rules - Cypress: 25/25 tests passed.
[✅] [Serverless] Security Solution Rule Management - Prebuilt Rules - Cypress: 25/25 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7473

[✅] Security Solution Rule Management - Prebuilt Rules - Cypress: 200/200 tests passed.

see run history

@jkelas jkelas marked this pull request as ready for review November 25, 2024 20:21
@jkelas jkelas requested review from a team as code owners November 25, 2024 20:21
@jkelas jkelas requested review from vitaliidm and xcrzx November 25, 2024 20:21
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7474

[✅] [Serverless] Security Solution Rule Management - Prebuilt Rules - Cypress: 200/200 tests passed.

see run history

@xcrzx xcrzx removed their request for review November 26, 2024 09:22
Copy link
Contributor

@vitaliidm vitaliidm left a comment

Choose a reason for hiding this comment

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

Detection engine area LGTM.
Small comment regarding format of translation string

@nikitaindik
Copy link
Contributor

I've checked the code and left a few non-critical comments.

I've also tested the PR locally by trying different combinations of threshold settings. I checked that it displays correctly in these places:

  • Step preview in rule creation page
  • Rule details page
  • Overview tab of the rule installation flyout
  • Rule summary in the event flyout

Found one issue which is already fixed.

@jkelas Please address my comments, but overall this PR looks good to me.

@nikitaindik nikitaindik self-requested a review November 27, 2024 06:03
Copy link
Contributor

@nikitaindik nikitaindik 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 the updates @jkelas! I've retested with the latest changes locally and can confirm that it still works correctly.

Looks like the tests are failing because of the recent change in text. Let's resolve this and we should be good to merge.
Scherm­afbeelding 2024-11-27 om 07 02 57

Copy link
Contributor

@banderror banderror left a comment

Choose a reason for hiding this comment

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

Code changes LGTM, but I didn't test the PR - will rely on the testing done by Nikita.

Thanks @jkelas for the clean fix and adding a comprehensive test coverage for it 👍

@jkelas jkelas enabled auto-merge (squash) November 27, 2024 11:07
@jkelas jkelas disabled auto-merge November 27, 2024 11:07
@jkelas jkelas enabled auto-merge (squash) November 27, 2024 11:07
@jkelas jkelas merged commit 19a2ff8 into elastic:main Nov 27, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.x

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 13.4MB 13.4MB +938.0B

History

cc @jkelas

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 27, 2024
…201162)

**Resolves elastic#161576**

## Summary

This PR fixes the description of threshold rules. The problem was that
if a threshold rule contained 'Count' (cardinality) it wasn't displayed
neither in a summary while creating the rule, nor in the rule details
page. This PR fixes these two places, introducing similar logic to the
two places in the code, to display the cardinality if it is present in
the threshold object.

### BEFORE
1. overview page
<img width="1027" alt="image"
src="https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce">

2. rule details page
<img width="762" alt="image"
src="https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83">

### AFTER
1. overview page
<img width="1015" alt="image"
src="https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f">

2. rule details page
<img width="893" alt="image"
src="https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c">

### 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/packages/kbn-i18n/README.md)
- [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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
Done:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477

(cherry picked from commit 19a2ff8)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 27, 2024
…201162)

**Resolves elastic#161576**

## Summary

This PR fixes the description of threshold rules. The problem was that
if a threshold rule contained 'Count' (cardinality) it wasn't displayed
neither in a summary while creating the rule, nor in the rule details
page. This PR fixes these two places, introducing similar logic to the
two places in the code, to display the cardinality if it is present in
the threshold object.

### BEFORE
1. overview page
<img width="1027" alt="image"
src="https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce">

2. rule details page
<img width="762" alt="image"
src="https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83">

### AFTER
1. overview page
<img width="1015" alt="image"
src="https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f">

2. rule details page
<img width="893" alt="image"
src="https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c">

### 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/packages/kbn-i18n/README.md)
- [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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
Done:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477

(cherry picked from commit 19a2ff8)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 27, 2024
…201162)

**Resolves elastic#161576**

## Summary

This PR fixes the description of threshold rules. The problem was that
if a threshold rule contained 'Count' (cardinality) it wasn't displayed
neither in a summary while creating the rule, nor in the rule details
page. This PR fixes these two places, introducing similar logic to the
two places in the code, to display the cardinality if it is present in
the threshold object.

### BEFORE
1. overview page
<img width="1027" alt="image"
src="https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce">

2. rule details page
<img width="762" alt="image"
src="https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83">

### AFTER
1. overview page
<img width="1015" alt="image"
src="https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f">

2. rule details page
<img width="893" alt="image"
src="https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c">

### 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/packages/kbn-i18n/README.md)
- [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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
Done:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477

(cherry picked from commit 19a2ff8)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.16
8.17
8.x

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 Nov 27, 2024
…01162) (#201960)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Display cardinality for threshold rules
(#201162)](#201162)

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

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

<!--BACKPORT [{"author":{"name":"Jacek
Kolezynski","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-27T12:11:41Z","message":"[Security
Solution] Display cardinality for threshold rules
(#201162)\n\n**Resolves #161576**\r\n\r\n## Summary\r\n\r\nThis PR fixes
the description of threshold rules. The problem was that\r\nif a
threshold rule contained 'Count' (cardinality) it wasn't
displayed\r\nneither in a summary while creating the rule, nor in the
rule details\r\npage. This PR fixes these two places, introducing
similar logic to the\r\ntwo places in the code, to display the
cardinality if it is present in\r\nthe threshold object.\r\n\r\n###
BEFORE\r\n1. overview page\r\n<img width=\"1027\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce\">\r\n\r\n2.
rule details page\r\n<img width=\"762\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83\">\r\n\r\n\r\n\r\n###
AFTER\r\n1. overview page\r\n<img width=\"1015\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f\">\r\n\r\n2.
rule details page\r\n<img width=\"893\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c\">\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [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\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\nDone:
\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477","sha":"19a2ff81d5a542402a3f0c006d6b4986890d73f9","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[Security
Solution] Display cardinality for threshold
rules","number":201162,"url":"https://github.com/elastic/kibana/pull/201162","mergeCommit":{"message":"[Security
Solution] Display cardinality for threshold rules
(#201162)\n\n**Resolves #161576**\r\n\r\n## Summary\r\n\r\nThis PR fixes
the description of threshold rules. The problem was that\r\nif a
threshold rule contained 'Count' (cardinality) it wasn't
displayed\r\nneither in a summary while creating the rule, nor in the
rule details\r\npage. This PR fixes these two places, introducing
similar logic to the\r\ntwo places in the code, to display the
cardinality if it is present in\r\nthe threshold object.\r\n\r\n###
BEFORE\r\n1. overview page\r\n<img width=\"1027\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce\">\r\n\r\n2.
rule details page\r\n<img width=\"762\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83\">\r\n\r\n\r\n\r\n###
AFTER\r\n1. overview page\r\n<img width=\"1015\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f\">\r\n\r\n2.
rule details page\r\n<img width=\"893\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c\">\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [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\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\nDone:
\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477","sha":"19a2ff81d5a542402a3f0c006d6b4986890d73f9"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201162","number":201162,"mergeCommit":{"message":"[Security
Solution] Display cardinality for threshold rules
(#201162)\n\n**Resolves #161576**\r\n\r\n## Summary\r\n\r\nThis PR fixes
the description of threshold rules. The problem was that\r\nif a
threshold rule contained 'Count' (cardinality) it wasn't
displayed\r\nneither in a summary while creating the rule, nor in the
rule details\r\npage. This PR fixes these two places, introducing
similar logic to the\r\ntwo places in the code, to display the
cardinality if it is present in\r\nthe threshold object.\r\n\r\n###
BEFORE\r\n1. overview page\r\n<img width=\"1027\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce\">\r\n\r\n2.
rule details page\r\n<img width=\"762\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83\">\r\n\r\n\r\n\r\n###
AFTER\r\n1. overview page\r\n<img width=\"1015\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f\">\r\n\r\n2.
rule details page\r\n<img width=\"893\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c\">\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [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\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\nDone:
\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477","sha":"19a2ff81d5a542402a3f0c006d6b4986890d73f9"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jacek Kolezynski <[email protected]>
kibanamachine added a commit that referenced this pull request Nov 27, 2024
…201162) (#201959)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Security Solution] Display cardinality for threshold rules
(#201162)](#201162)

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

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

<!--BACKPORT [{"author":{"name":"Jacek
Kolezynski","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-27T12:11:41Z","message":"[Security
Solution] Display cardinality for threshold rules
(#201162)\n\n**Resolves #161576**\r\n\r\n## Summary\r\n\r\nThis PR fixes
the description of threshold rules. The problem was that\r\nif a
threshold rule contained 'Count' (cardinality) it wasn't
displayed\r\nneither in a summary while creating the rule, nor in the
rule details\r\npage. This PR fixes these two places, introducing
similar logic to the\r\ntwo places in the code, to display the
cardinality if it is present in\r\nthe threshold object.\r\n\r\n###
BEFORE\r\n1. overview page\r\n<img width=\"1027\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce\">\r\n\r\n2.
rule details page\r\n<img width=\"762\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83\">\r\n\r\n\r\n\r\n###
AFTER\r\n1. overview page\r\n<img width=\"1015\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f\">\r\n\r\n2.
rule details page\r\n<img width=\"893\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c\">\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [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\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\nDone:
\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477","sha":"19a2ff81d5a542402a3f0c006d6b4986890d73f9","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[Security
Solution] Display cardinality for threshold
rules","number":201162,"url":"https://github.com/elastic/kibana/pull/201162","mergeCommit":{"message":"[Security
Solution] Display cardinality for threshold rules
(#201162)\n\n**Resolves #161576**\r\n\r\n## Summary\r\n\r\nThis PR fixes
the description of threshold rules. The problem was that\r\nif a
threshold rule contained 'Count' (cardinality) it wasn't
displayed\r\nneither in a summary while creating the rule, nor in the
rule details\r\npage. This PR fixes these two places, introducing
similar logic to the\r\ntwo places in the code, to display the
cardinality if it is present in\r\nthe threshold object.\r\n\r\n###
BEFORE\r\n1. overview page\r\n<img width=\"1027\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce\">\r\n\r\n2.
rule details page\r\n<img width=\"762\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83\">\r\n\r\n\r\n\r\n###
AFTER\r\n1. overview page\r\n<img width=\"1015\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f\">\r\n\r\n2.
rule details page\r\n<img width=\"893\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c\">\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [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\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\nDone:
\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477","sha":"19a2ff81d5a542402a3f0c006d6b4986890d73f9"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201162","number":201162,"mergeCommit":{"message":"[Security
Solution] Display cardinality for threshold rules
(#201162)\n\n**Resolves #161576**\r\n\r\n## Summary\r\n\r\nThis PR fixes
the description of threshold rules. The problem was that\r\nif a
threshold rule contained 'Count' (cardinality) it wasn't
displayed\r\nneither in a summary while creating the rule, nor in the
rule details\r\npage. This PR fixes these two places, introducing
similar logic to the\r\ntwo places in the code, to display the
cardinality if it is present in\r\nthe threshold object.\r\n\r\n###
BEFORE\r\n1. overview page\r\n<img width=\"1027\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce\">\r\n\r\n2.
rule details page\r\n<img width=\"762\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83\">\r\n\r\n\r\n\r\n###
AFTER\r\n1. overview page\r\n<img width=\"1015\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f\">\r\n\r\n2.
rule details page\r\n<img width=\"893\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c\">\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [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\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\nDone:
\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477","sha":"19a2ff81d5a542402a3f0c006d6b4986890d73f9"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jacek Kolezynski <[email protected]>
kibanamachine added a commit that referenced this pull request Nov 27, 2024
…201162) (#201958)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Security Solution] Display cardinality for threshold rules
(#201162)](#201162)

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

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

<!--BACKPORT [{"author":{"name":"Jacek
Kolezynski","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-27T12:11:41Z","message":"[Security
Solution] Display cardinality for threshold rules
(#201162)\n\n**Resolves #161576**\r\n\r\n## Summary\r\n\r\nThis PR fixes
the description of threshold rules. The problem was that\r\nif a
threshold rule contained 'Count' (cardinality) it wasn't
displayed\r\nneither in a summary while creating the rule, nor in the
rule details\r\npage. This PR fixes these two places, introducing
similar logic to the\r\ntwo places in the code, to display the
cardinality if it is present in\r\nthe threshold object.\r\n\r\n###
BEFORE\r\n1. overview page\r\n<img width=\"1027\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce\">\r\n\r\n2.
rule details page\r\n<img width=\"762\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83\">\r\n\r\n\r\n\r\n###
AFTER\r\n1. overview page\r\n<img width=\"1015\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f\">\r\n\r\n2.
rule details page\r\n<img width=\"893\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c\">\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [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\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\nDone:
\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477","sha":"19a2ff81d5a542402a3f0c006d6b4986890d73f9","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[Security
Solution] Display cardinality for threshold
rules","number":201162,"url":"https://github.com/elastic/kibana/pull/201162","mergeCommit":{"message":"[Security
Solution] Display cardinality for threshold rules
(#201162)\n\n**Resolves #161576**\r\n\r\n## Summary\r\n\r\nThis PR fixes
the description of threshold rules. The problem was that\r\nif a
threshold rule contained 'Count' (cardinality) it wasn't
displayed\r\nneither in a summary while creating the rule, nor in the
rule details\r\npage. This PR fixes these two places, introducing
similar logic to the\r\ntwo places in the code, to display the
cardinality if it is present in\r\nthe threshold object.\r\n\r\n###
BEFORE\r\n1. overview page\r\n<img width=\"1027\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce\">\r\n\r\n2.
rule details page\r\n<img width=\"762\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83\">\r\n\r\n\r\n\r\n###
AFTER\r\n1. overview page\r\n<img width=\"1015\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f\">\r\n\r\n2.
rule details page\r\n<img width=\"893\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c\">\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [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\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\nDone:
\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477","sha":"19a2ff81d5a542402a3f0c006d6b4986890d73f9"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201162","number":201162,"mergeCommit":{"message":"[Security
Solution] Display cardinality for threshold rules
(#201162)\n\n**Resolves #161576**\r\n\r\n## Summary\r\n\r\nThis PR fixes
the description of threshold rules. The problem was that\r\nif a
threshold rule contained 'Count' (cardinality) it wasn't
displayed\r\nneither in a summary while creating the rule, nor in the
rule details\r\npage. This PR fixes these two places, introducing
similar logic to the\r\ntwo places in the code, to display the
cardinality if it is present in\r\nthe threshold object.\r\n\r\n###
BEFORE\r\n1. overview page\r\n<img width=\"1027\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce\">\r\n\r\n2.
rule details page\r\n<img width=\"762\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83\">\r\n\r\n\r\n\r\n###
AFTER\r\n1. overview page\r\n<img width=\"1015\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f\">\r\n\r\n2.
rule details page\r\n<img width=\"893\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c\">\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [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\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\nDone:
\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477","sha":"19a2ff81d5a542402a3f0c006d6b4986890d73f9"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jacek Kolezynski <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…201162)

**Resolves elastic#161576**

## Summary

This PR fixes the description of threshold rules. The problem was that
if a threshold rule contained 'Count' (cardinality) it wasn't displayed
neither in a summary while creating the rule, nor in the rule details
page. This PR fixes these two places, introducing similar logic to the
two places in the code, to display the cardinality if it is present in
the threshold object.

### BEFORE
1. overview page
<img width="1027" alt="image"
src="https://github.com/user-attachments/assets/b927b4e0-f2a0-41ba-87e0-441a53760cce">

2. rule details page
<img width="762" alt="image"
src="https://github.com/user-attachments/assets/486f8616-8582-45ea-9422-bfd554e2ae83">



### AFTER
1. overview page
<img width="1015" alt="image"
src="https://github.com/user-attachments/assets/06a5e0d1-76ef-434e-9c1c-cce6c3ff504f">

2. rule details page
<img width="893" alt="image"
src="https://github.com/user-attachments/assets/40acd7d4-4058-40c0-aa19-e5f489c53c2c">


### 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/packages/kbn-i18n/README.md)
- [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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
Done: 
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7474
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7473
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7476
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7477
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 Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area release_note:fix 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.16.2 v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solution] Show count field on Rule details page for threshold rules
6 participants