mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security Solution][Hosts, Endpoint] Fix Host Details not showing endpoint related data for users without superuser role (#121090) (#121296)
* add new method to EndpointAppContextServices for getting a internal fleet services interface * Change Host Details search Strategy to use internal fleet services * un-skip host details FTR test Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>
This commit is contained in:
parent
46b07f178b
commit
d457f3ea9d
3 changed files with 12 additions and 4 deletions
|
@ -36,6 +36,7 @@ import {
|
|||
} from './errors';
|
||||
import {
|
||||
EndpointFleetServicesFactory,
|
||||
EndpointInternalFleetServicesInterface,
|
||||
EndpointScopedFleetServicesInterface,
|
||||
} from './services/endpoint_fleet_services';
|
||||
|
||||
|
@ -143,6 +144,14 @@ export class EndpointAppContextService {
|
|||
return this.fleetServicesFactory.asScoped(req);
|
||||
}
|
||||
|
||||
public getInternalFleetServices(): EndpointInternalFleetServicesInterface {
|
||||
if (this.fleetServicesFactory === null) {
|
||||
throw new EndpointAppContentServicesNotStartedError();
|
||||
}
|
||||
|
||||
return this.fleetServicesFactory.asInternalUser();
|
||||
}
|
||||
|
||||
/** @deprecated use `getScopedFleetServices()` instead */
|
||||
public getAgentService(): AgentService | undefined {
|
||||
return this.startDependencies?.agentService;
|
||||
|
|
|
@ -188,11 +188,11 @@ export const getHostEndpoint = async (
|
|||
return null;
|
||||
}
|
||||
|
||||
const { esClient, endpointContext, request } = deps;
|
||||
const { esClient, endpointContext } = deps;
|
||||
const logger = endpointContext.logFactory.get('metadata');
|
||||
|
||||
try {
|
||||
const fleetServices = endpointContext.service.getScopedFleetServices(request);
|
||||
const fleetServices = endpointContext.service.getInternalFleetServices();
|
||||
const endpointMetadataService = endpointContext.service.getEndpointMetadataService();
|
||||
|
||||
const endpointData = await endpointMetadataService
|
||||
|
|
|
@ -62,8 +62,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
await testSubjects.existOrFail('noIngestPermissions');
|
||||
});
|
||||
|
||||
// FIXME:PT skipped. need to fix security-team bug #1929
|
||||
it.skip('should display endpoint data on Host Details', async () => {
|
||||
it('should display endpoint data on Host Details', async () => {
|
||||
const endpoint = indexedData.hosts[0];
|
||||
await PageObjects.hosts.navigateToHostDetails(endpoint.host.name);
|
||||
const endpointSummary = await PageObjects.hosts.hostDetailsEndpointOverviewData();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue