Skip to content

Comments

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

Merged
nikitaindik merged 4 commits intoelastic:9.0from
nikitaindik:backport/9.0/pr-224676
Jul 4, 2025
Merged

[9.0] [Security Solution] Stop showing ML rule installation and upgrade errors on Basic license (#224676)#226357
nikitaindik merged 4 commits intoelastic:9.0from
nikitaindik:backport/9.0/pr-224676

Conversation

@nikitaindik
Copy link
Contributor

Backport

This will backport the following commits from main to 9.0:

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>
@nikitaindik nikitaindik marked this pull request as draft July 3, 2025 15:33
auto-merge was automatically disabled July 3, 2025 15:33

Pull request was converted to draft

@nikitaindik nikitaindik marked this pull request as ready for review July 3, 2025 15:33
@nikitaindik nikitaindik enabled auto-merge (squash) July 3, 2025 15:34
@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 3, 2025

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #2 / TableListView tag filtering should filter by tag from the search bar filter

History

@nikitaindik nikitaindik merged commit cc3ed13 into elastic:9.0 Jul 4, 2025
9 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.

4 participants