Grant .tasks access to kibana_system role#35573
Merged
jaymode merged 1 commit intoelastic:masterfrom Nov 15, 2018
Merged
Conversation
Kibana now uses the tasks API to manage automatic reindexing of the .kibana index during upgrades. The implementation of the tasks API requires that 1. the user executing the task can create & write to the ".tasks" index 2. the user checking on the status of the task can read (Get) the relevant document from the ".tasks" index
Collaborator
|
Pinging @elastic/es-security |
Contributor
Author
Member
|
I have tested and verified this on the Kibana side by updating the role with the equivalent: |
Contributor
|
LGTM |
s1monw
approved these changes
Nov 15, 2018
nik9000
approved these changes
Nov 15, 2018
Member
nik9000
left a comment
There was a problem hiding this comment.
This'll get the job done until we can fix tasks infrastructure not to need the permissions. Thanks!
jaymode
pushed a commit
that referenced
this pull request
Nov 15, 2018
Kibana now uses the tasks API to manage automatic reindexing of the .kibana index during upgrades. The implementation of the tasks API requires that 1. the user executing the task can create & write to the ".tasks" index 2. the user checking on the status of the task can read (Get) the relevant document from the ".tasks" index
jaymode
pushed a commit
that referenced
this pull request
Nov 15, 2018
Kibana now uses the tasks API to manage automatic reindexing of the .kibana index during upgrades. The implementation of the tasks API requires that 1. the user executing the task can create & write to the ".tasks" index 2. the user checking on the status of the task can read (Get) the relevant document from the ".tasks" index
Contributor
Author
|
Thanks @jaymode |
nik9000
added a commit
to nik9000/elasticsearch
that referenced
this pull request
Nov 16, 2018
Right now using the `GET /_tasks/<taskid>` API and causing a task to opt in to saving its result after being completed requires permissions on the `.tasks` index. When we built this we thought that that was fine, but we've since moved towards not leaking details like "persisting task results after the task is completed is done by saving them into an index named `.tasks`." A more modern way of doing this would be to save the tasks into the index "under the hood" and to have APIs to manage the saved tasks. This is the first step down that road: it drops the requirement to have permissions to interact with the `.tasks` index when fetching task statuses and when persisting statuses beyond the lifetime of the task. In particular, this moves the concept of the "origin" of an action into a more prominent place in the Elasticsearch server. The origin of an action is ignored by the server, but the security plugin uses the origin to make requests on behalf of a user in such a way that the user need not have permissions to perform these actions. It *can* be made to be fairly precise. More specifically, we can create an internal user just for the tasks API that just has permission to interact with the `.tasks` index. This change doesn't do that, instead, it uses the ubiquitus "xpack" user which has most permissions because it is simpler. Adding the tasks user is something I'd like to get to in a follow up change. Instead, the majority of this change is about moving the "origin" concept from the security portion of x-pack into the server. This should allow any code to use the origin. To keep the change managable I've also opted to deprecate rather than remove the "origin" helpers in the security code. Removing them is almost entirely mechanical and I'd like to that in a follow up as well. Relates to elastic#35573
|
Is this a fix for the "Kibana server is not ready yet" problem people had? Can the user and role that were created as a workaround be removed after upgrading to 6.5.1? |
Contributor
|
Yep, this resolves the failed saved object migration setup that left kibana in a broken state, as described in the release notes “known issues”. If you used the workaround of manually creating your own kibana system user, you can switch back to the built in user in 6.5.1. |
nik9000
added a commit
that referenced
this pull request
Nov 28, 2018
Right now using the `GET /_tasks/<taskid>` API and causing a task to opt in to saving its result after being completed requires permissions on the `.tasks` index. When we built this we thought that that was fine, but we've since moved towards not leaking details like "persisting task results after the task is completed is done by saving them into an index named `.tasks`." A more modern way of doing this would be to save the tasks into the index "under the hood" and to have APIs to manage the saved tasks. This is the first step down that road: it drops the requirement to have permissions to interact with the `.tasks` index when fetching task statuses and when persisting statuses beyond the lifetime of the task. In particular, this moves the concept of the "origin" of an action into a more prominent place in the Elasticsearch server. The origin of an action is ignored by the server, but the security plugin uses the origin to make requests on behalf of a user in such a way that the user need not have permissions to perform these actions. It *can* be made to be fairly precise. More specifically, we can create an internal user just for the tasks API that just has permission to interact with the `.tasks` index. This change doesn't do that, instead, it uses the ubiquitus "xpack" user which has most permissions because it is simpler. Adding the tasks user is something I'd like to get to in a follow up change. Instead, the majority of this change is about moving the "origin" concept from the security portion of x-pack into the server. This should allow any code to use the origin. To keep the change managable I've also opted to deprecate rather than remove the "origin" helpers in the security code. Removing them is almost entirely mechanical and I'd like to that in a follow up as well. Relates to #35573
nik9000
added a commit
that referenced
this pull request
Nov 28, 2018
Right now using the `GET /_tasks/<taskid>` API and causing a task to opt in to saving its result after being completed requires permissions on the `.tasks` index. When we built this we thought that that was fine, but we've since moved towards not leaking details like "persisting task results after the task is completed is done by saving them into an index named `.tasks`." A more modern way of doing this would be to save the tasks into the index "under the hood" and to have APIs to manage the saved tasks. This is the first step down that road: it drops the requirement to have permissions to interact with the `.tasks` index when fetching task statuses and when persisting statuses beyond the lifetime of the task. In particular, this moves the concept of the "origin" of an action into a more prominent place in the Elasticsearch server. The origin of an action is ignored by the server, but the security plugin uses the origin to make requests on behalf of a user in such a way that the user need not have permissions to perform these actions. It *can* be made to be fairly precise. More specifically, we can create an internal user just for the tasks API that just has permission to interact with the `.tasks` index. This change doesn't do that, instead, it uses the ubiquitus "xpack" user which has most permissions because it is simpler. Adding the tasks user is something I'd like to get to in a follow up change. Instead, the majority of this change is about moving the "origin" concept from the security portion of x-pack into the server. This should allow any code to use the origin. To keep the change managable I've also opted to deprecate rather than remove the "origin" helpers in the security code. Removing them is almost entirely mechanical and I'd like to that in a follow up as well. Relates to #35573
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kibana now uses the tasks API to manage automatic reindexing of the
.kibana index during upgrades.
The implementation of the tasks API requires that
relevant document from the ".tasks" index