[ML] security_network module - fix type of defaultIndexPattern (#97096)

This PR fixes the defaultIndexPattern type in the security_network module definition.
This commit is contained in:
Robert Oskamp 2021-04-14 16:43:37 +02:00 committed by GitHub
parent e2eeb44613
commit ad628878b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 5 deletions

View file

@ -4,11 +4,7 @@
"description": "Detect anomalous network activity in your ECS-compatible network logs.",
"type": "network data",
"logoFile": "logo.json",
"defaultIndexPattern": [
"logs-*",
"filebeat-*",
"packetbeat-*"
],
"defaultIndexPattern": "logs-*,filebeat-*,packetbeat-*",
"query": {
"bool": {
"filter": [

View file

@ -11,6 +11,8 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
import { USER } from '../../../../functional/services/ml/security_common';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api';
import { isPopulatedObject } from '../../../../../plugins/ml/common/util/object_utils';
const moduleIds = [
'apache_ecs',
'apm_jsbase',
@ -70,6 +72,32 @@ export default ({ getService }: FtrProviderContext) => {
const rspBody = await executeGetModuleRequest(moduleId, USER.ML_POWERUSER, 200);
expect(rspBody).to.be.an(Object);
expect(rspBody).to.have.property('id').a('string');
expect(rspBody).to.have.property('title').a('string');
expect(rspBody).to.have.property('description').a('string');
expect(rspBody).to.have.property('type').a('string');
if (isPopulatedObject(rspBody, ['logoFile'])) {
expect(rspBody).to.have.property('logoFile').a('string');
}
if (isPopulatedObject(rspBody, ['logo'])) {
expect(rspBody).to.have.property('logo').an(Object);
}
if (isPopulatedObject(rspBody, ['defaultIndexPattern'])) {
expect(rspBody).to.have.property('defaultIndexPattern').a('string');
}
if (isPopulatedObject(rspBody, ['query'])) {
expect(rspBody).to.have.property('query').an(Object);
}
if (isPopulatedObject(rspBody, ['jobs'])) {
expect(rspBody).to.have.property('jobs').an(Object);
}
if (isPopulatedObject(rspBody, ['datafeeds'])) {
expect(rspBody).to.have.property('datafeeds').an(Object);
}
if (isPopulatedObject(rspBody, ['kibana'])) {
expect(rspBody).to.have.property('kibana').an(Object);
}
expect(rspBody.id).to.eql(moduleId);
});
}