forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Init Osquery plugin (elastic#87109)
# Conflicts: # .github/CODEOWNERS
- Loading branch information
1 parent
983e2e4
commit 8884e0f
Showing
106 changed files
with
4,615 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# osquery | ||
|
||
This plugin adds extended support to Security Solution Fleet Osquery integration | ||
|
||
--- | ||
|
||
## Development | ||
|
||
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment. |
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,8 @@ | ||
/* | ||
* 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 DEFAULT_MAX_TABLE_QUERY_SIZE = 10000; | ||
export const DEFAULT_DARK_MODE = 'theme:darkMode'; |
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,9 @@ | ||
/* | ||
* 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 interface AgentEcs { | ||
type?: string[]; | ||
} |
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,33 @@ | ||
/* | ||
* 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 interface AuditdEcs { | ||
result?: string[]; | ||
session?: string[]; | ||
data?: AuditdDataEcs; | ||
summary?: SummaryEcs; | ||
sequence?: string[]; | ||
} | ||
|
||
export interface AuditdDataEcs { | ||
acct?: string[]; | ||
terminal?: string[]; | ||
op?: string[]; | ||
} | ||
|
||
export interface SummaryEcs { | ||
actor?: PrimarySecondaryEcs; | ||
object?: PrimarySecondaryEcs; | ||
how?: string[]; | ||
message_type?: string[]; | ||
sequence?: string[]; | ||
} | ||
|
||
export interface PrimarySecondaryEcs { | ||
primary?: string[]; | ||
secondary?: string[]; | ||
type?: string[]; | ||
} |
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,20 @@ | ||
/* | ||
* 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 interface CloudEcs { | ||
instance?: CloudInstanceEcs; | ||
machine?: CloudMachineEcs; | ||
provider?: string[]; | ||
region?: string[]; | ||
} | ||
|
||
export interface CloudMachineEcs { | ||
type?: string[]; | ||
} | ||
|
||
export interface CloudInstanceEcs { | ||
id?: string[]; | ||
} |
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,16 @@ | ||
/* | ||
* 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 { GeoEcs } from '../geo'; | ||
|
||
export interface DestinationEcs { | ||
bytes?: number[]; | ||
ip?: string[]; | ||
port?: number[]; | ||
domain?: string[]; | ||
geo?: GeoEcs; | ||
packets?: number[]; | ||
} |
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,16 @@ | ||
/* | ||
* 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 interface DnsEcs { | ||
question?: DnsQuestionEcs; | ||
resolved_ip?: string[]; | ||
response_code?: string[]; | ||
} | ||
|
||
export interface DnsQuestionEcs { | ||
name?: string[]; | ||
type?: string[]; | ||
} |
56 changes: 56 additions & 0 deletions
56
x-pack/plugins/osquery/common/ecs/ecs_fields/extend_map.test.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,56 @@ | ||
/* | ||
* 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 { extendMap } from './extend_map'; | ||
|
||
describe('ecs_fields test', () => { | ||
describe('extendMap', () => { | ||
test('it should extend a record', () => { | ||
const osFieldsMap: Readonly<Record<string, string>> = { | ||
'os.platform': 'os.platform', | ||
'os.full': 'os.full', | ||
'os.family': 'os.family', | ||
'os.version': 'os.version', | ||
'os.kernel': 'os.kernel', | ||
}; | ||
const expected: Record<string, string> = { | ||
'host.os.family': 'host.os.family', | ||
'host.os.full': 'host.os.full', | ||
'host.os.kernel': 'host.os.kernel', | ||
'host.os.platform': 'host.os.platform', | ||
'host.os.version': 'host.os.version', | ||
}; | ||
expect(extendMap('host', osFieldsMap)).toEqual(expected); | ||
}); | ||
|
||
test('it should extend a sample hosts record', () => { | ||
const hostMap: Record<string, string> = { | ||
'host.id': 'host.id', | ||
'host.ip': 'host.ip', | ||
'host.name': 'host.name', | ||
}; | ||
const osFieldsMap: Readonly<Record<string, string>> = { | ||
'os.platform': 'os.platform', | ||
'os.full': 'os.full', | ||
'os.family': 'os.family', | ||
'os.version': 'os.version', | ||
'os.kernel': 'os.kernel', | ||
}; | ||
const expected: Record<string, string> = { | ||
'host.id': 'host.id', | ||
'host.ip': 'host.ip', | ||
'host.name': 'host.name', | ||
'host.os.family': 'host.os.family', | ||
'host.os.full': 'host.os.full', | ||
'host.os.kernel': 'host.os.kernel', | ||
'host.os.platform': 'host.os.platform', | ||
'host.os.version': 'host.os.version', | ||
}; | ||
const output = { ...hostMap, ...extendMap('host', osFieldsMap) }; | ||
expect(output).toEqual(expected); | ||
}); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
x-pack/plugins/osquery/common/ecs/ecs_fields/extend_map.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,14 @@ | ||
/* | ||
* 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 extendMap = ( | ||
path: string, | ||
map: Readonly<Record<string, string>> | ||
): Readonly<Record<string, string>> => | ||
Object.entries(map).reduce<Record<string, string>>((accum, [key, value]) => { | ||
accum[`${path}.${key}`] = `${path}.${value}`; | ||
return accum; | ||
}, {}); |
Oops, something went wrong.