]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
convert-ids-modifysids-file: Adjust code to use changed write_modify_sids_file function
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 5 Jun 2019 18:56:35 +0000 (20:56 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Jun 2019 11:43:09 +0000 (12:43 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/suricata/convert-ids-modifysids-file

index 8b70aa0fcbdb5a10f504c4f1d96012a0e09d8375..adcc10577479b297cf8f0d3e1a66f3e842e5630f 100644 (file)
@@ -24,44 +24,20 @@ use strict;
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/ids-functions.pl";
 
-# Hash which contains the IDS (suricata) settings.
-my %idssettings;
-
-# Hash which contains the RULES settings.
-my %rulessettings;
-
-#
-## Step 1: Read IDS and rules settings.
-#
-
 exit unless(-f $IDS::ids_settings_file and -f $IDS::rules_settings_file);
 
-# Read IDS settings.
-&General::readhash("$IDS::ids_settings_file", \%idssettings);
-
-# Read rules settings.
-&General::readhash("$IDS::rules_settings_file", \%rulessettings);
-
 #
-## Step 2: Generate and write the file to modify the ruleset.
+## Step 1: Re-generate and write the file to modify the ruleset.
 #
 
-my $IDS_action = "drop";
-
-# Check if the traffic only should be monitored.
-if ($idssettings{"MONITOR_TRAFFIC_ONLY"} eq "on") {
-       # Switch IDS action to alert only.
-       $IDS_action = "alert";
-}
-
 # Call subfunction and pass the desired IDS action.
-&IDS::write_modify_sids_file($IDS_action, $rulessettings{RULES});
+&IDS::write_modify_sids_file();
 
 # Set correct ownership.
 &IDS::set_ownership("$IDS::modify_sids_file");
 
 #
-## Step 3: Call oinkmaster to extract and setup the rules structures.
+## Step 2: Call oinkmaster to extract and setup the rules structures.
 #
 
 # Check if a rulestarball is present.
@@ -74,7 +50,7 @@ if (-f $IDS::rulestarball) {
 }
 
 #
-## Step 4: Start the IDS if enabled.
+## Step 3: Reload the IDS ruleset if running.
 #
 
 # Check if the IDS should be started.