-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into timeline-bug-7.9
- Loading branch information
Showing
21 changed files
with
2,757 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
x-pack/plugins/lists/server/routes/endpoint_disallowed_fields.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const endpointDisallowedFields = [ | ||
'file.Ext.quarantine_path', | ||
'file.Ext.quarantine_result', | ||
'process.entity_id', | ||
'process.parent.entity_id', | ||
'process.ancestry', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
x-pack/test/api_integration/apis/lists/create_exception_list_item.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from '@kbn/expect/expect.js'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const supertest = getService('supertest'); | ||
describe('Lists API', () => { | ||
before(async () => await esArchiver.load('lists')); | ||
|
||
after(async () => await esArchiver.unload('lists')); | ||
|
||
it('should return a 400 if an endpoint exception item with a list-based entry is provided', async () => { | ||
const badItem = { | ||
namespace_type: 'agnostic', | ||
description: 'bad endpoint item for testing', | ||
name: 'bad endpoint item', | ||
list_id: 'endpoint_list', | ||
type: 'simple', | ||
entries: [ | ||
{ | ||
type: 'list', | ||
field: 'some.field', | ||
operator: 'included', | ||
list: { | ||
id: 'somelist', | ||
type: 'keyword', | ||
}, | ||
}, | ||
], | ||
}; | ||
const { body } = await supertest | ||
.post(`/api/exception_lists/items`) | ||
.set('kbn-xsrf', 'xxx') | ||
.send(badItem) | ||
.expect(400); | ||
expect(body.message).to.eql( | ||
'cannot add exception item with entry of type "list" to endpoint exception list' | ||
); | ||
}); | ||
|
||
it('should return a 400 if endpoint exception entry has disallowed field', async () => { | ||
const fieldName = 'file.Ext.quarantine_path'; | ||
const badItem = { | ||
namespace_type: 'agnostic', | ||
description: 'bad endpoint item for testing', | ||
name: 'bad endpoint item', | ||
list_id: 'endpoint_list', | ||
type: 'simple', | ||
entries: [ | ||
{ | ||
type: 'match', | ||
field: fieldName, | ||
operator: 'included', | ||
value: 'doesnt matter', | ||
}, | ||
], | ||
}; | ||
const { body } = await supertest | ||
.post(`/api/exception_lists/items`) | ||
.set('kbn-xsrf', 'xxx') | ||
.send(badItem) | ||
.expect(400); | ||
expect(body.message).to.eql(`cannot add endpoint exception item on field ${fieldName}`); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function listsAPIIntegrationTests({ loadTestFile }: FtrProviderContext) { | ||
describe('Lists plugin', function () { | ||
this.tags(['lists']); | ||
loadTestFile(require.resolve('./create_exception_list_item')); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.