-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support CEF format
- Loading branch information
Ryan Faircloth
authored and
GitHub
committed
Sep 29, 2019
1 parent
8a12f67
commit 9b09453
Showing
9 changed files
with
404 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| [submodule "package/syslog-ng"] | ||
| path = package/syslog-ng | ||
| url = https://github.com/balabit/syslog-ng.git | ||
| [submodule "Submod"] | ||
| branch = syslog-ng-3.23.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
|
|
||
| filter f_microfocus_arcsight { | ||
| program(CEF); | ||
| }; |
84 changes: 84 additions & 0 deletions
84
package/etc/conf.d/log_paths/p_rfc3164_microfocus_arcsight.conf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| parser p_microfocus_arcsight_header { | ||
| csv-parser( | ||
| columns("fields.sc4s_cef_version", "fields.cef_device_vendor", "fields.cef_device_product", "fields.cef_device_version", "fields.cef_device_event_class", "fields.cef_name", "fields.cef_severity", MESSAGE) | ||
| delimiters(chars("|")) | ||
| flags(strip-whitespace, escape-none, greedy) | ||
| ); | ||
|
|
||
| kv-parser(prefix(".cef.") template("t_msg_trim") | ||
| ); | ||
|
|
||
| }; | ||
|
|
||
| parser p_microfocus_arcsight_ts_rt { | ||
| date-parser(format("%s") template("${.cef.rt}") | ||
| ); | ||
| }; | ||
| parser p_microfocus_arcsight_ts_end { | ||
| date-parser(format("%s") template("${.cef.end}") | ||
| ); | ||
| }; | ||
|
|
||
| parser p_microfocus_arcsight_source { | ||
| add-contextual-data( | ||
| selector("${fields.cef_device_vendor}_${fields.cef_device_product}"), | ||
| database("context-local/microfocus_arcsight_source.csv") | ||
| ignore-case(yes) | ||
| prefix(".splunk.") | ||
| default-selector("unknown") | ||
| ); | ||
| }; | ||
|
|
||
| # Microfocus ArcSight | ||
| {{- if (ne (getenv (print "SC4S_LISTEN_MICROFOCUS_ARCSIGHT_TCP_PORT") "no") "no") or (ne (getenv (print "SC4S_LISTEN_MICROFOCUS_ARCSIGHT_UDP_PORT") "no") "no") or (ne (getenv (print "SC4S_LISTEN_MICROFOCUS_ARCSIGHT_TLS_PORT") "no") "no") }} | ||
| {{ $context := dict "port_id" "MICROFOCUS_ARCSIGHT" "parser" "common"}} | ||
| {{ tmpl.Exec "t/source_network.t" $context }} | ||
| {{- end -}} | ||
| {{ define "log_path" }} | ||
| log { | ||
| {{- if eq (.) "yes"}} | ||
| source(s_default-ports); | ||
| filter(f_is_rfc3164); | ||
| filter(f_microfocus_arcsight); | ||
| {{- end}} | ||
| {{- if eq (.) "no"}} | ||
| source (s_dedicated_port_MICROFOCUS_ARCSIGHT); | ||
| {{- end}} | ||
|
|
||
| rewrite { | ||
| r_set_splunk_dest_default(sourcetype("cef"), index("main"), template("t_msg_trim")) | ||
| }; | ||
|
|
||
| parser { | ||
| p_add_context_splunk(key("cef_{fields.cef_device_vendor}_${fields.cef_device_product}")); | ||
|
|
||
| }; | ||
|
|
||
| parser (p_microfocus_arcsight_header); | ||
|
|
||
| # We already have the syslog msg time stamp however that may not be the best one | ||
| # If we have an rt or end field that is best we use the If trick here so if this parser fails | ||
| # We don't get sent to fallback. | ||
| if { | ||
| parser (p_microfocus_arcsight_ts_rt); | ||
| } elif { | ||
| parser (p_microfocus_arcsight_ts_end); | ||
| } else {}; #Do nothing this is allows for both rt and end to be missing and still pass with the message ts | ||
|
|
||
| #CEF TAs use the source as their bounds in props.conf | ||
| parser(p_microfocus_arcsight_source); | ||
|
|
||
| destination(d_hec); #--HEC-- | ||
|
|
||
| flags(flow-control); | ||
|
|
||
| }; | ||
| {{- end}} | ||
| {{- if (ne (getenv (print "SC4S_LISTEN_MICROFOCUS_ARCSIGHT_TCP_PORT") "no") "no") or (ne (getenv (print "SC4S_LISTEN_MICROFOCUS_ARCSIGHT_UDP_PORT") "no") "no") or (ne (getenv (print "SC4S_LISTEN_MICROFOCUS_ARCSIGHT_TLS_PORT") "no") "no") }} | ||
|
|
||
| # Listen on the specified dedicated port(s) for MICROFOCUS_ARCSIGHT traffic | ||
| {{tmpl.Exec "log_path" "no" }} | ||
| {{- end}} | ||
|
|
||
| # Listen on the default port (typically 514) for MICROFOCUS_ARCSIGHT traffic | ||
| {{tmpl.Exec "log_path" "yes" }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ArcSight_ArcSight,source,ArcSight:ArcSight | ||
| Microsoft_System or Application Event,source,CEFEventLog:System or Application Event | ||
| Microsoft_System or Application Event,index,oswin | ||
| Microsoft_Microsoft Windows,source,CEFEventLog:Microsoft Windows | ||
| Microsoft_Microsoft Windows,index,oswinsec | ||
| Incapsula_SIEMintegration,source,Imperva:Incapsula | ||
| Incapsula_SIEMintegration,index,netwaf | ||
| unknown,source,ArcSight:unknown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.