Skip to content

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

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

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

Conversation

@nikitaindik
Copy link
Contributor

Backport

This will backport the following commits from main to 8.18:

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:
#	.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
@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 3, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #84 / InfraOps App Metrics UI Node Details #Asset Type: host Logs Tab preserves search term between page reloads

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
securitySolution 121 122 +1

Async chunks

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

id before after diff
securitySolution 9.1MB 9.1MB +506.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
securitySolution 33 34 +1
Unknown metric groups

API count

id before after diff
securitySolution 189 190 +1

History

@nikitaindik nikitaindik merged commit d7c410b into elastic:8.18 Jul 4, 2025
8 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