From: Stefan Schantl Date: Wed, 26 Sep 2018 12:43:09 +0000 (+0200) Subject: ids.cgi: Add support for autoupdate of the IDS ruleset X-Git-Tag: v2.23-core131~117^2~140 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=eadad5fda6e7a798ad63261da4629673bd88cf76 ids.cgi: Add support for autoupdate of the IDS ruleset Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index f451c5ed45..3e4822cd41 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -517,6 +517,12 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'update'}) { # Generate file to store the home net. &generate_home_net_file(); + # Check if the the automatic rule update hass been touched. + if($cgiparams{'AUTOUPDATE_INTERVAL'} ne $oldidssettings{'AUTOUPDATE_INTERVAL'}) { + # Call suricatactrl to set the new interval. + &IDS::call_suricatactrl("cron", $cgiparams{'AUTOUPDATE_INTERVAL'}); + } + # Check if the runmode has been changed. if($cgiparams{'RUN_MODE'} ne $oldidssettings{'RUN_MODE'}) { # Open modify sid's file for writing. @@ -593,6 +599,10 @@ $selected{'RULES'}{'emerging'} = ''; $selected{'RULES'}{'registered'} = ''; $selected{'RULES'}{'subscripted'} = ''; $selected{'RULES'}{$idssettings{'RULES'}} = "selected='selected'"; +$selected{'AUTOUPDATE_INTERVAL'}{'off'} = ''; +$selected{'AUTOUPDATE_INTERVAL'}{'daily'} = ''; +$selected{'AUTOUPDATE_INTERVAL'}{'weekly'} = ''; +$selected{'AUTOUPDATE_INTERVAL'}{$idssettings{'AUTOUPDATE_INTERVAL'}} = "selected='selected'"; &Header::openpage($Lang::tr{'intrusion detection system'}, 1, ''); @@ -745,11 +755,12 @@ print < - $Lang::tr{'ids rules update'} + $Lang::tr{'ids rules update'} + $Lang::tr{'ids automatic rules update'} - @@ -757,6 +768,14 @@ print <$Lang::tr{'subscripted user rules'} + + + +