Skip to content

Comments

[Security Solution] Stop showing ML rule installation and upgrade errors on Basic license#224676

Merged
nikitaindik merged 15 commits intoelastic:mainfrom
nikitaindik:fix-ml-rule-install-and-upgrade-on-basic
Jul 3, 2025
Merged

[Security Solution] Stop showing ML rule installation and upgrade errors on Basic license#224676
nikitaindik merged 15 commits intoelastic:mainfrom
nikitaindik:fix-ml-rule-install-and-upgrade-on-basic

Conversation

@nikitaindik
Copy link
Contributor

@nikitaindik nikitaindik commented Jun 20, 2025

Resolves: #197246
Resolves: #190753

Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483

Summary

This PR addresses an issue where users with Basic or Essentials licenses encountered errors when attempting to install ML rules. This problem arose because Basic and Essentials licenses do not permit the installation or upgrading of ML rules. The PR resolves this by excluding ML rules from the installation and upgrade _review endpoint responses for users with insufficient license.

Changes

  • installation/_review and upgrade/_review don't return ML rules for users on Basic/Essentials.
  • prebuilt_rules/status does not include ML rules in the count of rules to install or upgrade.
  • installation/_perform and upgrade/_perform now skip ML rules when called with ALL_RULES mode if the license is insufficient.
  • Added API integration tests for installing and upgrading prebuilt rules on Basic and Essentials, as well as for checking their status.
  • Now, installation and upgrade errors are displayed in a separate "red" toast if any rules fail to install or upgrade.
  • Added tests for toasts as well.

Screenshots and screen recordings

Installing all prebuilt rules

Click to see screen recordings Before
installation_before.mov

After

installation_after.mov

Upgrading all prebuilt rules

Click to see screen recordings Before
upgrade_before.mov

After

upgrade_after.mov

Errors during installation (unrelated to ML rules)

Click to see screenshots

Before: a green toast with combined success and error text

installation_toast_before

After: two toasts – one for success, one for errors

installation_toast_after_1 installation_toast_after_2

@nikitaindik nikitaindik self-assigned this Jun 20, 2025
@nikitaindik nikitaindik force-pushed the fix-ml-rule-install-and-upgrade-on-basic branch from 2011342 to 6201184 Compare June 26, 2025 15:28
@nikitaindik nikitaindik 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 v8.19.0 v8.18.4 v9.0.4 v9.1.0 v9.2.0 backport:version Backport to applied version labels release_note:fix Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area labels Jun 27, 2025
@nikitaindik nikitaindik marked this pull request as ready for review June 27, 2025 14:23
@nikitaindik nikitaindik requested review from a team as code owners June 27, 2025 14:23
@nikitaindik nikitaindik requested a review from jkelas June 27, 2025 14:23
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.18 Backport failed because of merge conflicts
8.19 Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts
9.1

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 224676

Questions ?

Please refer to the Backport tool documentation

nikitaindik added a commit to nikitaindik/kibana that referenced this pull request Jul 3, 2025
…ors on Basic license (elastic#224676)

**Resolves: elastic#197246
**Resolves: elastic#190753

**Flaky test runner**:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483

## Summary
This PR addresses an issue where users with Basic or Essentials licenses
encountered errors when attempting to install ML rules. This problem
arose because Basic and Essentials licenses do not permit the
installation or upgrading of ML rules. The PR resolves this by excluding
ML rules from the installation and upgrade `_review` endpoint responses
for users with insufficient license.

## Changes
- `installation/_review` and `upgrade/_review` don't return ML rules for
users on Basic/Essentials.
- `prebuilt_rules/status` does not include ML rules in the count of
rules to install or upgrade.
- `installation/_perform` and `upgrade/_perform` now skip ML rules when
called with `ALL_RULES` mode if the license is insufficient.
- Added API integration tests for installing and upgrading prebuilt
rules on Basic and Essentials, as well as for checking their status.
- Now, installation and upgrade errors are displayed in a separate "red"
toast if any rules fail to install or upgrade.
- Added tests for toasts as well.

## Screenshots and screen recordings
### Installing all prebuilt rules

<details>
  <summary>Click to see screen recordings</summary>
  <b>Before</b>

https://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261

  <b>After</b>

https://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea

</details>

### Upgrading all prebuilt rules
<details>
  <summary>Click to see screen recordings</summary>
  <b>Before</b>

https://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69

  <b>After</b>

https://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9

</details>

### Errors during installation (unrelated to ML rules)
<details>
  <summary>Click to see screenshots</summary>

  **Before: a green toast with combined success and error text**

<img width="2561" alt="installation_toast_before"
src="https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885"
/>

  **After: two toasts – one for success, one for errors**

<img width="2561" alt="installation_toast_after_1"
src="https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b"
/>
<img width="2561" alt="installation_toast_after_2"
src="https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243"
/>

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nikitaindik added a commit to nikitaindik/kibana that referenced this pull request Jul 3, 2025
…ors on Basic license (elastic#224676)

**Resolves: elastic#197246
**Resolves: elastic#190753

**Flaky test runner**:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483

## Summary
This PR addresses an issue where users with Basic or Essentials licenses
encountered errors when attempting to install ML rules. This problem
arose because Basic and Essentials licenses do not permit the
installation or upgrading of ML rules. The PR resolves this by excluding
ML rules from the installation and upgrade `_review` endpoint responses
for users with insufficient license.

## Changes
- `installation/_review` and `upgrade/_review` don't return ML rules for
users on Basic/Essentials.
- `prebuilt_rules/status` does not include ML rules in the count of
rules to install or upgrade.
- `installation/_perform` and `upgrade/_perform` now skip ML rules when
called with `ALL_RULES` mode if the license is insufficient.
- Added API integration tests for installing and upgrading prebuilt
rules on Basic and Essentials, as well as for checking their status.
- Now, installation and upgrade errors are displayed in a separate "red"
toast if any rules fail to install or upgrade.
- Added tests for toasts as well.

## Screenshots and screen recordings
### Installing all prebuilt rules

<details>
  <summary>Click to see screen recordings</summary>
  <b>Before</b>

https://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261

  <b>After</b>

https://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea

</details>

### Upgrading all prebuilt rules
<details>
  <summary>Click to see screen recordings</summary>
  <b>Before</b>

https://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69

  <b>After</b>

https://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9

</details>

### Errors during installation (unrelated to ML rules)
<details>
  <summary>Click to see screenshots</summary>

  **Before: a green toast with combined success and error text**

<img width="2561" alt="installation_toast_before"
src="https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885"
/>

  **After: two toasts – one for success, one for errors**

<img width="2561" alt="installation_toast_after_1"
src="https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b"
/>
<img width="2561" alt="installation_toast_after_2"
src="https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243"
/>

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit e19fdf8)

# Conflicts:
#	x-pack/solutions/security/plugins/security_solution/server/request_context_factory.ts
#	x-pack/solutions/security/plugins/security_solution/server/types.ts
@nikitaindik
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.0
8.19
8.18

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

Questions ?

Please refer to the Backport tool documentation

nikitaindik added a commit to nikitaindik/kibana that referenced this pull request Jul 3, 2025
…ors on Basic license (elastic#224676)

**Resolves: elastic#197246
**Resolves: elastic#190753

**Flaky test runner**:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483

## Summary
This PR addresses an issue where users with Basic or Essentials licenses
encountered errors when attempting to install ML rules. This problem
arose because Basic and Essentials licenses do not permit the
installation or upgrading of ML rules. The PR resolves this by excluding
ML rules from the installation and upgrade `_review` endpoint responses
for users with insufficient license.

## Changes
- `installation/_review` and `upgrade/_review` don't return ML rules for
users on Basic/Essentials.
- `prebuilt_rules/status` does not include ML rules in the count of
rules to install or upgrade.
- `installation/_perform` and `upgrade/_perform` now skip ML rules when
called with `ALL_RULES` mode if the license is insufficient.
- Added API integration tests for installing and upgrading prebuilt
rules on Basic and Essentials, as well as for checking their status.
- Now, installation and upgrade errors are displayed in a separate "red"
toast if any rules fail to install or upgrade.
- Added tests for toasts as well.

## Screenshots and screen recordings
### Installing all prebuilt rules

<details>
  <summary>Click to see screen recordings</summary>
  <b>Before</b>

https://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261

  <b>After</b>

https://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea

</details>

### Upgrading all prebuilt rules
<details>
  <summary>Click to see screen recordings</summary>
  <b>Before</b>

https://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69

  <b>After</b>

https://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9

</details>

### Errors during installation (unrelated to ML rules)
<details>
  <summary>Click to see screenshots</summary>

  **Before: a green toast with combined success and error text**

<img width="2561" alt="installation_toast_before"
src="https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885"
/>

  **After: two toasts – one for success, one for errors**

<img width="2561" alt="installation_toast_after_1"
src="https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b"
/>
<img width="2561" alt="installation_toast_after_2"
src="https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243"
/>

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit e19fdf8)

# Conflicts:
#	.buildkite/ftr_security_serverless_configs.yml
#	.buildkite/ftr_security_stateful_configs.yml
#	x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/prebuilt_rule_objects_client.ts
#	x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts
#	x-pack/solutions/security/plugins/security_solution/server/request_context_factory.ts
#	x-pack/solutions/security/plugins/security_solution/server/types.ts
#	x-pack/test/security_solution_api_integration/tsconfig.json
kibanamachine added a commit that referenced this pull request Jul 3, 2025
…de errors on Basic license (#224676) (#226352)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Security Solution] Stop showing ML rule installation and upgrade
errors on Basic license
(#224676)](#224676)

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

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

<!--BACKPORT [{"author":{"name":"Nikita
Indik","email":"nikita.indik@elastic.co"},"sourceCommit":{"committedDate":"2025-07-03T08:43:07Z","message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license","number":224676,"url":"https://github.com/elastic/kibana/pull/224676","mergeCommit":{"message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224676","number":224676,"mergeCommit":{"message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nikita Indik <nikita.indik@elastic.co>
nikitaindik added a commit that referenced this pull request Jul 4, 2025
…de errors on Basic license (#224676) (#226357)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Solution] Stop showing ML rule installation and upgrade
errors on Basic license
(#224676)](#224676)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Nikita
Indik","email":"nikita.indik@elastic.co"},"sourceCommit":{"committedDate":"2025-07-03T08:43:07Z","message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license","number":224676,"url":"https://github.com/elastic/kibana/pull/224676","mergeCommit":{"message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226352","number":226352,"state":"OPEN"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224676","number":224676,"mergeCommit":{"message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nikitaindik added a commit that referenced this pull request Jul 4, 2025
…ade errors on Basic license (#224676) (#226359)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Security Solution] Stop showing ML rule installation and upgrade
errors on Basic license
(#224676)](#224676)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Nikita
Indik","email":"nikita.indik@elastic.co"},"sourceCommit":{"committedDate":"2025-07-03T08:43:07Z","message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license","number":224676,"url":"https://github.com/elastic/kibana/pull/224676","mergeCommit":{"message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226352","number":226352,"state":"OPEN"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224676","number":224676,"mergeCommit":{"message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
nikitaindik added a commit that referenced this pull request Jul 4, 2025
…ade errors on Basic license (#224676) (#226361)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security Solution] Stop showing ML rule installation and upgrade
errors on Basic license
(#224676)](#224676)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Nikita
Indik","email":"nikita.indik@elastic.co"},"sourceCommit":{"committedDate":"2025-07-03T08:43:07Z","message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license","number":224676,"url":"https://github.com/elastic/kibana/pull/224676","mergeCommit":{"message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226352","number":226352,"state":"OPEN"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224676","number":224676,"mergeCommit":{"message":"[Security
Solution] Stop showing ML rule installation and upgrade errors on Basic
license (#224676)\n\n**Resolves:
https://github.com/elastic/kibana/issues/197246**\n**Resolves:
https://github.com/elastic/kibana/issues/190753**\n\n**Flaky test
runner**:\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483\n\n\n\n##
Summary\nThis PR addresses an issue where users with Basic or Essentials
licenses\nencountered errors when attempting to install ML rules. This
problem\narose because Basic and Essentials licenses do not permit
the\ninstallation or upgrading of ML rules. The PR resolves this by
excluding\nML rules from the installation and upgrade `_review` endpoint
responses\nfor users with insufficient license.\n\n## Changes\n-
`installation/_review` and `upgrade/_review` don't return ML rules
for\nusers on Basic/Essentials.\n- `prebuilt_rules/status` does not
include ML rules in the count of\nrules to install or upgrade.\n-
`installation/_perform` and `upgrade/_perform` now skip ML rules
when\ncalled with `ALL_RULES` mode if the license is insufficient.\n-
Added API integration tests for installing and upgrading prebuilt\nrules
on Basic and Essentials, as well as for checking their status.\n- Now,
installation and upgrade errors are displayed in a separate
\"red\"\ntoast if any rules fail to install or upgrade.\n- Added tests
for toasts as well.\n\n## Screenshots and screen recordings\n###
Installing all prebuilt rules\n\n<details>\n <summary>Click to see
screen recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea\n\n</details>\n\n###
Upgrading all prebuilt rules\n<details>\n <summary>Click to see screen
recordings</summary>\n
<b>Before</b>\n\n\nhttps://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69\n\n
<b>After</b>\n\n\nhttps://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9\n\n</details>\n\n###
Errors during installation (unrelated to ML rules)\n<details>\n
<summary>Click to see screenshots</summary>\n\n **Before: a green toast
with combined success and error text**\n \n<img width=\"2561\"
alt=\"installation_toast_before\"\nsrc=\"https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885\"\n/>\n\n\n
**After: two toasts – one for success, one for errors**\n\n<img
width=\"2561\"
alt=\"installation_toast_after_1\"\nsrc=\"https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b\"\n/>\n<img
width=\"2561\"
alt=\"installation_toast_after_2\"\nsrc=\"https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243\"\n/>\n\n\n</details>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"e19fdf8dd600e849413b680c730b03ac9aa2f725"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
maximpn added a commit that referenced this pull request Jul 10, 2025
…e integration tests (#226759)

## Summary

This PR enables accidentally skipped prebuilt rules package integration tests.

## Details

The integration tests were accidentally skipped by missing `loadTestFile(require.resolve('./prebuilt_rules_package'));` line in #225495 as the result of merge conflicts.

Enabling those integration tests revealed an issue with the installing all prebuilt rules integration tests. Since the prebuilt rules package contains ML rules all rules installation fails under the low-tier license as ML rules require high-tier license. So this single test was changed to run under high-tier license.

Just for the record, ML related UI issues has been addressed in #224676. It means that users may observe this error under low-tier license only by using the API directly.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 10, 2025
…e integration tests (elastic#226759)

## Summary

This PR enables accidentally skipped prebuilt rules package integration tests.

## Details

The integration tests were accidentally skipped by missing `loadTestFile(require.resolve('./prebuilt_rules_package'));` line in elastic#225495 as the result of merge conflicts.

Enabling those integration tests revealed an issue with the installing all prebuilt rules integration tests. Since the prebuilt rules package contains ML rules all rules installation fails under the low-tier license as ML rules require high-tier license. So this single test was changed to run under high-tier license.

Just for the record, ML related UI issues has been addressed in elastic#224676. It means that users may observe this error under low-tier license only by using the API directly.

(cherry picked from commit 189cfb5)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 10, 2025
…e integration tests (elastic#226759)

## Summary

This PR enables accidentally skipped prebuilt rules package integration tests.

## Details

The integration tests were accidentally skipped by missing `loadTestFile(require.resolve('./prebuilt_rules_package'));` line in elastic#225495 as the result of merge conflicts.

Enabling those integration tests revealed an issue with the installing all prebuilt rules integration tests. Since the prebuilt rules package contains ML rules all rules installation fails under the low-tier license as ML rules require high-tier license. So this single test was changed to run under high-tier license.

Just for the record, ML related UI issues has been addressed in elastic#224676. It means that users may observe this error under low-tier license only by using the API directly.

(cherry picked from commit 189cfb5)
kibanamachine added a commit that referenced this pull request Jul 10, 2025
…package integration tests (#226759) (#227506)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Security Solution] Enable accidentally skipped prebuilt rules
package integration tests
(#226759)](#226759)

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

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T17:32:29Z","message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests","number":226759,"url":"https://github.com/elastic/kibana/pull/226759","mergeCommit":{"message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226759","number":226759,"mergeCommit":{"message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 10, 2025
… package integration tests (#226759) (#227505)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Security Solution] Enable accidentally skipped prebuilt rules
package integration tests
(#226759)](#226759)

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

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T17:32:29Z","message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests","number":226759,"url":"https://github.com/elastic/kibana/pull/226759","mergeCommit":{"message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226759","number":226759,"mergeCommit":{"message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 11, 2025
…e integration tests (elastic#226759)

## Summary

This PR enables accidentally skipped prebuilt rules package integration tests.

## Details

The integration tests were accidentally skipped by missing `loadTestFile(require.resolve('./prebuilt_rules_package'));` line in elastic#225495 as the result of merge conflicts.

Enabling those integration tests revealed an issue with the installing all prebuilt rules integration tests. Since the prebuilt rules package contains ML rules all rules installation fails under the low-tier license as ML rules require high-tier license. So this single test was changed to run under high-tier license.

Just for the record, ML related UI issues has been addressed in elastic#224676. It means that users may observe this error under low-tier license only by using the API directly.

(cherry picked from commit 189cfb5)

# Conflicts:
#	x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/index.ts
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 11, 2025
…e integration tests (elastic#226759)

## Summary

This PR enables accidentally skipped prebuilt rules package integration tests.

## Details

The integration tests were accidentally skipped by missing `loadTestFile(require.resolve('./prebuilt_rules_package'));` line in elastic#225495 as the result of merge conflicts.

Enabling those integration tests revealed an issue with the installing all prebuilt rules integration tests. Since the prebuilt rules package contains ML rules all rules installation fails under the low-tier license as ML rules require high-tier license. So this single test was changed to run under high-tier license.

Just for the record, ML related UI issues has been addressed in elastic#224676. It means that users may observe this error under low-tier license only by using the API directly.

(cherry picked from commit 189cfb5)

# Conflicts:
#	x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/index.ts
maximpn added a commit that referenced this pull request Jul 11, 2025
…package integration tests (#226759) (#227565)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Solution] Enable accidentally skipped prebuilt rules
package integration tests
(#226759)](#226759)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T17:32:29Z","message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests","number":226759,"url":"https://github.com/elastic/kibana/pull/226759","mergeCommit":{"message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/227506","number":227506,"state":"MERGED","mergeCommit":{"sha":"93f21228e7cf49d7f93ea857c2a815203083181d","message":"[9.1]
[Security Solution] Enable accidentally skipped prebuilt rules package
integration tests (#226759) (#227506)\n\n# Backport\n\nThis will
backport the following commits from `main` to `9.1`:\n- [[Security
Solution] Enable accidentally skipped prebuilt rules\npackage
integration
tests\n(#226759)](https://github.com/elastic/kibana/pull/226759)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Maxim Palenov
<maxim.palenov@elastic.co>"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/227505","number":227505,"state":"MERGED","mergeCommit":{"sha":"4c9c5dfadc63a489fbdba79f18f94134cb08c80b","message":"[8.19]
[Security Solution] Enable accidentally skipped prebuilt rules package
integration tests (#226759) (#227505)\n\n# Backport\n\nThis will
backport the following commits from `main` to `8.19`:\n- [[Security
Solution] Enable accidentally skipped prebuilt rules\npackage
integration
tests\n(#226759)](https://github.com/elastic/kibana/pull/226759)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Maxim Palenov
<maxim.palenov@elastic.co>"}},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226759","number":226759,"mergeCommit":{"message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
maximpn added a commit that referenced this pull request Jul 12, 2025
… package integration tests (#226759) (#227566)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security Solution] Enable accidentally skipped prebuilt rules
package integration tests
(#226759)](#226759)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-07-10T17:32:29Z","message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests","number":226759,"url":"https://github.com/elastic/kibana/pull/226759","mergeCommit":{"message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/227506","number":227506,"state":"MERGED","mergeCommit":{"sha":"93f21228e7cf49d7f93ea857c2a815203083181d","message":"[9.1]
[Security Solution] Enable accidentally skipped prebuilt rules package
integration tests (#226759) (#227506)\n\n# Backport\n\nThis will
backport the following commits from `main` to `9.1`:\n- [[Security
Solution] Enable accidentally skipped prebuilt rules\npackage
integration
tests\n(#226759)](https://github.com/elastic/kibana/pull/226759)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Maxim Palenov
<maxim.palenov@elastic.co>"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/227505","number":227505,"state":"MERGED","mergeCommit":{"sha":"4c9c5dfadc63a489fbdba79f18f94134cb08c80b","message":"[8.19]
[Security Solution] Enable accidentally skipped prebuilt rules package
integration tests (#226759) (#227505)\n\n# Backport\n\nThis will
backport the following commits from `main` to `8.19`:\n- [[Security
Solution] Enable accidentally skipped prebuilt rules\npackage
integration
tests\n(#226759)](https://github.com/elastic/kibana/pull/226759)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Maxim Palenov
<maxim.palenov@elastic.co>"}},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226759","number":226759,"mergeCommit":{"message":"[Security
Solution] Enable accidentally skipped prebuilt rules package integration
tests (#226759)\n\n## Summary\n\nThis PR enables accidentally skipped
prebuilt rules package integration tests.\n\n## Details\n\nThe
integration tests were accidentally skipped by missing
`loadTestFile(require.resolve('./prebuilt_rules_package'));` line in
#225495 as the result of merge
conflicts.\n\nEnabling those integration tests revealed an issue with
the installing all prebuilt rules integration tests. Since the prebuilt
rules package contains ML rules all rules installation fails under the
low-tier license as ML rules require high-tier license. So this single
test was changed to run under high-tier license.\n\nJust for the record,
ML related UI issues has been addressed in
#224676. It means that users may
observe this error under low-tier license only by using the API
directly.","sha":"189cfb5bce4e490e73e1c16faf8bddbd203d8b2a"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…ors on Basic license (elastic#224676)

**Resolves: elastic#197246
**Resolves: elastic#190753

**Flaky test runner**:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8483



## Summary
This PR addresses an issue where users with Basic or Essentials licenses
encountered errors when attempting to install ML rules. This problem
arose because Basic and Essentials licenses do not permit the
installation or upgrading of ML rules. The PR resolves this by excluding
ML rules from the installation and upgrade `_review` endpoint responses
for users with insufficient license.

## Changes
- `installation/_review` and `upgrade/_review` don't return ML rules for
users on Basic/Essentials.
- `prebuilt_rules/status` does not include ML rules in the count of
rules to install or upgrade.
- `installation/_perform` and `upgrade/_perform` now skip ML rules when
called with `ALL_RULES` mode if the license is insufficient.
- Added API integration tests for installing and upgrading prebuilt
rules on Basic and Essentials, as well as for checking their status.
- Now, installation and upgrade errors are displayed in a separate "red"
toast if any rules fail to install or upgrade.
- Added tests for toasts as well.

## Screenshots and screen recordings
### Installing all prebuilt rules

<details>
  <summary>Click to see screen recordings</summary>
  <b>Before</b>


https://github.com/user-attachments/assets/4e68d4c8-5523-495f-9157-41a5f037d261

  <b>After</b>


https://github.com/user-attachments/assets/465a2bc0-fd89-49cc-9bdb-78d45a6545ea

</details>

### Upgrading all prebuilt rules
<details>
  <summary>Click to see screen recordings</summary>
  <b>Before</b>


https://github.com/user-attachments/assets/6e7e4299-2348-43b3-b5f6-ed31cf350a69

  <b>After</b>


https://github.com/user-attachments/assets/84303135-2ed0-4014-a677-d182f2a105c9

</details>

### Errors during installation (unrelated to ML rules)
<details>
  <summary>Click to see screenshots</summary>

  **Before: a green toast with combined success and error text**
  
<img width="2561" alt="installation_toast_before"
src="https://github.com/user-attachments/assets/35d4134b-643b-4e91-8971-de8d63a4c885"
/>


  **After: two toasts – one for success, one for errors**

<img width="2561" alt="installation_toast_after_1"
src="https://github.com/user-attachments/assets/cc967445-e8fc-4508-a39d-a13116c4087b"
/>
<img width="2561" alt="installation_toast_after_2"
src="https://github.com/user-attachments/assets/0c2fcbae-484f-4458-8151-29de2a09e243"
/>


</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…e integration tests (elastic#226759)

## Summary

This PR enables accidentally skipped prebuilt rules package integration tests.

## Details

The integration tests were accidentally skipped by missing `loadTestFile(require.resolve('./prebuilt_rules_package'));` line in elastic#225495 as the result of merge conflicts.

Enabling those integration tests revealed an issue with the installing all prebuilt rules integration tests. Since the prebuilt rules package contains ML rules all rules installation fails under the low-tier license as ML rules require high-tier license. So this single test was changed to run under high-tier license.

Just for the record, ML related UI issues has been addressed in elastic#224676. It means that users may observe this error under low-tier license only by using the API directly.
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.18.4 v8.19.0 v9.0.4 v9.1.0 v9.2.0

Projects

None yet

5 participants