-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution] Bulk update on index pattern for ML rules #124918
Comments
Pinging @elastic/security-solution (Team: SecuritySolution) |
@MadameSheema FYI |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
@yiyangliu9286 , @jethr0null , can you please look at this issue.
Or maybe we can combine approaches |
Synced with @vitaliidm on the current behavior of the bulk actions endpoint. So if the user tries to edit (add, remove, overwrite) index patterns of a set of rules, and there is one or a few ML rules among them, the endpoint will silently skip applying this modification to the ML rules. However, in the endpoint response, these ML rules will be represented as successfully updated, which is not true. The server-side logic is going to be fixed in #124525 in such a way that the endpoint will return an error for every attempt to edit index patterns of an ML rule. |
Thanks for the update and the proposed solution @vitaliidm @banderror! I think from the frond-end UI perceptive we'd like to notify users about ML rules cannot be edited (as well as the existing prebuilt rules which also cannot be edited atm), here are 4 scenarios:
|
@yiyangliu9286 , I'm thinking this approach can be too complex to scale Right now we would have 7 scenarios:
If there would be yet another one uneditable rule type: we will end up with ~ 12 scenarios and so on and so on. Plus:
Instead, what if would have just common 3 scenarios:
This way, if there would be another type of not applicable action, we would just add another item in a list. |
I agree with @vitaliidm - let's keep the title as simple as possible without permutations and combinations, and represent types of rules that can't be edited in the form of a list. I'd maybe suggest
|
…stions and increases test coverage (#124525) Issue: #125223 ## Summary - removes try/catch for bulk edit operation - removes isElasticRule in bulk route API, replaces with rule.params.immutable check(as isElasticRule is used within telemetry) - adds Cypress tests - fixes case when index pattern action applied to ML rule. As ML rules don't have index pattern, so we will throw error if there is an attempt to run this action. It partially addresses #124918 - now checks if updated index patterns array is empty, if it is: throws error(#125223)
…stions and increases test coverage (elastic#124525) Issue: elastic#125223 ## Summary - removes try/catch for bulk edit operation - removes isElasticRule in bulk route API, replaces with rule.params.immutable check(as isElasticRule is used within telemetry) - adds Cypress tests - fixes case when index pattern action applied to ML rule. As ML rules don't have index pattern, so we will throw error if there is an attempt to run this action. It partially addresses elastic#124918 - now checks if updated index patterns array is empty, if it is: throws error(elastic#125223) (cherry picked from commit ae51f81)
…stions and increases test coverage (#124525) (#125437) Issue: #125223 ## Summary - removes try/catch for bulk edit operation - removes isElasticRule in bulk route API, replaces with rule.params.immutable check(as isElasticRule is used within telemetry) - adds Cypress tests - fixes case when index pattern action applied to ML rule. As ML rules don't have index pattern, so we will throw error if there is an attempt to run this action. It partially addresses #124918 - now checks if updated index patterns array is empty, if it is: throws error(#125223) (cherry picked from commit ae51f81) Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
Okie, so the server-side logic has been fixed in #124525 and will be released in |
Hi @vitaliidm and @banderror! Thanks for the suggested path and providing your thoughts on how to improve and better resolve this issue by considering the current and future use cases! I think your proposal would be the most simplified and intuitive way to address this - we wouldn't want to create a lot of complicated use cases to potentially create users confusion, so let's proceed to fix this issue to align your thoughts here. Let's limit users options for those 3 scenarios you've mentioned above (I think it makes sense to to able to explain to users why those rules aren't editable) Here are the updated designs:
|
@banderror For clarification, will we be providing a fix for this bug in |
@cybersecdiva Yup, it's in our checklist for |
Just an update that the team thinks that we should address #125512 before fixing the remainder of this bug. I'll push it to the 8.4 scope. |
Hey @yiyangliu9286
Please, let me know if you are fine with this implementation |
Thanks for showing this @vitaliidm! This looks good to me. The only thing I'd say is to make the format of the two bullet points consistent:
|
…dle for bulk edit of ML rule index (#134664) ## Summary Addresses: - #125512 - #124918 Implemented - Adds new search query parameter `dry_run` to _bulk_action API, that allows simulate bulk action without actually updating rules. More details in the [ticket](#125512 (comment)) - Changes the way, modal window is displaying before applying bulk edit action(index patterns, timeline, tags). Before displaying modal window, dry_run bulk action request will be send to get information how many rules can be edited. Based on this result, modal window displays how many rules can be edited and how many can't(with displaying error of validation). Users then can proceed to edit rules, that haven't failed during dry run. Validation errors include at this point - immutable rules - index pattern action on ML rule - default error message handle, that displays error message, with which rule failed ### Before Error displayed when user tried to apply index pattern action to ML rule https://user-images.githubusercontent.com/92328789/175342440-39ede444-d90e-4294-a68f-b9f3c83a81d1.mov <img width="2011" alt="Screenshot 2022-06-23 at 16 55 52" src="https://user-images.githubusercontent.com/92328789/175342592-a271e2c3-ccf7-43ee-a579-02bc7cc71264.png"> ### After Modal window is displayed with message that index pattern action can't be applied to ML rule https://user-images.githubusercontent.com/92328789/174799973-8dc28c14-4413-4837-adf9-644bf4c81297.mov <img width="1535" alt="Screenshot 2022-06-21 at 13 34 27" src="https://user-images.githubusercontent.com/92328789/174800195-184f9233-e552-411d-a815-5950dbb44cf8.png"> ### Follow-ups: Once merged, create PR for Security Solution API documentation ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Release note - adds dry run mode for /detection_engine/rules/_bulk_action API - displays warning modal when user will try to apply index pattern bulk edit action to Machine Learning rule
@cybersecdiva, issue has been addressed in #134664 |
Hi Team, We have validated above issue on 8.4.0 BC1 and it's working fine. 🟢 Build Details
Screenshots:
Please let us know if we need to cover any other scenarios or we are good to close this issue. Thanks ! CC: @MadameSheema |
I think we've addressed all the issues described in this ticket and can close it @karanverma-qasource. Thank you. |
Describe the bug:
ML rules doesn't have index patterns. Users should not be able to modify and update and add index patterns
Kibana/Elasticsearch Stack version:
8.1 BC1
Steps to reproduce:
Go to Rules overview and search Ml and select Mltest rules
(
apm-*-transaction
,traces-apm*
,auditbeat-*
,endgame-*
,filebeat-*
,logs-*,
packetbeat-*
,winlogbeat-*
)Note: Behavior was also tested with the selection of a single index pattern, and the same result produced and allowed bulk update on index pattern for ML rule
Current behavior:

Expected behavior:
The selection for modification add/delete index patterns for ML rules should prompt an error message
The text was updated successfully, but these errors were encountered: