-
Notifications
You must be signed in to change notification settings - Fork 82
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
Define permissions user for fleet-server needs #60
Comments
@aleksmaus Would be great if you could take this on. |
@scunningham If you have some cycles, would be great if you could also help with this one to define the minimal permissions we need. We should also decide if we need a built in role in Elasticsearch for this or not. |
Specifying the required perms is the easy part.
Note that the index permissions currently requested for the default api key are already too broad and should be narrowed to "create_doc", which limits the permission to read/only. The hard part is how to accomplish this. Ideally, we would assign an apikey per installed fleet server. This is problematic for upgrade in that if we need to add more permissions for a newer version, we would have to generate a new api key for the targeted upgraded fleet server(s). There's no way to add permissions to an existing apikey as far as I can tell. It would be easier to create a fleet-server-role which contains the superset of the permissions required for the current set of executing fleet servers. Unfortunately, the role would be bound to a corresponding user, and we would have to distribute username/password to each of the Fleet Servers. If any one of the Fleet Servers is popped, the password would need to be changed breaking all of the other servers in the field; not just the popped server. Thoughts @ruflin @aleksmaus @blakerouse? User/PW is easier to implement, but not ideal from a security standpoint. We could, as an alternative, require a new api key to be generated for each fleet server as part of the upgrade process. We should discuss had that would work in practice. How are upgrades going to roll out; is there a corresponding Kibana upgrade that must happen first? It seems this would be an issue whether we use apikey's or user/pw as in somebody in the system would need to upgrade the role associated with the fleet-server-role. |
|
However, we will need to test this. It is likely that the beats are expecting higher privileges. A fallback would have more privileges, but would be less secure:
This is not ideal as it allows arbitrary write across any of the above outputs in the system. We should try to avoid this. "create_index" should not be necessary as an ILM controlled data stream should already be in place as part of the package install. |
We probably need |
@nchaulet Agreed. Modified above. |
This is indeed good timing we were looking into limiting the permissions on the API key in elastic/kibana#89713
I've thought we had another permission than create_doc that was not allowing us to update mapping but I can't find it in the current documentation. |
To follow, after conversation on #es-core-features, two items:
<<
<< Dan Hermann 12:26 PM Sean Cunningham 12:27 PM Dan Hermann 12:30 PM Sean Cunningham 12:31 PM Dan Hermann 12:35 PM Sean Cunningham 12:36 PM I'll update the mappings above appropirately. |
Also, the "cluster:monitor" privilege is too broad. We should consider removing it and see what it breaks. For one thing, the license api requires it. Do we really need it? |
I was discussing with @scunningham over the "monitor" cluster privileges and the beats, IIRC it is used for one or two things:
The monitor permissions give a lot more information:
As far as I know, there is no way to limit to only retrieve the remote license. @urso @andresrc Would we consider removing the license check? |
Elasticsearch issue to track the addition of an append-only role: elastic/elasticsearch#68414 |
I'm also wondering if we could skip the license check as fleet-server will be only for future releases? |
@scunningham is "events" a typo in #60 (comment) I believe this should be traces? |
@ph The permissions above were snapshotted out of kibana when I wrote original fleet off of the 7.9 branch. The latest perms in Kibana are here Looks like events have been replaced with traces.
I will update above. There's also a bunch of suspect indices up there. Can anybody chime in as to why we have ".ds-" and ".logs-"? @nchaulet |
|
@scunningham The |
I spoke with @scunningham Currently, when the Endpoint package is installed, it creates the index template, but the data stream isn't created until the Endpoint actually sends the first document, so this permission was required. If we can create the data stream before the Endpoint sends the first document (i.e. the Endpoint no longer needs to be able to created the data stream, just send docs to it), then we should be OK to remove. |
Closing for Phase 2. Further follow up discussions needed. |
A username / password needs to be passed into the fleet-server to work. It needs to be defined what the permissions are that are required for this user.
For reference, the current permissions of the fleet-user can be found here: https://github.com/elastic/kibana/blob/master/x-pack/plugins/fleet/server/services/setup.ts#L140
The text was updated successfully, but these errors were encountered: