forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Profiling] Remove Security checks (elastic#168341)
- Use Kibana internal user to fetch Profiling status. - Check if current user has superadmin role to set up Profiling. - Viewer users: disable set up button when Profiling is not yet initialised. - Remove Profiling role creation and check. <img width="1187" alt="Screenshot 2023-10-06 at 10 50 44" src="https://github.com/elastic/kibana/assets/55978943/468dd22e-e9db-4691-86b3-acb2428d4ad8"> <img width="1079" alt="Screenshot 2023-10-06 at 10 51 15" src="https://github.com/elastic/kibana/assets/55978943/939ac662-5ccb-4210-a582-7ace77b6cf29"> --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
dba5ab7
commit 1d54963
Showing
21 changed files
with
153 additions
and
178 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
"optionalPlugins": [ | ||
"spaces", | ||
"usageCollection", | ||
"security", | ||
"cloud", | ||
"fleet" | ||
], | ||
|
This file contains 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
This file contains 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
39 changes: 39 additions & 0 deletions
39
x-pack/plugins/profiling/server/lib/setup/get_has_setup_privileges.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { KibanaRequest } from '@kbn/core/server'; | ||
import { INTEGRATIONS_PLUGIN_ID, PLUGIN_ID as FLEET_PLUGIN_ID } from '@kbn/fleet-plugin/common'; | ||
import { ProfilingPluginStartDeps } from '../../types'; | ||
|
||
export async function getHasSetupPrivileges({ | ||
securityPluginStart, | ||
request, | ||
}: { | ||
securityPluginStart: NonNullable<ProfilingPluginStartDeps['security']>; | ||
request: KibanaRequest; | ||
}) { | ||
// If we have a license which doesn't enable security, or we're a legacy user we shouldn't disable any ui capabilities | ||
if (!securityPluginStart.authz.mode.useRbacForRequest(request)) { | ||
return true; | ||
} | ||
|
||
const { hasAllRequested } = await securityPluginStart.authz | ||
.checkPrivilegesWithRequest(request) | ||
.globally({ | ||
elasticsearch: { | ||
cluster: ['manage', 'monitor'], | ||
index: { | ||
'profiling-*': ['read'], | ||
}, | ||
}, | ||
kibana: [ | ||
securityPluginStart.authz.actions.api.get(`${FLEET_PLUGIN_ID}-all`), | ||
securityPluginStart.authz.actions.api.get(`${INTEGRATIONS_PLUGIN_ID}-all`), | ||
], | ||
}); | ||
return hasAllRequested; | ||
} |
29 changes: 0 additions & 29 deletions
29
x-pack/plugins/profiling/server/lib/setup/security_role.ts
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.