From bc20a9eaa87a62097585d15be9d536031ada7467 Mon Sep 17 00:00:00 2001 From: Frank Hassanabad Date: Tue, 6 Jul 2021 16:07:58 -0600 Subject: [PATCH] Removes older configuration that is no longer in use, removes un-used configuration keys (#104540) ## Summary * Removes `kibana.yml` (configuration) keys that are not in use * Removes an older configuration schema file from before the merge of endpoint with security solutions Unused schema file was: ``` server/endpoint/config.ts ``` Unused keys removed: ``` xpack.securitySolution.alertResultListDefaultDateRange xpack.securitySolution.validateArtifactDownloads ``` ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --- .../resources/base/bin/kibana-docker | 2 - .../security_solution/server/config.ts | 9 ---- .../server/endpoint/config.test.ts | 17 -------- .../server/endpoint/config.ts | 42 ------------------- .../routes/__mocks__/index.ts | 5 --- 5 files changed, 75 deletions(-) delete mode 100644 x-pack/plugins/security_solution/server/endpoint/config.test.ts delete mode 100644 x-pack/plugins/security_solution/server/endpoint/config.ts diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 643080fda381..39a7665f1ce5 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -381,7 +381,6 @@ kibana_vars=( xpack.security.session.lifespan xpack.security.sessionTimeout xpack.securitySolution.alertMergeStrategy - xpack.securitySolution.alertResultListDefaultDateRange xpack.securitySolution.endpointResultListDefaultFirstPageIndex xpack.securitySolution.endpointResultListDefaultPageSize xpack.securitySolution.maxRuleImportExportSize @@ -389,7 +388,6 @@ kibana_vars=( xpack.securitySolution.maxTimelineImportExportSize xpack.securitySolution.maxTimelineImportPayloadBytes xpack.securitySolution.packagerTaskInterval - xpack.securitySolution.validateArtifactDownloads xpack.spaces.enabled xpack.spaces.maxSpaces xpack.task_manager.enabled diff --git a/x-pack/plugins/security_solution/server/config.ts b/x-pack/plugins/security_solution/server/config.ts index d19c36ad21ed..8018a2f050fc 100644 --- a/x-pack/plugins/security_solution/server/config.ts +++ b/x-pack/plugins/security_solution/server/config.ts @@ -60,19 +60,10 @@ export const configSchema = schema.object({ endpointResultListDefaultFirstPageIndex: schema.number({ defaultValue: 0 }), endpointResultListDefaultPageSize: schema.number({ defaultValue: 10 }), - /** - * Alert Endpoint Configuration - */ - alertResultListDefaultDateRange: schema.object({ - from: schema.string({ defaultValue: 'now-15m' }), - to: schema.string({ defaultValue: 'now' }), - }), - /** * Artifacts Configuration */ packagerTaskInterval: schema.string({ defaultValue: '60s' }), - validateArtifactDownloads: schema.boolean({ defaultValue: true }), }); export const createConfig = (context: PluginInitializerContext) => diff --git a/x-pack/plugins/security_solution/server/endpoint/config.test.ts b/x-pack/plugins/security_solution/server/endpoint/config.test.ts deleted file mode 100644 index 08e4e2cd3313..000000000000 --- a/x-pack/plugins/security_solution/server/endpoint/config.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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 { EndpointConfigSchema, EndpointConfigType } from './config'; - -describe('test config schema', () => { - it('test config defaults', () => { - const config: EndpointConfigType = EndpointConfigSchema.validate({}); - expect(config.enabled).toEqual(false); - expect(config.endpointResultListDefaultPageSize).toEqual(10); - expect(config.endpointResultListDefaultFirstPageIndex).toEqual(0); - }); -}); diff --git a/x-pack/plugins/security_solution/server/endpoint/config.ts b/x-pack/plugins/security_solution/server/endpoint/config.ts deleted file mode 100644 index 43f713a9f686..000000000000 --- a/x-pack/plugins/security_solution/server/endpoint/config.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 { schema, TypeOf } from '@kbn/config-schema'; -import { Observable } from 'rxjs'; -import { PluginInitializerContext } from 'kibana/server'; - -export type EndpointConfigType = ReturnType extends Observable - ? P - : ReturnType; - -export const EndpointConfigSchema = schema.object({ - enabled: schema.boolean({ defaultValue: false }), - - /** - * Host Configuration - */ - endpointResultListDefaultFirstPageIndex: schema.number({ defaultValue: 0 }), - endpointResultListDefaultPageSize: schema.number({ defaultValue: 10 }), - - /** - * Alert Configuration - */ - alertResultListDefaultDateRange: schema.object({ - from: schema.string({ defaultValue: 'now-15m' }), - to: schema.string({ defaultValue: 'now' }), - }), - - /** - * Artifacts Configuration - */ - packagerTaskInterval: schema.string({ defaultValue: '60s' }), - validateArtifactDownloads: schema.boolean({ defaultValue: true }), -}); - -export function createConfig$(context: PluginInitializerContext) { - return context.config.create>(); -} diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts index 084105b7d1c4..f376b353531c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts @@ -24,12 +24,7 @@ export const createMockConfig = (): ConfigType => ({ enableExperimental: [], endpointResultListDefaultFirstPageIndex: 0, endpointResultListDefaultPageSize: 10, - alertResultListDefaultDateRange: { - from: 'now-15m', - to: 'now', - }, packagerTaskInterval: '60s', - validateArtifactDownloads: true, alertMergeStrategy: 'missingFields', });