-
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
Should we restrict the alerting and task manager health APIs further? #102100
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
Adding to 7.15 candidates to explore if we need to do this in a major. |
We have decided to treat how open these health endpoints are as a bug. This means we no longer consider this a breaking change, but rather a fix intended on correcting a broken implementation. |
Whoever picks this up, please talk to @elastic/kibana-security to figure out how best to approach this in terms of who should have access. :) |
As we have decided to consider this a bug we will aim to get this done asap, including post FF. |
Still not clear to me HOW to determine a user is authorized to get this info. The easiest thing I think we could do is try to read the task manager index with the es client using the user credentials. So if you can do a search against the index, then you are authorized to use this API. So we'd basically be requiring read access to the task manager index, which would work for super user, and anyone given broader index privileges than usually provided (for example, for diagnostic purposes). |
We can limit the task manager health API to users with kibana/x-pack/plugins/features/server/routes/index.ts Lines 21 to 28 in 4584a8b
kibana/x-pack/plugins/security/server/authorization/privileges/privileges.ts Lines 103 to 115 in e185afe
This would be more restrictive than @pmuellr's suggestion of testing for read access to the task manager index. Do we have any concerns that this will make SDHs more difficult in the future? We currently ask for the task manager health output pretty frequently when trying to diagnose issues. Is it too much of a barrier to limit this API to superusers? |
I'm not sure there's much of a difference. You'd need to add a priv to read the index anyway. Feels more natural to go with the flow and make use of this |
@kobelb, @ymao1 and I are looking for your 👍. We are aiming to restrict the task manager health API to superuser only. Unfortunately, we do not have the data to understand what impacts this change will cause. Especially from a supportability perspective when it comes to users pulling data from those APIs (SDHs). We are thinking of gathering the necessary data (telemetry) to understand the impacts before restricting the APIs. Would this path make sense as compared to making the restriction without knowing the implications? |
Gathering the necessary data using telemetry before putting this restriction in place makes sense to me. What data were you going to collect using telemetry? All of the privileges that the user has that is accessing the task manager health API or were you going to look for specific privileges? |
@kobelb We would be looking for a specific privilege. The plan would be to capture if the user has |
Thanks, @mikecote. Adding telemetry to determine whether it's safe to restrict access to the task-manager health API to users with the Long-term, I don't think that we should require such a high-level of privileges to be able to consume this HTTP API. The |
So I am able to add Instead, I would like to use @legrego Is there another way to achieve what I'm trying to do? |
You don't have to use the Security plugin's abstraction for the ES For example, if you create a "test" user and assign it the "kibana_admin" role, that gives it the Global Admin privilege. Example of checking this in Dev Tools for the "manage spaces" privilege (which only Global Admins hold):
Response:
Here's where the Security plugin uses this API:
So you could call it like so: // plugin constructor
const kibanaVersion = initializerContext.env.packageInfo.version;
...
// plugin setup
const kibanaIndexName = core.savedObjects.getKibanaIndex();
...
const { body } = await clusterClient.asScoped(request).asCurrentUser.security.hasPrivileges({
body: {
application: [
{
application: `kibana-${kibanaIndexName}`,
resources: ['*'],
privileges: [`api:${kibanaVersion}:taskManager`]
},
],
},
}); The only other way that I can think of to accomplish this would be to flip this dependency around -- expose an extension from Task Manager that the Security plugin could register a handler for. But that seems worse, IMO. |
Currently, both health APIs are available to any Kibana user.
The text was updated successfully, but these errors were encountered: