]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/ids.cgi
ids-functions.pl: Rework function write_modify_sids_file().
[ipfire-2.x.git] / html / cgi-bin / ids.cgi
index 1791e9bebce094b8b12f0383e79ab50f4f870fed..74f5ca2238796ea302211d77bc259399c0fb79ad 100644 (file)
@@ -370,21 +370,8 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) {
                                # a new ruleset.
                                &working_notice("$Lang::tr{'ids working'}");
 
-                               &General::readhash("$IDS::ids_settings_file", \%idssettings);
-
-                               # Temporary variable to set the ruleaction.
-                               # Default is "drop" to use suricata as IPS.
-                               my $ruleaction="drop";
-
-                               # Check if the traffic only should be monitored.
-                               if($idssettings{'MONITOR_TRAFFIC_ONLY'} eq 'on') {
-                                       # Switch the ruleaction to "alert".
-                                       # Suricata acts as an IDS only.
-                                       $ruleaction="alert";
-                               }
-
                                # Write the modify sid's file and pass the taken ruleaction.
-                               &IDS::write_modify_sids_file($ruleaction, $cgiparams{'RULES'});
+                               &IDS::write_modify_sids_file();
 
                                # Call subfunction to download the ruleset.
                                if(&IDS::downloadruleset()) {
@@ -614,21 +601,8 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) {
        # Generate file to store the home net.
        &IDS::generate_home_net_file();
 
-       # Temporary variable to set the ruleaction.
-       # Default is "drop" to use suricata as IPS.
-       my $ruleaction="drop";
-
-       # Check if the traffic only should be monitored.
-       if($cgiparams{'MONITOR_TRAFFIC_ONLY'} eq 'on') {
-               # Switch the ruleaction to "alert".
-               # Suricata acts as an IDS only.
-               $ruleaction="alert";
-       }
-
-       &General::readhash("$IDS::rules_settings_file", \%rulessettings);
-
        # Write the modify sid's file and pass the taken ruleaction.
-       &IDS::write_modify_sids_file($ruleaction, $rulessettings{'RULES'});
+       &IDS::write_modify_sids_file();
 
        # Check if "MONITOR_TRAFFIC_ONLY" has been changed.
        if($cgiparams{'MONITOR_TRAFFIC_ONLY'} ne $oldidssettings{'MONITOR_TRAFFIC_ONLY'}) {