From: Stefan Schantl Date: Tue, 5 Feb 2019 11:43:49 +0000 (+0100) Subject: ids.cgi: Stop suricata when the rulest source has been changed X-Git-Tag: v2.23-core131~117^2~72 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=97870bf29cd93669beef30b876e21f2fed5d6405 ids.cgi: Stop suricata when the rulest source has been changed If the ruleset source has been changed, it has to be configured again. This happens because of different rule categories, filenames rule ID's etc. In case suricata currently is running it has to be stopped and after the configuration has been done by the user, it can be launched again. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 151181fdc0..1f096aea4a 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -352,6 +352,14 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) { &IDS::oinkmaster(); } + # Check if the IDS is running. + if(&IDS::ids_is_running()) { + # Call suricatactrl to stop the IDS - because of the changed + # ruleset - the use has to configure it before suricata can be + # used again. + &IDS::call_suricatactrl("stop"); + } + # Perform a reload of the page. &reload(); }