Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.18] [SecuritySolution] Fix Risk score Insufficient privileges warn…
…ing missing cluster privileges (#212405) (#213378) # Backport This will backport the following commits from `main` to `8.18`: - [[SecuritySolution] Fix Risk score Insufficient privileges warning missing cluster privileges (#212405)](#212405) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Pablo Machado","email":"pablo.nevesmachado@elastic.co"},"sourceCommit":{"committedDate":"2025-03-06T09:51:08Z","message":"[SecuritySolution] Fix Risk score Insufficient privileges warning missing cluster privileges (#212405)\n\n## Summary\n\n### \n* Fixes Bug: User with no cluster privileges should not be able to\nenable the risk score\nWhen users with no cluster privileges open the risk score page, they\ndon't see any errors and are able to click the install button.\n\nThis happened because we were only checking for index privileges in the\nUI, but for the enablement flow we also need to check cluster\nprivileges. I also introduced a new parameter to the missing privileges\nhook so pages that only need to check for `read` privileges can work as\nbefore.\n\n\nhttps://github.com/user-attachments/assets/fe162005-ee2b-497d-8744-6262e4511d2d\n\n\n* Fixed Bug: The install button was enabled when all toggles were\ndisabled\nThere were too many booleans in the panel, which was confusing and led\nme to introduce more bugs while trying to fix this one, so I refactored\nthe code to understand it before fixing it.\nI also simplified the logic to display the modal. Now, it only shows\nwhen one of the engines' status is \"not_installed\"\n\n<img width=\"300\"\nsrc=\"https://github.com/user-attachments/assets/a2e8fbba-ac64-4c97-9ef0-ef6fe61e60cd\"\n/>\n\n\n\n\n\n\n\n### To Reproduce\n\n1. Create a user with security privileges and index privileges but no\ncluster privileges\n2. Go to the risk score page and enable the toggle\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or","sha":"b69b696e7fddf4bb26d038f1deaa6388051c428d","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team: SecuritySolution","Theme: entity_analytics","Feature:Entity Analytics","Team:Entity Analytics","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[SecuritySolution] Fix Risk score Insufficient privileges warning missing cluster privileges","number":212405,"url":"https://github.com/elastic/kibana/pull/212405","mergeCommit":{"message":"[SecuritySolution] Fix Risk score Insufficient privileges warning missing cluster privileges (#212405)\n\n## Summary\n\n### \n* Fixes Bug: User with no cluster privileges should not be able to\nenable the risk score\nWhen users with no cluster privileges open the risk score page, they\ndon't see any errors and are able to click the install button.\n\nThis happened because we were only checking for index privileges in the\nUI, but for the enablement flow we also need to check cluster\nprivileges. I also introduced a new parameter to the missing privileges\nhook so pages that only need to check for `read` privileges can work as\nbefore.\n\n\nhttps://github.com/user-attachments/assets/fe162005-ee2b-497d-8744-6262e4511d2d\n\n\n* Fixed Bug: The install button was enabled when all toggles were\ndisabled\nThere were too many booleans in the panel, which was confusing and led\nme to introduce more bugs while trying to fix this one, so I refactored\nthe code to understand it before fixing it.\nI also simplified the logic to display the modal. Now, it only shows\nwhen one of the engines' status is \"not_installed\"\n\n<img width=\"300\"\nsrc=\"https://github.com/user-attachments/assets/a2e8fbba-ac64-4c97-9ef0-ef6fe61e60cd\"\n/>\n\n\n\n\n\n\n\n### To Reproduce\n\n1. Create a user with security privileges and index privileges but no\ncluster privileges\n2. Go to the risk score page and enable the toggle\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or","sha":"b69b696e7fddf4bb26d038f1deaa6388051c428d"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/213344","number":213344,"state":"OPEN"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212405","number":212405,"mergeCommit":{"message":"[SecuritySolution] Fix Risk score Insufficient privileges warning missing cluster privileges (#212405)\n\n## Summary\n\n### \n* Fixes Bug: User with no cluster privileges should not be able to\nenable the risk score\nWhen users with no cluster privileges open the risk score page, they\ndon't see any errors and are able to click the install button.\n\nThis happened because we were only checking for index privileges in the\nUI, but for the enablement flow we also need to check cluster\nprivileges. I also introduced a new parameter to the missing privileges\nhook so pages that only need to check for `read` privileges can work as\nbefore.\n\n\nhttps://github.com/user-attachments/assets/fe162005-ee2b-497d-8744-6262e4511d2d\n\n\n* Fixed Bug: The install button was enabled when all toggles were\ndisabled\nThere were too many booleans in the panel, which was confusing and led\nme to introduce more bugs while trying to fix this one, so I refactored\nthe code to understand it before fixing it.\nI also simplified the logic to display the modal. Now, it only shows\nwhen one of the engines' status is \"not_installed\"\n\n<img width=\"300\"\nsrc=\"https://github.com/user-attachments/assets/a2e8fbba-ac64-4c97-9ef0-ef6fe61e60cd\"\n/>\n\n\n\n\n\n\n\n### To Reproduce\n\n1. Create a user with security privileges and index privileges but no\ncluster privileges\n2. Go to the risk score page and enable the toggle\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or","sha":"b69b696e7fddf4bb26d038f1deaa6388051c428d"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
- Loading branch information