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
This commit is contained in:
Frank Hassanabad 2021-07-06 16:07:58 -06:00 committed by GitHub
parent 99b9a2bc5e
commit bc20a9eaa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 75 deletions

View file

@ -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

View file

@ -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) =>

View file

@ -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);
});
});

View file

@ -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<typeof createConfig$> extends Observable<infer P>
? P
: ReturnType<typeof createConfig$>;
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<TypeOf<typeof EndpointConfigSchema>>();
}

View file

@ -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',
});