Skip to content

Comments

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

Merged
nikitaindik merged 1 commit intoelastic:8.19from
nikitaindik:backport/8.19/pr-224676
Jul 4, 2025
Merged

[8.19] [Security Solution] Stop showing ML rule installation and upgrade errors on Basic license (#224676)#226359
nikitaindik merged 1 commit intoelastic:8.19from
nikitaindik:backport/8.19/pr-224676

Conversation

@nikitaindik
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…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 nikitaindik added the backport This PR is a backport of another PR label Jul 3, 2025
@nikitaindik nikitaindik added the backport This PR is a backport of another PR label Jul 3, 2025
@nikitaindik nikitaindik enabled auto-merge (squash) July 3, 2025 09:29
@nikitaindik nikitaindik merged commit 45bb2d1 into elastic:8.19 Jul 4, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants