diff --git a/x-pack/plugins/entity_manager/server/lib/auth/api_key/api_key.ts b/x-pack/plugins/entity_manager/server/lib/auth/api_key/api_key.ts index 2535bcc4d64f7..8dc499cb7fb43 100644 --- a/x-pack/plugins/entity_manager/server/lib/auth/api_key/api_key.ts +++ b/x-pack/plugins/entity_manager/server/lib/auth/api_key/api_key.ts @@ -9,6 +9,7 @@ import { KibanaRequest } from '@kbn/core-http-server'; import { getFakeKibanaRequest } from '@kbn/security-plugin/server/authentication/api_keys/fake_kibana_request'; import { EntityManagerServerSetup } from '../../../types'; import { canManageEntityDefinition, entityDefinitionRuntimePrivileges } from '../privileges'; +import { BUILT_IN_ALLOWED_INDICES } from '../../entities/built_in/constants'; export interface EntityDiscoveryAPIKey { id: string; @@ -45,7 +46,7 @@ export const checkIfEntityDiscoveryAPIKeyIsValid = async ( server.logger.debug('validating API key has runtime privileges for entity discovery'); - return canManageEntityDefinition(esClient); + return canManageEntityDefinition(esClient, BUILT_IN_ALLOWED_INDICES); }; export const generateEntityDiscoveryAPIKey = async (