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 3 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
4 changes: 4 additions & 0 deletions CHANGELOG.next.asciidoc
Expand Up @@ -31,6 +31,10 @@ https://github.com/elastic/beats/compare/v8.7.1\...main[Check the HEAD diff]
*Winlogbeat*

- Add "event.category" and "event.type" to Sysmon module for EventIDs 8, 9, 19, 20, 27, 28, 255 {pull}35193[35193]
- Corrects issue with security events with source IP of "LOCAL" or "Unknown" failing to ingest {issue}19627[19627] {pull}34295[34295]
- Added processing for Windows Event ID's 4797, 5379, 5380, 5381, and 5382 for the Security Ingest Pipeline {issue}34293[34293] {pull}34294[34294]
- Added processing for Windows Event ID's 5140 and 5145 for the Security Ingest Pipeline {pull}34352[34352]
- Handle empty DNS answer data in QueryResults for the Sysmon Pipeline {pull}35207[35207]
Technici4n marked this conversation as resolved.
Show resolved Hide resolved

*Functionbeat*

Expand Down
21 changes: 14 additions & 7 deletions x-pack/winlogbeat/module/sysmon/ingest/sysmon.yml
Expand Up @@ -782,15 +782,22 @@ processors:

if (answer.startsWith("type:")) {
def parts = /\s+/.split(answer);
if (parts.length != 3) {

if (parts.length == 3) {
answers.add([
"type": params[parts[1]],
"data": parts[2]
]);
relatedHosts.add(parts[2]);
} else if (parts.length == 2) {
// Missing data, for example with "type: 33 ;"
answers.add([
"type": params[parts[1]],
"data": ""
]);
} else {
throw new Exception("unexpected QueryResult format");
}
Technici4n marked this conversation as resolved.
Show resolved Hide resolved

answers.add([
"type": params[parts[1]],
"data": parts[2]
]);
relatedHosts.add(parts[2]);
} 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
}
}
]