From 902586e248dd84883a097a3daca0b1129db25b38 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 21 Jul 2022 20:26:08 +0200 Subject: fastnetmon: T4555: add IPv6 support --- src/conf_mode/service_ids_fastnetmon.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/service_ids_fastnetmon.py b/src/conf_mode/service_ids_fastnetmon.py index 57e12ddf2..8213d536e 100755 --- a/src/conf_mode/service_ids_fastnetmon.py +++ b/src/conf_mode/service_ids_fastnetmon.py @@ -49,22 +49,19 @@ def verify(fastnetmon): if not fastnetmon: return None - if not "mode" in fastnetmon: - raise ConfigError('ddos-protection mode is mandatory!') + if 'mode' not in fastnetmon: + raise ConfigError('Specify operating mode!') - if not "network" in fastnetmon: - raise ConfigError('Required define network!') + if 'listen_interface' not in fastnetmon: + raise ConfigError('Specify interface(s) for traffic capture') - if not "listen_interface" in fastnetmon: - raise ConfigError('Define listen-interface is mandatory!') - - if "alert_script" in fastnetmon: - if os.path.isfile(fastnetmon["alert_script"]): + if 'alert_script' in fastnetmon: + if os.path.isfile(fastnetmon['alert_script']): # Check script permissions - if not os.access(fastnetmon["alert_script"], os.X_OK): - raise ConfigError('Script {0} does not have permissions for execution'.format(fastnetmon["alert_script"])) + if not os.access(fastnetmon['alert_script'], os.X_OK): + raise ConfigError('Script "{alert_script}" is not executable!'.format(fastnetmon['alert_script'])) else: - raise ConfigError('File {0} does not exists!'.format(fastnetmon["alert_script"])) + raise ConfigError('File "{alert_script}" does not exists!'.format(fastnetmon)) def generate(fastnetmon): if not fastnetmon: -- cgit v1.2.3