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

Handle empty sysmon DNS answer data #35207

Merged
merged 6 commits into from Jun 13, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Expand Up @@ -352,6 +352,7 @@ automatic splitting at root level, if root level element is an array. {pull}3415
*Winlogbeat*

- Set `host.os.type` and `host.os.family` to "windows" if not already set. {pull}35435[35435]
- Handle empty DNS answer data in QueryResults for the Sysmon Pipeline {pull}35207[35207]


*Elastic Log Driver*
Expand Down
19 changes: 12 additions & 7 deletions x-pack/winlogbeat/module/sysmon/ingest/sysmon.yml
Expand Up @@ -782,15 +782,20 @@ processors:

if (answer.startsWith("type:")) {
def parts = /\s+/.split(answer);
if (parts.length != 3) {
if (parts.length < 2) {
throw new Exception("unexpected QueryResult format");
}

answers.add([
"type": params[parts[1]],
"data": parts[2]
]);
relatedHosts.add(parts[2]);
if (parts.length == 3) {
answers.add([
"type": params[parts[1]],
"data": parts[2]
]);
relatedHosts.add(parts[2]);
} else {
answers.add([
"type": params[parts[1]]
]);
}
} else {
answer = answer.replace("::ffff:", "");
ips.add(answer);
Expand Down
@@ -0,0 +1,47 @@
[
{
"event": {
"code": "22",
"kind": "event",
"provider": "Microsoft-Windows-Sysmon"
},
"host": {
"name": "internal.network.org"
},
"log": {
"level": "information"
},
"winlog": {
"channel": "Microsoft-Windows-Sysmon/Operational",
"computer_name": "internal.network.org",
"event_data": {
"Image": "C:\\Windows\\System32\\lsass.exe",
"ProcessGuid": "{00000000-0000-0000-0000-000000000000}",
"ProcessId": "500",
"QueryName": "some.other.domain.com",
"QueryResults": "type: 33 ;type: 33 ;1:2:3::3;1.2.3.3;",
"QueryStatus": "0",
"RuleName": "-",
"User": "NT AUTHORITY\\SYSTEM",
"UtcTime": "2000-01-01T00:00:00.000"
},
"event_id": "22",
"level": "information",
"opcode": "Info",
"process": {
"pid": 1000,
"thread": {
"id": 2000
}
},
"provider_guid": "{00000000-0000-0000-0000-000000000000}",
"provider_name": "Microsoft-Windows-Sysmon",
"record_id": 1111,
"time_created": "2000-01-01T00:00:00Z",
"user": {
"identifier": "A-0-0-00"
},
"version": 5
}
}
]