Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x-pack/winlogbeat: add parent process ID to new process creation events #31102

Merged
merged 3 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...main[Check the HEAD dif

- Improve the error message when the registry file content is invalid. {pull}30543[30543]
- Retry EvtSubscribe from start if fails with strict mode. {issue}29793[29793] {pull}30155[30155]
- Add parent process ID to new process creation events. {issue}29237[29237] {pull}31102[31102]


*Elastic Log Driver*
Expand Down
16 changes: 16 additions & 0 deletions x-pack/winlogbeat/module/security/ingest/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2860,6 +2860,22 @@ processors:
def parts = ctx.process.parent.executable.splitOnToken("\\");
ctx.process.parent.put("name", parts[-1]);
}
if (ctx?.winlog?.event_data?.ProcessId != null) {
if (ctx?.process == null) {
HashMap hm = new HashMap();
ctx.put("process", hm);
}
if (ctx?.process?.parent == null) {
HashMap hm = new HashMap();
ctx.process.put("parent", hm);
}
if (ctx.winlog.event_data.ProcessId instanceof String) {
Long pid = Long.decode(ctx.winlog.event_data.ProcessId);
ctx.process.parent.put("pid", pid.longValue());
} else {
ctx.process.parent.put("pid", ctx.winlog.event_data.ProcessId);
}
}
if (ctx?.winlog?.event_data?.CommandLine != null) {
int start = 0;
int end = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"name": "wevtutil.exe",
"parent": {
"executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"name": "powershell.exe"
"name": "powershell.exe",
"pid": 4652
},
"pid": 4556
},
Expand Down