From 50c90dec078e39fd6e8065019bb218934c980156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jirka=20Sch=C3=A4fer?= Date: Sat, 4 Jan 2025 20:01:23 +0100 Subject: [PATCH] naxsi plugin allows multiple logfiles (#1467) * add naxsi exceptions plugin * Update naxsi_exceptions * Update naxsi_exceptions * rename dir to simpler version * Update naxsi_exceptions * Update naxsi_exceptions * naxsi plugin for multiple logfiles to be scanned * Update issue templates * Delete .github/ISSUE_TEMPLATE directory --- plugins/naxsi/naxsi_exceptions | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/naxsi/naxsi_exceptions b/plugins/naxsi/naxsi_exceptions index 163c04cd..5f085c95 100644 --- a/plugins/naxsi/naxsi_exceptions +++ b/plugins/naxsi/naxsi_exceptions @@ -13,7 +13,7 @@ naxsi - monitor naxsi rule hits Following config is needed: [naxsi_exceptions] - env.nginx_error_log_file /var/log/nginx/error.log + env.nginx_error_log_files /var/log/nginx/error.log /var/log/nginx/error2.log env.warning_level 2 env.critical_level 20 @@ -59,16 +59,19 @@ def run_binary(args): def get_values(): - logfile=os.environ.get('nginx_error_log_file') - if not logfile: + logfile=os.environ.get('nginx_error_log_files', '').split(' ') + + if not logfiles: raise ValueError('no nginx err log file configured') - output = run_binary([ - 'logtail', - # '-t', # FIXME test mode,: remove - '-f', - logfile ] - ) + output = '' + for logfile in logfiles: + output += run_binary([ + 'logtail', + # '-t', # FIXME test mode,: remove + '-f', + logfile ] + ) with open(state_file, 'rt') as f: