From 2ed9aab2f13bf04186eccd7815e544016f74a6d7 Mon Sep 17 00:00:00 2001 From: Mark Bonsack Date: Sun, 8 Mar 2020 12:24:51 -0700 Subject: [PATCH 1/8] feature/test_enhancements Update tests to search epoch time --- .../etc/conf.d/conflib/_common/templates.conf | 2 +- .../context/common_event_format_source.csv | 4 +- package/etc/conf.d/filters/cisco/ios.conf | 26 ++-- package/etc/conf.d/filters/cisco/ucm.conf | 31 ++-- .../conf.d/filters/citrix/netscaler.conf.tmpl | 16 +- .../conf.d/log_paths/lp-cisco_acs.conf.tmpl | 38 +++-- .../conf.d/log_paths/lp-cisco_ise.conf.tmpl | 26 +++- .../conf.d/log_paths/lp-cisco_ucm.conf.tmpl | 1 + .../conf.d/log_paths/lp-zscaler_lss.conf.tmpl | 6 +- .../conf.d/log_paths/lp-zscaler_nss.conf.tmpl | 1 - tests/test_checkpoint.py | 93 ++++++++---- tests/test_cisco_acs.py | 56 ++----- tests/test_cisco_apic.py | 31 ++-- tests/test_cisco_asa.py | 48 ++++-- tests/test_cisco_ios.py | 63 ++++++-- tests/test_cisco_ise.py | 49 +++++-- tests/test_cisco_meraki.py | 17 ++- tests/test_cisco_nx_os.py | 31 ++-- tests/test_cisco_ucm.py | 63 +++++--- tests/test_citrix_netscaler.py | 18 ++- tests/test_common.py | 103 +++++++++---- tests/test_cyberark.py | 46 ++++-- tests/test_forcepoint_web.py | 17 ++- tests/test_fortinet_ngfw.py | 70 +++------ tests/test_fortinet_web.py | 83 +++-------- tests/test_imperva.py | 17 ++- tests/test_infoblox.py | 32 ++-- tests/test_juniper_junos_rfc3164.py | 46 ++++-- tests/test_juniper_junos_rfc5124.py | 48 ++++-- tests/test_juniper_legacy.py | 75 +++++++--- tests/test_juniper_sslvpn.py | 18 ++- tests/test_linux_syslog.py | 60 +++++--- tests/test_microfocus_arcsight.py | 73 ++++++--- tests/test_palo_alto.py | 64 +++++--- tests/test_pfsense.py | 47 ++++-- tests/test_plugin_example.py | 17 ++- tests/test_proofpoint.py | 32 ++-- tests/test_symantec_brightmail.py | 66 +++++---- tests/test_symantec_proxy.py | 19 ++- tests/test_ubiquiti_unifi.py | 60 +++++--- tests/test_vmware.py | 51 +++++-- tests/test_zscaler_proxy.py | 138 +++++++++++++----- tests/timeutils.py | 41 ++++++ 43 files changed, 1219 insertions(+), 624 deletions(-) create mode 100644 tests/timeutils.py diff --git a/package/etc/conf.d/conflib/_common/templates.conf b/package/etc/conf.d/conflib/_common/templates.conf index cc49e3b..bf8a218 100644 --- a/package/etc/conf.d/conflib/_common/templates.conf +++ b/package/etc/conf.d/conflib/_common/templates.conf @@ -31,7 +31,7 @@ template t_msg_trim { # =============================================================================================== template t_everything { - template("${ISODATE} ${HOST} ${MSGHDR}${MESSAGE}"); + template("${ISODATE} ${HOST} ${LEGACY_MSGHDR}${MESSAGE}"); }; # =============================================================================================== diff --git a/package/etc/conf.d/context/common_event_format_source.csv b/package/etc/conf.d/context/common_event_format_source.csv index d668350..1aaa666 100644 --- a/package/etc/conf.d/context/common_event_format_source.csv +++ b/package/etc/conf.d/context/common_event_format_source.csv @@ -1,4 +1,6 @@ ArcSight_ArcSight,source,ArcSight:ArcSight +Carbon Black_Protection,sourcetype,carbonblack:protection:cef +Carbon Black_Protection,index,cb:cef Cyber-Ark_Vault,sourcetype,cyberark:epv:cef Cyber-Ark_Vault,index,netauth CyberArk_PTA,sourcetype,cyberark:pta:cef @@ -9,4 +11,4 @@ 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 +unknown,source,CEF:unknown diff --git a/package/etc/conf.d/filters/cisco/ios.conf b/package/etc/conf.d/filters/cisco/ios.conf index 0a2667e..4b7f995 100644 --- a/package/etc/conf.d/filters/cisco/ios.conf +++ b/package/etc/conf.d/filters/cisco/ios.conf @@ -9,26 +9,30 @@ parser cisco-parser-ex{ channel { filter { #message('^<\d*>(?:(?\d+)\: )?(?:(?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]): )?(?:(?\d+): )?(?:(?\*)?(?(?