# Generate file to store the home net.
&generate_home_net_file();
- # Check if the runmode has been changed.
- if($cgiparams{'RUN_MODE'} ne $oldidssettings{'RUN_MODE'}) {
- # Open modify sid's file for writing.
- open(FILE, ">$modify_sids_file") or die "Could not write to $modify_sids_file. $!\n";
-
- # Write file header.
- print FILE "#Autogenerated file. Any custom changes will be overwritten!\n";
-
- # Check if the configured runmode is IPS.
- if ($cgiparams{'RUN_MODE'} eq 'IPS') {
- # Tell oinkmaster to switch all rules from alert to drop.
- print FILE "modifysid \* \"alert\" \| \"drop\"\n";
- }
+ # Open modify sid's file for writing.
+ open(FILE, ">$modify_sids_file") or die "Could not write to $modify_sids_file. $!\n";
- # Close file handle.
- close(FILE);
+ # Write file header.
+ print FILE "#Autogenerated file. Any custom changes will be overwritten!\n";
+
+ # Check if the traffic only should be monitored.
+ unless($cgiparams{'MONITOR_TRAFFIC_ONLY'} eq 'on') {
+ # Tell oinkmaster to switch all rules from alert to drop.
+ print FILE "modifysid \* \"alert\" \| \"drop\"\n";
+ }
+
+ # Close file handle.
+ close(FILE);
+ # Check if "MONITOR_TRAFFIC_ONLY" has been changed.
+ if($cgiparams{'MONITOR_TRAFFIC_ONLY'} ne $oldidssettings{'MONITOR_TRAFFIC_ONLY'}) {
# Check if a ruleset exists.
if (%idsrules) {
# Lock the webpage and print message.
&General::readhash("$idssettingsfile", \%idssettings);
&General::readhash("$rulessettingsfile", \%rulessettings);
-# If the runmode has not been configured yet, set default value.
-unless(exists($idssettings{'RUN_MODE'})) {
- # Set default to IPS.
- $idssettings{'RUN_MODE'} = 'IPS';
-}
-
# If no autoupdate intervall has been configured yet, set default value.
unless(exists($rulessettings{'AUTOUPDATE_INTERVAL'})) {
# Set default to "weekly".
$checked{'ENABLE_IDS'}{'off'} = '';
$checked{'ENABLE_IDS'}{'on'} = '';
$checked{'ENABLE_IDS'}{$idssettings{'ENABLE_IDS'}} = "checked='checked'";
-$checked{'RUN_MODE'}{'IDS'} = '';
-$checked{'RUN_MODE'}{'IPS'} = '';
-$checked{'RUN_MODE'}{$idssettings{'RUN_MODE'}} = "checked='checked'";
+$checked{'MONITOR_TRAFFIC_ONLY'}{'off'} = '';
+$checked{'MONITOR_TRAFFIC_ONLY'}{'on'} = '';
+$checked{'MONITOR_TRAFFIC_ONLY'}{$idssettings{'MONITOR_TRAFFIC_ONLY'}} = "checked='checked'";
$selected{'RULES'}{'nothing'} = '';
$selected{'RULES'}{'community'} = '';
$selected{'RULES'}{'emerging'} = '';
}
&Header::closebox();
+my $rulesdate;
+
+# Check if a ruleset allready has been downloaded.
+if ( -f "$IDS::rulestarball"){
+ # Call stat on the filename to obtain detailed information.
+ my @Info = stat("$IDS::rulestarball");
+
+ # Grab details about the creation time.
+ $rulesdate = localtime($Info[9]);
+}
+
# Draw elements for IDS configuration.
&Header::openbox('100%', 'center', $Lang::tr{'settings'});
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%' border='0'>
<tr>
- <td class='base' colspan='4'>
+ <td class='base' colspan='2'>
<input type='checkbox' name='ENABLE_IDS' $checked{'ENABLE_IDS'}{'on'}>$Lang::tr{'ids activate'} $Lang::tr{'intrusion detection system'}
</td>
- </tr>
-
- <tr>
- <td colspan='4'><br><br></td>
- </tr>
-
- <tr>
- <td class='base' colspan='4'><b>$Lang::tr{'runmode'}</b></td>
- </tr>
- <tr>
- <td class='base' colspan='4'>
- <input type='radio' name='RUN_MODE' value='IDS' $checked{'RUN_MODE'}{'IDS'}>$Lang::tr{'intrusion detection system2'}    
- <input type='radio' name='RUN_MODE' value='IPS' $checked{'RUN_MODE'}{'IPS'}>$Lang::tr{'intrusion prevention system'}
+ <td class='base' colspan='2'>
+ <input type='checkbox' name='MONITOR_TRAFFIC_ONLY' $checked{'MONITOR_TRAFFIC_ONLY'}{'on'}>$Lang::tr{'ids monitor traffic only'}
</td>
</tr>
<tr>
- <td colspan='4'><br></td>
+ <td><br><br></td>
+ <td><br><br></td>
+ <td><br><br></td>
+ <td><br><br></td>
</tr>
<tr>
- <td colspan='4'><b>$Lang::tr{'ids traffic analyze'}</b><br></td>
+ <td colspan='4'><b>$Lang::tr{'ids monitored interfaces'}</b><br></td>
</tr>
<tr>
}
print "<td class='base' width='25%'>\n";
- print "<input type='checkbox' name='ENABLE_IDS_$zone_upper' $checked_input>$Lang::tr{'enabled on'} $Lang::tr{$zone}\n";
+ print "<input type='checkbox' name='ENABLE_IDS_$zone_upper' $checked_input>$Lang::tr{$zone}\n";
print "</td>\n";
}
# Draw elements for ruleset configuration.
&Header::openbox('100%', 'center', $Lang::tr{'ids ruleset settings'});
-my $rulesdate;
-
-# Check if a ruleset allready has been downloaded.
-if ( -f "$IDS::rulestarball"){
- # Call stat on the filename to obtain detailed information.
- my @Info = stat("$IDS::rulestarball");
-
- # Grab details about the creation time.
- $rulesdate = localtime($Info[9]);
-}
-
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%' border='0'>