-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 Solutions] Fixes the permissions to require cluster.manage for upgrades of solutions #89947
[Security Solutions] Fixes the permissions to require cluster.manage for upgrades of solutions #89947
Conversation
… index and in order to update an index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Code check now matches permissions outlined in docs. If you have a chance to add a test that would be greatly appreciated! @dhurley14 has made some helpers (#81866) so should be pretty straight forward. Thanks @FrankHassanabad! 💎 🙌 🚀
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
… index and in order to update an index (elastic#89947) ## Summary Fixes error toaster on signals upgrades as well as creation of new signals if you have a user without a cluster manage privilege. Simplest way to manually test both situations of a user on creating a new signal as well as upgrade is to first create a new role like so in dev tools: ```ts PUT _security/role/reduced_permissions { "indices":[ { "names":[ ".siem-signals-*", ".lists-*", ".items-*" ], "privileges":[ "all" ], "field_security":{ "grant":[ "*" ] }, "allow_restricted_indices":false } ], "applications":[ { "application":"kibana-.kibana", "privileges":[ "space_all" ], "resources":[ "space:default" ] } ] } ``` You might have to change this line above to match what your `kibana.index` is set to if it is set: ```ts "application" : "kibana-.kibana-hassanabad8", ``` Double check things in Stack Management to ensure you have access to at least default space: <img width="1304" alt="Screen Shot 2021-02-01 at 5 45 54 PM" src="https://user-images.githubusercontent.com/1151048/106536383-906f3f00-64b5-11eb-97d3-060fa6f6206e.png"> Next add a user which has this role of `reduced_permissions` to login as that user. Next for testing that this causes an error toaster when there is no signals index is to either manually delete your signals index or change your `kibana.dev.yml` so that it thinks you have a new index: ```ts xpack.securitySolution.signalsIndex: .siem-signals-some-new-index-name ``` Start up Kibana, login with the new user and visit any page and notice you get an error toaster like below: <img width="808" alt="Screen Shot 2021-02-01 at 5 04 17 PM" src="https://user-images.githubusercontent.com/1151048/106535815-4afe4200-64b4-11eb-89b3-947b0e4ff7d5.png"> And also notice that you are blocked from viewing signals at this point: <img width="1195" alt="Screen Shot 2021-02-01 at 5 04 43 PM" src="https://user-images.githubusercontent.com/1151048/106535835-56516d80-64b4-11eb-883c-2745b68843cf.png"> For upgrading signals manually, you can change the version number from dev tools or increment the number directly within this file and restart Kibana: https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts#L10 When you visit the detection page you will see the same error toaster and also be blocked. With this PR you will no longer be blocked. ### Checklist Delete any items that are not applicable to this PR. - [ ] [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
… index and in order to update an index (elastic#89947) ## Summary Fixes error toaster on signals upgrades as well as creation of new signals if you have a user without a cluster manage privilege. Simplest way to manually test both situations of a user on creating a new signal as well as upgrade is to first create a new role like so in dev tools: ```ts PUT _security/role/reduced_permissions { "indices":[ { "names":[ ".siem-signals-*", ".lists-*", ".items-*" ], "privileges":[ "all" ], "field_security":{ "grant":[ "*" ] }, "allow_restricted_indices":false } ], "applications":[ { "application":"kibana-.kibana", "privileges":[ "space_all" ], "resources":[ "space:default" ] } ] } ``` You might have to change this line above to match what your `kibana.index` is set to if it is set: ```ts "application" : "kibana-.kibana-hassanabad8", ``` Double check things in Stack Management to ensure you have access to at least default space: <img width="1304" alt="Screen Shot 2021-02-01 at 5 45 54 PM" src="https://user-images.githubusercontent.com/1151048/106536383-906f3f00-64b5-11eb-97d3-060fa6f6206e.png"> Next add a user which has this role of `reduced_permissions` to login as that user. Next for testing that this causes an error toaster when there is no signals index is to either manually delete your signals index or change your `kibana.dev.yml` so that it thinks you have a new index: ```ts xpack.securitySolution.signalsIndex: .siem-signals-some-new-index-name ``` Start up Kibana, login with the new user and visit any page and notice you get an error toaster like below: <img width="808" alt="Screen Shot 2021-02-01 at 5 04 17 PM" src="https://user-images.githubusercontent.com/1151048/106535815-4afe4200-64b4-11eb-89b3-947b0e4ff7d5.png"> And also notice that you are blocked from viewing signals at this point: <img width="1195" alt="Screen Shot 2021-02-01 at 5 04 43 PM" src="https://user-images.githubusercontent.com/1151048/106535835-56516d80-64b4-11eb-883c-2745b68843cf.png"> For upgrading signals manually, you can change the version number from dev tools or increment the number directly within this file and restart Kibana: https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts#L10 When you visit the detection page you will see the same error toaster and also be blocked. With this PR you will no longer be blocked. ### Checklist Delete any items that are not applicable to this PR. - [ ] [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
… index and in order to update an index (#89947) (#89968) ## Summary Fixes error toaster on signals upgrades as well as creation of new signals if you have a user without a cluster manage privilege. Simplest way to manually test both situations of a user on creating a new signal as well as upgrade is to first create a new role like so in dev tools: ```ts PUT _security/role/reduced_permissions { "indices":[ { "names":[ ".siem-signals-*", ".lists-*", ".items-*" ], "privileges":[ "all" ], "field_security":{ "grant":[ "*" ] }, "allow_restricted_indices":false } ], "applications":[ { "application":"kibana-.kibana", "privileges":[ "space_all" ], "resources":[ "space:default" ] } ] } ``` You might have to change this line above to match what your `kibana.index` is set to if it is set: ```ts "application" : "kibana-.kibana-hassanabad8", ``` Double check things in Stack Management to ensure you have access to at least default space: <img width="1304" alt="Screen Shot 2021-02-01 at 5 45 54 PM" src="https://user-images.githubusercontent.com/1151048/106536383-906f3f00-64b5-11eb-97d3-060fa6f6206e.png"> Next add a user which has this role of `reduced_permissions` to login as that user. Next for testing that this causes an error toaster when there is no signals index is to either manually delete your signals index or change your `kibana.dev.yml` so that it thinks you have a new index: ```ts xpack.securitySolution.signalsIndex: .siem-signals-some-new-index-name ``` Start up Kibana, login with the new user and visit any page and notice you get an error toaster like below: <img width="808" alt="Screen Shot 2021-02-01 at 5 04 17 PM" src="https://user-images.githubusercontent.com/1151048/106535815-4afe4200-64b4-11eb-89b3-947b0e4ff7d5.png"> And also notice that you are blocked from viewing signals at this point: <img width="1195" alt="Screen Shot 2021-02-01 at 5 04 43 PM" src="https://user-images.githubusercontent.com/1151048/106535835-56516d80-64b4-11eb-883c-2745b68843cf.png"> For upgrading signals manually, you can change the version number from dev tools or increment the number directly within this file and restart Kibana: https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts#L10 When you visit the detection page you will see the same error toaster and also be blocked. With this PR you will no longer be blocked. ### Checklist Delete any items that are not applicable to this PR. - [ ] [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
… index and in order to update an index (#89947) (#89967) ## Summary Fixes error toaster on signals upgrades as well as creation of new signals if you have a user without a cluster manage privilege. Simplest way to manually test both situations of a user on creating a new signal as well as upgrade is to first create a new role like so in dev tools: ```ts PUT _security/role/reduced_permissions { "indices":[ { "names":[ ".siem-signals-*", ".lists-*", ".items-*" ], "privileges":[ "all" ], "field_security":{ "grant":[ "*" ] }, "allow_restricted_indices":false } ], "applications":[ { "application":"kibana-.kibana", "privileges":[ "space_all" ], "resources":[ "space:default" ] } ] } ``` You might have to change this line above to match what your `kibana.index` is set to if it is set: ```ts "application" : "kibana-.kibana-hassanabad8", ``` Double check things in Stack Management to ensure you have access to at least default space: <img width="1304" alt="Screen Shot 2021-02-01 at 5 45 54 PM" src="https://user-images.githubusercontent.com/1151048/106536383-906f3f00-64b5-11eb-97d3-060fa6f6206e.png"> Next add a user which has this role of `reduced_permissions` to login as that user. Next for testing that this causes an error toaster when there is no signals index is to either manually delete your signals index or change your `kibana.dev.yml` so that it thinks you have a new index: ```ts xpack.securitySolution.signalsIndex: .siem-signals-some-new-index-name ``` Start up Kibana, login with the new user and visit any page and notice you get an error toaster like below: <img width="808" alt="Screen Shot 2021-02-01 at 5 04 17 PM" src="https://user-images.githubusercontent.com/1151048/106535815-4afe4200-64b4-11eb-89b3-947b0e4ff7d5.png"> And also notice that you are blocked from viewing signals at this point: <img width="1195" alt="Screen Shot 2021-02-01 at 5 04 43 PM" src="https://user-images.githubusercontent.com/1151048/106535835-56516d80-64b4-11eb-883c-2745b68843cf.png"> For upgrading signals manually, you can change the version number from dev tools or increment the number directly within this file and restart Kibana: https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts#L10 When you visit the detection page you will see the same error toaster and also be blocked. With this PR you will no longer be blocked. ### Checklist Delete any items that are not applicable to this PR. - [ ] [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
…om/kibana into pr/89570 * 'sessions/save-all-sessions' of https://github.com/lizozom/kibana: (44 commits) [ML] Functional tests - skip DFA clone tests [Uptime] Fix synthetics detail step count (elastic#89940) Fixes the permissions to require cluster.manage in order to create an index and in order to update an index (elastic#89947) [Security Solution] [Detections] adds log info level for logging in cloud (elastic#89941) [Time to Visualize] Dashboard By Value Testing Lens (elastic#89581) [Uptime] Expand synthetic journey step thumbnail on hover (elastic#89179) TS project refs: Migrates snapshot_restore to a TS Project (elastic#89653) docs: APM 7.11 updates (elastic#89789) move skip to higher level (elastic#86952) Revert "Migrations v2: don't auto-create indices + FTR/esArchiver support (elastic#85778)" Revert "Revert "Enable v2 so migrations, disable in FTR tests (elastic#89297)"" Revert "Enable v2 so migrations, disable in FTR tests (elastic#89297)" [data.search] Allow search response to follow new hits format (elastic#88115) [Maps] Change 'create multi-layer map' title to be use-case focused (elastic#89520) skip flaky suite (elastic#86952) [Security Solution] Remove focustrap (elastic#89905) [Workplace Search] Add remaining i18n support for the Content Sources tree (elastic#89910) [esArchiver] log when migrations complete and we're done loading data (elastic#89938) Add --ssl flag to make resolver generator use ssl with kbn and elasticsearch clients (elastic#89873) TS project refs: Migrates grokdebugger (elastic#89652) ...
…89947 (#89973) ## Summary Adds e2e and unit tests for PR: #89947 * Adds e2e tests for create_index * Adds e2e tests for get_privileges * Adds unit test for use_privilege_user * Adds exhaustive switch for the roles in the e2e tests * Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports * Fixes some of the types that were not matched up with the recent privilege endpoint ### Checklist - [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
…lastic#89947 (elastic#89973) ## Summary Adds e2e and unit tests for PR: elastic#89947 * Adds e2e tests for create_index * Adds e2e tests for get_privileges * Adds unit test for use_privilege_user * Adds exhaustive switch for the roles in the e2e tests * Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports * Fixes some of the types that were not matched up with the recent privilege endpoint ### Checklist - [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
…lastic#89947 (elastic#89973) ## Summary Adds e2e and unit tests for PR: elastic#89947 * Adds e2e tests for create_index * Adds e2e tests for get_privileges * Adds unit test for use_privilege_user * Adds exhaustive switch for the roles in the e2e tests * Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports * Fixes some of the types that were not matched up with the recent privilege endpoint ### Checklist - [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
…for PR #89947 (#89973) (#90091) * [Security Solutions][Detection Engine] Adds e2e and unit tests for PR #89947 (#89973) ## Summary Adds e2e and unit tests for PR: #89947 * Adds e2e tests for create_index * Adds e2e tests for get_privileges * Adds unit test for use_privilege_user * Adds exhaustive switch for the roles in the e2e tests * Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports * Fixes some of the types that were not matched up with the recent privilege endpoint ### Checklist - [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 * Fixes the backport for test to work correctly as the messages are different * Fixes one permission change issue between versions
… for PR #89947 (#89973) (#90092) * [Security Solutions][Detection Engine] Adds e2e and unit tests for PR #89947 (#89973) ## Summary Adds e2e and unit tests for PR: #89947 * Adds e2e tests for create_index * Adds e2e tests for get_privileges * Adds unit test for use_privilege_user * Adds exhaustive switch for the roles in the e2e tests * Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports * Fixes some of the types that were not matched up with the recent privilege endpoint ### Checklist - [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 * Updated to work with the right messages * Fixes permissions that are slightly different
Summary
Fixes error toaster on signals upgrades as well as creation of new signals if you have a user without a cluster manage privilege.
Simplest way to manually test both situations of a user on creating a new signal as well as upgrade is to first create a new role like so in dev tools:
You might have to change this line above to match what your
kibana.index
is set to if it is set:Double check things in Stack Management to ensure you have access to at least default space:
Next add a user which has this role of
reduced_permissions
to login as that user. Next for testing that this causes an error toaster when there is no signals index is to either manually delete your signals index or change yourkibana.dev.yml
so that it thinks you have a new index:Start up Kibana, login with the new user and visit any page and notice you get an error toaster like below:
And also notice that you are blocked from viewing signals at this point:
For upgrading signals manually, you can change the version number from dev tools or increment the number directly within this file and restart Kibana:
https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts#L10
When you visit the detection page you will see the same error toaster and also be blocked. With this PR you will no longer be blocked.
Checklist
Delete any items that are not applicable to this PR.