Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,15 @@ def generate_cim_req_params(self):
"hec_event",
):
host, source, sourcetype = self.extract_params(event_tag)
host, source, sourcetype = self.escape_host_src_srctype(
host, source, sourcetype
)
modinput_params = {
"host": host,
"source": source,
"sourcetype": sourcetype,
}

else:
# todo: non syslog/modinput events are skipped currently until we support it
continue
Expand Down Expand Up @@ -243,6 +247,12 @@ def extract_params(self, event):
source_type = transport.get("sourcetype")
return host, source, source_type

def escape_host_src_srctype(self, host, source, sourcetype):
escaped_host = host.replace('"', '\\"')
escaped_source = source.replace('"', '\\"')
escaped_sourcetype = sourcetype.replace('"', '\\"')
return escaped_host, escaped_source, escaped_sourcetype

def escape_char_event(self, event):
"""
Input: Event getting parsed
Expand All @@ -259,7 +269,6 @@ def escape_char_event(self, event):
"%",
"^",
"&",
"*",
"(",
")",
"-",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<version id="13.21" />
<event code="" name="EventID_19_WmiEvent_(WmiEventFilter_activity_detected)_Change_All_Changes" format="">
<version id="" />
<transport type="modinput" host="sample_host=test" source="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" sourcetype="xmlwineventlog"/>
<transport type="modinput" host="sample&quot;test&quot;_host=test" source="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" sourcetype="xmlwineventlog"/>
<source>
<jira id="ADDON-35818 , ADDON-35825" />
<comment />
Expand Down