From cd269b3920ea8f2f84ec4a87036a7b54f102b4b2 Mon Sep 17 00:00:00 2001 From: Madison Caldwell Date: Thu, 9 Jul 2020 00:56:46 -0400 Subject: [PATCH 1/5] Revert "Reverting ingestManager back to being required for now" This reverts commit 899a673f240b5f77e100cf3a286745140d5b415e. --- x-pack/plugins/security_solution/kibana.json | 2 +- .../endpoint_app_context_services.test.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/security_solution/kibana.json b/x-pack/plugins/security_solution/kibana.json index f6f2d5171312c..745df54c62158 100644 --- a/x-pack/plugins/security_solution/kibana.json +++ b/x-pack/plugins/security_solution/kibana.json @@ -11,7 +11,6 @@ "embeddable", "features", "home", - "ingestManager", "taskManager", "inspector", "licensing", @@ -21,6 +20,7 @@ ], "optionalPlugins": [ "encryptedSavedObjects", + "ingestManager", "ml", "newsfeed", "security", diff --git a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.test.ts b/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.test.ts index 7642db23812e1..7b435f71fe4a8 100644 --- a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.test.ts @@ -8,14 +8,14 @@ import { httpServerMock } from '../../../../../src/core/server/mocks'; import { EndpointAppContextService } from './endpoint_app_context_services'; describe('test endpoint app context services', () => { - // it('should return undefined on getAgentService if dependencies are not enabled', async () => { - // const endpointAppContextService = new EndpointAppContextService(); - // expect(endpointAppContextService.getAgentService()).toEqual(undefined); - // }); - // it('should return undefined on getManifestManager if dependencies are not enabled', async () => { - // const endpointAppContextService = new EndpointAppContextService(); - // expect(endpointAppContextService.getManifestManager()).toEqual(undefined); - // }); + it('should return undefined on getAgentService if dependencies are not enabled', async () => { + const endpointAppContextService = new EndpointAppContextService(); + expect(endpointAppContextService.getAgentService()).toEqual(undefined); + }); + it('should return undefined on getManifestManager if dependencies are not enabled', async () => { + const endpointAppContextService = new EndpointAppContextService(); + expect(endpointAppContextService.getManifestManager()).toEqual(undefined); + }); it('should throw error on getScopedSavedObjectsClient if start is not called', async () => { const endpointAppContextService = new EndpointAppContextService(); expect(() => From dcf65a40baa4e23778c13c7864085f9b831633de Mon Sep 17 00:00:00 2001 From: Madison Caldwell Date: Thu, 9 Jul 2020 00:59:13 -0400 Subject: [PATCH 2/5] Disable package config component when ingestManager is disabled --- x-pack/plugins/security_solution/public/plugin.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/security_solution/public/plugin.tsx b/x-pack/plugins/security_solution/public/plugin.tsx index 6096a9b0e0bb8..7bb827f18d4cc 100644 --- a/x-pack/plugins/security_solution/public/plugin.tsx +++ b/x-pack/plugins/security_solution/public/plugin.tsx @@ -323,10 +323,12 @@ export class Plugin implements IPlugin Date: Thu, 9 Jul 2020 08:35:30 -0400 Subject: [PATCH 3/5] remove management plugin --- .../public/management/index.ts | 28 ++++---- .../security_solution/public/plugin.tsx | 68 +++++++++---------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/index.ts b/x-pack/plugins/security_solution/public/management/index.ts index 902ed085bd369..6b3c33b0535c5 100644 --- a/x-pack/plugins/security_solution/public/management/index.ts +++ b/x-pack/plugins/security_solution/public/management/index.ts @@ -38,20 +38,20 @@ export class Management { plugins: StartPlugins ): SecuritySubPluginWithStore<'management', ManagementState> { return { - SubPluginRoutes: ManagementRoutes, - store: { - initialState: { - management: undefined, - }, - /** - * Cast the ImmutableReducer to a regular reducer for compatibility with - * the subplugin architecture (which expects plain redux reducers.) - */ - reducer: { - management: managementReducer, - } as ManagementPluginReducer, - middleware: managementMiddlewareFactory(core, plugins), - }, + // SubPluginRoutes: ManagementRoutes, + // store: { + // initialState: { + // management: undefined, + // }, + // /** + // * Cast the ImmutableReducer to a regular reducer for compatibility with + // * the subplugin architecture (which expects plain redux reducers.) + // */ + // reducer: { + // management: managementReducer, + // } as ManagementPluginReducer, + // middleware: managementMiddlewareFactory(core, plugins), + // }, }; } } diff --git a/x-pack/plugins/security_solution/public/plugin.tsx b/x-pack/plugins/security_solution/public/plugin.tsx index 7bb827f18d4cc..89db830612fb8 100644 --- a/x-pack/plugins/security_solution/public/plugin.tsx +++ b/x-pack/plugins/security_solution/public/plugin.tsx @@ -279,32 +279,32 @@ export class Plugin implements IPlugin { - const [ - { coreStart, startPlugins, store, services }, - { renderApp, composeLibs }, - { managementSubPlugin }, - ] = await Promise.all([ - mountSecurityFactory(), - this.downloadAssets(), - this.downloadSubPlugins(), - ]); - return renderApp({ - ...composeLibs(coreStart), - ...params, - services, - store, - SubPluginRoutes: managementSubPlugin.start(coreStart, startPlugins).SubPluginRoutes, - }); - }, - }); + // core.application.register({ + // id: `${APP_ID}:${SecurityPageName.management}`, + // title: ADMINISTRATION, + // order: 9002, + // euiIconType: APP_ICON, + // category: DEFAULT_APP_CATEGORIES.security, + // appRoute: APP_MANAGEMENT_PATH, + // mount: async (params: AppMountParameters) => { + // const [ + // { coreStart, startPlugins, store, services }, + // { renderApp, composeLibs }, + // { managementSubPlugin }, + // ] = await Promise.all([ + // mountSecurityFactory(), + // this.downloadAssets(), + // this.downloadSubPlugins(), + // ]); + // return renderApp({ + // ...composeLibs(coreStart), + // ...params, + // services, + // store, + // SubPluginRoutes: managementSubPlugin.start(coreStart, startPlugins).SubPluginRoutes, + // }); + // }, + // }); core.application.register({ id: 'siem', @@ -357,7 +357,7 @@ export class Plugin implements IPlugin Date: Fri, 10 Jul 2020 11:14:09 -0400 Subject: [PATCH 4/5] correct plugin --- x-pack/plugins/security_solution/kibana.json | 3 +- .../public/management/index.ts | 28 ++++---- .../security_solution/public/plugin.tsx | 68 +++++++++---------- 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/x-pack/plugins/security_solution/kibana.json b/x-pack/plugins/security_solution/kibana.json index 8d86ab1b9eb8f..29d0ab58e8b55 100644 --- a/x-pack/plugins/security_solution/kibana.json +++ b/x-pack/plugins/security_solution/kibana.json @@ -33,6 +33,7 @@ "requiredBundles": [ "kibanaUtils", "esUiShared", - "kibanaReact" + "kibanaReact", + "ingestManager" ] } diff --git a/x-pack/plugins/security_solution/public/management/index.ts b/x-pack/plugins/security_solution/public/management/index.ts index 6b3c33b0535c5..902ed085bd369 100644 --- a/x-pack/plugins/security_solution/public/management/index.ts +++ b/x-pack/plugins/security_solution/public/management/index.ts @@ -38,20 +38,20 @@ export class Management { plugins: StartPlugins ): SecuritySubPluginWithStore<'management', ManagementState> { return { - // SubPluginRoutes: ManagementRoutes, - // store: { - // initialState: { - // management: undefined, - // }, - // /** - // * Cast the ImmutableReducer to a regular reducer for compatibility with - // * the subplugin architecture (which expects plain redux reducers.) - // */ - // reducer: { - // management: managementReducer, - // } as ManagementPluginReducer, - // middleware: managementMiddlewareFactory(core, plugins), - // }, + SubPluginRoutes: ManagementRoutes, + store: { + initialState: { + management: undefined, + }, + /** + * Cast the ImmutableReducer to a regular reducer for compatibility with + * the subplugin architecture (which expects plain redux reducers.) + */ + reducer: { + management: managementReducer, + } as ManagementPluginReducer, + middleware: managementMiddlewareFactory(core, plugins), + }, }; } } diff --git a/x-pack/plugins/security_solution/public/plugin.tsx b/x-pack/plugins/security_solution/public/plugin.tsx index 5bb07fd6b36ed..62328bd767748 100644 --- a/x-pack/plugins/security_solution/public/plugin.tsx +++ b/x-pack/plugins/security_solution/public/plugin.tsx @@ -280,32 +280,32 @@ export class Plugin implements IPlugin { - // const [ - // { coreStart, startPlugins, store, services }, - // { renderApp, composeLibs }, - // { managementSubPlugin }, - // ] = await Promise.all([ - // mountSecurityFactory(), - // this.downloadAssets(), - // this.downloadSubPlugins(), - // ]); - // return renderApp({ - // ...composeLibs(coreStart), - // ...params, - // services, - // store, - // SubPluginRoutes: managementSubPlugin.start(coreStart, startPlugins).SubPluginRoutes, - // }); - // }, - // }); + core.application.register({ + id: `${APP_ID}:${SecurityPageName.management}`, + title: ADMINISTRATION, + order: 9002, + euiIconType: APP_ICON, + category: DEFAULT_APP_CATEGORIES.security, + appRoute: APP_MANAGEMENT_PATH, + mount: async (params: AppMountParameters) => { + const [ + { coreStart, startPlugins, store, services }, + { renderApp, composeLibs }, + { managementSubPlugin }, + ] = await Promise.all([ + mountSecurityFactory(), + this.downloadAssets(), + this.downloadSubPlugins(), + ]); + return renderApp({ + ...composeLibs(coreStart), + ...params, + services, + store, + SubPluginRoutes: managementSubPlugin.start(coreStart, startPlugins).SubPluginRoutes, + }); + }, + }); core.application.register({ id: 'siem', @@ -358,7 +358,7 @@ export class Plugin implements IPlugin Date: Fri, 10 Jul 2020 16:27:26 -0400 Subject: [PATCH 5/5] make ingest type optional --- x-pack/plugins/security_solution/public/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/types.ts b/x-pack/plugins/security_solution/public/types.ts index e212289458ed1..f9c773a2fa1ab 100644 --- a/x-pack/plugins/security_solution/public/types.ts +++ b/x-pack/plugins/security_solution/public/types.ts @@ -32,7 +32,7 @@ export interface StartPlugins { data: DataPublicPluginStart; embeddable: EmbeddableStart; inspector: InspectorStart; - ingestManager: IngestManagerStart; + ingestManager?: IngestManagerStart; newsfeed?: NewsfeedStart; triggers_actions_ui: TriggersActionsStart; uiActions: UiActionsStart;