-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Security Telemetry Refactor (#109875)
* [@pjhampton/@donaherc] Move sec telem tasks into own package. * Split filter out into its own module, started abstracting ES interaction into a queries module * Implemented querier and fixed some types * Updated tests, moved receiver to plugin from sender to decouple them. * fixed integration in detection engine, misc fixes * [@pjhampton] Fix type ref problems. Update test defs. * Make url transformer a member func of the sender class. * [@pjhampton] clean up receiver commentary. * [@pjhampton] add null check consistency. * Fix bad formatting. Co-authored-by: cdonaher <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
3569540
commit 4f0a63f
Showing
16 changed files
with
686 additions
and
570 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
124 changes: 124 additions & 0 deletions
124
x-pack/plugins/security_solution/server/lib/telemetry/filters.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,124 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export interface AllowlistFields { | ||
[key: string]: boolean | AllowlistFields; | ||
} | ||
|
||
// Allow list process fields within events. This includes "process" and "Target.process".' | ||
const allowlistProcessFields: AllowlistFields = { | ||
args: true, | ||
name: true, | ||
executable: true, | ||
code_signature: true, | ||
command_line: true, | ||
hash: true, | ||
pid: true, | ||
pe: { | ||
original_file_name: true, | ||
}, | ||
uptime: true, | ||
Ext: { | ||
architecture: true, | ||
code_signature: true, | ||
dll: true, | ||
malware_signature: true, | ||
memory_region: true, | ||
token: { | ||
integrity_level_name: true, | ||
}, | ||
}, | ||
thread: true, | ||
working_directory: true, | ||
}; | ||
|
||
// Allow list for event-related fields, which can also be nested under events[] | ||
const allowlistBaseEventFields: AllowlistFields = { | ||
dll: { | ||
name: true, | ||
path: true, | ||
code_signature: true, | ||
malware_signature: true, | ||
pe: { | ||
original_file_name: true, | ||
}, | ||
}, | ||
event: true, | ||
file: { | ||
extension: true, | ||
name: true, | ||
path: true, | ||
size: true, | ||
created: true, | ||
accessed: true, | ||
mtime: true, | ||
directory: true, | ||
hash: true, | ||
Ext: { | ||
code_signature: true, | ||
header_data: true, | ||
malware_classification: true, | ||
malware_signature: true, | ||
quarantine_result: true, | ||
quarantine_message: true, | ||
}, | ||
}, | ||
process: { | ||
parent: allowlistProcessFields, | ||
...allowlistProcessFields, | ||
}, | ||
network: { | ||
direction: true, | ||
}, | ||
registry: { | ||
data: { | ||
strings: true, | ||
}, | ||
hive: true, | ||
key: true, | ||
path: true, | ||
value: true, | ||
}, | ||
Target: { | ||
process: { | ||
parent: allowlistProcessFields, | ||
...allowlistProcessFields, | ||
}, | ||
}, | ||
user: { | ||
id: true, | ||
}, | ||
}; | ||
|
||
// Allow list for the data we include in the events. True means that it is deep-cloned | ||
// blindly. Object contents means that we only copy the fields that appear explicitly in | ||
// the sub-object. | ||
export const allowlistEventFields: AllowlistFields = { | ||
'@timestamp': true, | ||
agent: true, | ||
Endpoint: true, | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
Memory_protection: true, | ||
Ransomware: true, | ||
data_stream: true, | ||
ecs: true, | ||
elastic: true, | ||
// behavioral protection re-nests some field sets under events.* (< 7.15) | ||
events: allowlistBaseEventFields, | ||
// behavioral protection re-nests some field sets under Events.* (>=7.15) | ||
Events: allowlistBaseEventFields, | ||
rule: { | ||
id: true, | ||
name: true, | ||
ruleset: true, | ||
version: true, | ||
}, | ||
host: { | ||
os: true, | ||
}, | ||
...allowlistBaseEventFields, | ||
}; |
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.