From b2bd2eefe7514656fcdc193367ddd96ee4f979b3 Mon Sep 17 00:00:00 2001 From: Carsten Rosenberg Date: Sun, 13 Jan 2019 01:10:11 +0100 Subject: [PATCH] [Minor] lua_scanner - redis prefix (support for multiple rules of the same type) --- lualib/lua_scanners/clamav.lua | 2 +- lualib/lua_scanners/dcc.lua | 4 ++++ lualib/lua_scanners/fprot.lua | 2 +- lualib/lua_scanners/kaspersky_av.lua | 5 ++++- lualib/lua_scanners/oletools.lua | 2 +- lualib/lua_scanners/savapi.lua | 4 ++++ lualib/lua_scanners/sophos.lua | 2 +- 7 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lualib/lua_scanners/clamav.lua b/lualib/lua_scanners/clamav.lua index 9eb44e53a..8e2ae77f5 100644 --- a/lualib/lua_scanners/clamav.lua +++ b/lualib/lua_scanners/clamav.lua @@ -50,7 +50,7 @@ local function clamav_config(opts) end if not clamav_conf.prefix then - clamav_conf.prefix = 'rs_cl' + clamav_conf.prefix = 'rs_' .. clamav_conf.name .. '_' end if not clamav_conf.log_prefix then diff --git a/lualib/lua_scanners/dcc.lua b/lualib/lua_scanners/dcc.lua index 281672558..581a81ed5 100644 --- a/lualib/lua_scanners/dcc.lua +++ b/lualib/lua_scanners/dcc.lua @@ -253,6 +253,10 @@ local function dcc_config(opts) dcc_conf = lua_util.override_defaults(dcc_conf, opts) + if not dcc_conf.prefix then + dcc_conf.prefix = 'rs_' .. dcc_conf.name .. '_' + end + if not dcc_conf.log_prefix then if dcc_conf.name:lower() == dcc_conf.type:lower() then dcc_conf.log_prefix = dcc_conf.name diff --git a/lualib/lua_scanners/fprot.lua b/lualib/lua_scanners/fprot.lua index d0736263e..9b6ebf802 100644 --- a/lualib/lua_scanners/fprot.lua +++ b/lualib/lua_scanners/fprot.lua @@ -49,7 +49,7 @@ local function fprot_config(opts) end if not fprot_conf.prefix then - fprot_conf.prefix = 'rs_fp' + fprot_conf.prefix = 'rs_' .. fprot_conf.name .. '_' end if not fprot_conf.log_prefix then diff --git a/lualib/lua_scanners/kaspersky_av.lua b/lualib/lua_scanners/kaspersky_av.lua index b9b439f05..9713daa52 100644 --- a/lualib/lua_scanners/kaspersky_av.lua +++ b/lualib/lua_scanners/kaspersky_av.lua @@ -44,11 +44,14 @@ local function kaspersky_config(opts) message = default_message, detection_category = "virus", tmpdir = '/tmp', - prefix = 'rs_ak', } kaspersky_conf = lua_util.override_defaults(kaspersky_conf, opts) + if not kaspersky_conf.prefix then + kaspersky_conf.prefix = 'rs_' .. kaspersky_conf.name .. '_' + end + if not kaspersky_conf.log_prefix then if kaspersky_conf.name:lower() == kaspersky_conf.type:lower() then kaspersky_conf.log_prefix = kaspersky_conf.name diff --git a/lualib/lua_scanners/oletools.lua b/lualib/lua_scanners/oletools.lua index 16e0fdc8d..db2d57904 100644 --- a/lualib/lua_scanners/oletools.lua +++ b/lualib/lua_scanners/oletools.lua @@ -236,7 +236,7 @@ local function oletools_config(opts) oletools_conf = lua_util.override_defaults(oletools_conf, opts) if not oletools_conf.prefix then - oletools_conf.prefix = 'rs_av_' .. oletools_conf.name .. '_' + oletools_conf.prefix = 'rs_' .. oletools_conf.name .. '_' end if not oletools_conf.log_prefix then diff --git a/lualib/lua_scanners/savapi.lua b/lualib/lua_scanners/savapi.lua index d8ae8957b..dfe67d28c 100644 --- a/lualib/lua_scanners/savapi.lua +++ b/lualib/lua_scanners/savapi.lua @@ -51,6 +51,10 @@ local function savapi_config(opts) savapi_conf[k] = v end + if not savapi_conf.prefix then + savapi_conf.prefix = 'rs_' .. savapi_conf.name .. '_' + end + if not savapi_conf.prefix then savapi_conf.prefix = 'rs_ap' end diff --git a/lualib/lua_scanners/sophos.lua b/lualib/lua_scanners/sophos.lua index 655cbc696..712f016be 100644 --- a/lualib/lua_scanners/sophos.lua +++ b/lualib/lua_scanners/sophos.lua @@ -51,7 +51,7 @@ local function sophos_config(opts) end if not sophos_conf.prefix then - sophos_conf.prefix = 'rs_sp' + sophos_conf.prefix = 'rs_' .. sophos_conf.name .. '_' end if not sophos_conf.log_prefix then -- 2.39.5