From 3fa5837b2c79acd2ba6ba708e1ff7061d49f709c Mon Sep 17 00:00:00 2001 From: Ross Wolf <31489089+rw-access@users.noreply.github.com> Date: Tue, 9 Mar 2021 12:15:46 -0700 Subject: [PATCH 1/6] Continue target process RFC to stage 1 --- rfcs/text/0016-target-process.md | 72 +++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 5 deletions(-) diff --git a/rfcs/text/0016-target-process.md b/rfcs/text/0016-target-process.md index fd8d41f575..e1470155be 100644 --- a/rfcs/text/0016-target-process.md +++ b/rfcs/text/0016-target-process.md @@ -1,7 +1,7 @@ # 0016: Target process fields -- Stage: **0 (strawperson)** +- Stage: **1 (strawperson)** - Date: **2021-03-09** @@ -29,6 +29,27 @@ The most common use cases for Windows: Stage 1: Describe at a high level how this change affects fields. Include new or updated yml field definitions for all of the essential fields in this draft. While not exhaustive, the fields documented here should be comprehensive enough to deeply evaluate the technical considerations of this change. The goal here is to validate the technical details for all essential fields and to provide a basis for adding experimental field definitions to the schema. Use GitHub code blocks with yml syntax formatting. --> +**Stage 1** +This causes reuse of the `process.*` field set at two locations: +* `process.target.*` +* `process.parent.target*` + + +The `process.parent.target` reused fieldset could be descoped if it's too complex or increases the field count too significantly. It does have value, because information of the parent process of the target remains valuable. More on that utility in the next section. + +```yml + reusable: + top_level: true + expected: + - at: process + as: parent + - at: process + as: target + # collect the parent of the target process at process.target.parent + - at: process.target + as: parent +``` + @@ -39,12 +60,54 @@ Stage 2: Add or update all remaining field definitions. The list should now be e Stage 1: Describe at a high-level how these field changes will be used in practice. Real world examples are encouraged. The goal here is to understand how people would leverage these fields to gain insights or solve problems. ~1-3 paragraphs. --> +Target process information is valuable to detect several kinds of attacker behavior, but also good to profile or audit a system. +The most commonly known attacker behaviors where one process directly accesses another: + +* Process injection [T1055](https://attack.mitre.org/techniques/T1055/) +* Access token manipulation [T1134](https://attack.mitre.org/techniques/T1134/) +* Credential theft from lsass [T1003.001](https://attack.mitre.org/techniques/T1003/001/) + + +Here are some example detections that could be written in KQL: + +| Example rule name | KQL query | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| Injection to a browser | event.action : "process_injection" and process.target.name : ("GoogleChrome.exe", "iexplore.exe", "firefox.exe") | +| Token theft from explorer | event.action : "token_theft" and process.name : (not "explorer.exe") and process.target.name : "explorer.exe" | +| Injection to a service process | event.action : "process_injection" and process.target.parent.name : "services.exe" | +| Password dumping from lsass | event.action : "process_memory_read" and process.target.name : "lsass.exe" | +| Generic process access | event.action : "process_access" an process.target.name : * | + + ## Source data +Example sources of data include EDR-like products that collect operating system telemetry. Although cross-process events are more commonly known with Windows (injection, memory reads), they are also possible with Linux and macOS. The most universal use case across operating systems is attaching remote debuggers, which could be used for benign or malicious purposes. + + +Example event from Microsoft Sysmon [source](https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=90010), which is used by Winlogbeat: + + Process accessed: + UtcTime: 2017-05-15 00:02:01.463 + SourceProcessGUID: {d49b2de5-efa6-5918-0000-00104d553c00} + SourceProcessId: 4704 + SourceThreadId: 4124 + SourceImage: C:\mimikatz\x64\mimikatz.exe + TargetProcessGUID: {d49b2de5-e852-5918-0000-00100b0f0700} + TargetProcessId: 1576 + TargetImage: C:\Windows\system32\winlogon.exe + GrantedAccess: 0x40 + CallTrace: C:\Windows\SYSTEM32\ntdll.dll+a5594|C:\Windows\system32\KERNELBASE.dll+1e865|C:\mimikatz\x64\mimikatz.exe+77ad|C:\mimikatz\x64\mimikatz.exe+7759|C:\mimikatz\x64\mimikatz.exe+f095|C:\mimikatz\x64\mimikatz.exe+6610a|C:\mimikatz\x64\mimikatz.exe+65dc4|C:\mimikatz\x64\mimikatz.exe+4ac00|C:\mimikatz\x64\mimikatz.exe+4aa36|C:\mimikatz\x64\mimikatz.exe+4a81d|C:\mimikatz\x64\mimikatz.exe+6ebe5|C:\Windows\system32\KERNEL32.DLL+18102|C:\Windows\SYSTEM32\ntdll.dll+5c5b4 + +The `Target*` fields of the Sysmon would map accordingly: +* `TargetProcessGUID` -> `process.target.entity_id` +* `TargetProcessID` -> `process.target.pid` +* `TargetProcessImage` -> `process.target.executable` and `process.target.name` + + @@ -65,10 +128,13 @@ The goal here is to research and understand the impact of these changes on users ## Concerns + +The biggest concern is the duplication of fields and the double-nested `process` group at `process.target.parent`. This could require some updates to our reuse mechanism, but that's an issue internal to this repository. We should make sure that we don't accidentally populate `process.parent.target`, which would have different meaning. Because of this, we will need to make sure that we articulate what each reuse means, similar to https://www.elastic.co/guide/en/ecs/current/ecs-user.html#ecs-user-nestings. + @@ -95,8 +161,4 @@ The following are the people that consulted on the contents of this RFC. * Stage 0: https://github.com/elastic/ecs/pull/1286 - - From 84e20e0c21113a93f3ef549821772617be47cfe8 Mon Sep 17 00:00:00 2001 From: Ross Wolf <31489089+rw-access@users.noreply.github.com> Date: Tue, 9 Mar 2021 13:11:05 -0700 Subject: [PATCH 2/6] Add mapping for sysmon source fields --- rfcs/text/0016-target-process.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rfcs/text/0016-target-process.md b/rfcs/text/0016-target-process.md index e1470155be..c880d354f8 100644 --- a/rfcs/text/0016-target-process.md +++ b/rfcs/text/0016-target-process.md @@ -102,11 +102,17 @@ Example event from Microsoft Sysmon [source](https://www.ultimatewindowssecurity GrantedAccess: 0x40 CallTrace: C:\Windows\SYSTEM32\ntdll.dll+a5594|C:\Windows\system32\KERNELBASE.dll+1e865|C:\mimikatz\x64\mimikatz.exe+77ad|C:\mimikatz\x64\mimikatz.exe+7759|C:\mimikatz\x64\mimikatz.exe+f095|C:\mimikatz\x64\mimikatz.exe+6610a|C:\mimikatz\x64\mimikatz.exe+65dc4|C:\mimikatz\x64\mimikatz.exe+4ac00|C:\mimikatz\x64\mimikatz.exe+4aa36|C:\mimikatz\x64\mimikatz.exe+4a81d|C:\mimikatz\x64\mimikatz.exe+6ebe5|C:\Windows\system32\KERNEL32.DLL+18102|C:\Windows\SYSTEM32\ntdll.dll+5c5b4 -The `Target*` fields of the Sysmon would map accordingly: +The `Target*` fields of the Sysmon event would map: * `TargetProcessGUID` -> `process.target.entity_id` * `TargetProcessID` -> `process.target.pid` * `TargetProcessImage` -> `process.target.executable` and `process.target.name` +The `Source*` fields of the Sysmon would map: +* `SourceProcessGUID` -> `process.entity_id` +* `SourceProcessId` -> `process.pid` +* `SourceThreadId` -> `process.thread.tid` (side question: does it make sense to move `thread.*` from `process`?) +* `SourceImage` -> `process.executable` and `process.name` + * Stage 0: https://github.com/elastic/ecs/pull/1286 -* Stage 1: https://github.com/elastic/ecs/pull/NNN +* Stage 1: https://github.com/elastic/ecs/pull/1297 From 7d39a8e939ae4dafdceca963803b45f69a25b421 Mon Sep 17 00:00:00 2001 From: Ross Wolf <31489089+rw-access@users.noreply.github.com> Date: Thu, 25 Mar 2021 15:51:59 -0600 Subject: [PATCH 4/6] s/strawperson/draft Co-authored-by: Eric Beahan --- rfcs/text/0016-target-process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/text/0016-target-process.md b/rfcs/text/0016-target-process.md index e28c2c5c84..3e743784ee 100644 --- a/rfcs/text/0016-target-process.md +++ b/rfcs/text/0016-target-process.md @@ -1,7 +1,7 @@ # 0016: Target process fields -- Stage: **1 (strawperson)** +- Stage: **1 (draft)** - Date: **2021-03-09** From 73d698bf974748662ef54cac3cc2e939eb043372 Mon Sep 17 00:00:00 2001 From: Ross Wolf <31489089+rw-access@users.noreply.github.com> Date: Tue, 8 Jun 2021 16:16:13 -0600 Subject: [PATCH 5/6] Add sponsor --- rfcs/text/0016-target-process.md | 1 + 1 file changed, 1 insertion(+) diff --git a/rfcs/text/0016-target-process.md b/rfcs/text/0016-target-process.md index 3e743784ee..646bf15625 100644 --- a/rfcs/text/0016-target-process.md +++ b/rfcs/text/0016-target-process.md @@ -155,6 +155,7 @@ The following are the people that consulted on the contents of this RFC. * @rw-access | author * @andrewstucki | co-author +* @devonakerr | sponsor From 0dbc4df936aa1a86e644f5dd161047560905b924 Mon Sep 17 00:00:00 2001 From: Eric Beahan Date: Wed, 9 Jun 2021 11:01:05 -0500 Subject: [PATCH 6/6] set date --- rfcs/text/0016-target-process.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rfcs/text/0016-target-process.md b/rfcs/text/0016-target-process.md index 646bf15625..3aa9bb74ec 100644 --- a/rfcs/text/0016-target-process.md +++ b/rfcs/text/0016-target-process.md @@ -2,7 +2,7 @@ - Stage: **1 (draft)** -- Date: **2021-03-09** +- Date: **2021-06-09** @@ -35,7 +35,7 @@ This causes reuse of the `process.*` field set at two locations: * `process.parent.target*` -The `process.parent.target` reused fieldset could be descoped if it's too complex or increases the field count too significantly. It does have value, because information of the parent process of the target remains valuable. More on that utility in the next section. +The `process.parent.target` reused fieldset could be descoped if it's too complex or increases the field count too significantly. It does have value, because information of the parent process of the target remains valuable. More on that utility in the next section. ```yml reusable: