####################### End added for snort rules control #################################
if ($snortsettings{'RULES'} eq 'subscripted') {
- $url=" http://www.snort.org/sub-rules/snortrules-snapshot-2940.tar.gz/$snortsettings{'OINKCODE'}";
+ $url=" https://www.snort.org/rules/snortrules-snapshot-2970.tar.gz?oinkcode=$snortsettings{'OINKCODE'}";
} elsif ($snortsettings{'RULES'} eq 'registered') {
- $url=" http://www.snort.org/reg-rules/snortrules-snapshot-2940.tar.gz/$snortsettings{'OINKCODE'}";
+ $url=" https://www.snort.org/rules/snortrules-snapshot-2970.tar.gz?oinkcode=$snortsettings{'OINKCODE'}";
+} elsif ($snortsettings{'RULES'} eq 'community') {
+ $url=" https://www.snort.org/rules/community";
} else {
$url="http://rules.emergingthreats.net/open/snort-2.9.0/emerging.rules.tar.gz";
}
{
$errormessage = $Lang::tr{'invalid input for oink code'} unless (
($snortsettings{'OINKCODE'} =~ /^[a-z0-9]+$/) ||
- ($snortsettings{'RULESTYPE'} eq 'nothing' ) ||
- ($snortsettings{'RULESTYPE'} eq 'community' ));
+ ($snortsettings{'RULES'} eq 'nothing' ) ||
+ ($snortsettings{'RULES'} eq 'emerging' ) ||
+ ($snortsettings{'RULES'} eq 'community' ));
&General::writehash("${General::swroot}/snort/settings", \%snortsettings);
if ($snortsettings{'ENABLE_SNORT'} eq 'on')
$checked{'ENABLE_GUARDIAN'}{$snortsettings{'ENABLE_GUARDIAN'}} = "checked='checked'";
$selected{'RULES'}{'nothing'} = '';
$selected{'RULES'}{'community'} = '';
+$selected{'RULES'}{'emerging'} = '';
$selected{'RULES'}{'registered'} = '';
$selected{'RULES'}{'subscripted'} = '';
$selected{'RULES'}{$snortsettings{'RULES'}} = "selected='selected'";
&Header::openpage($Lang::tr{'intrusion detection system'}, 1, '');
####################### Added for snort rules control #################################
-print "<SCRIPT LANGUAGE='JavaScript' SRC='/include/snortupdateutility.js'></SCRIPT>";
+print "<script type='text/javascript' src='/include/snortupdateutility.js'></script>";
print <<END
-<STYLE TYPE="text/css">
+<style type="text/css">
<!--
.section {
border: groove;
background-color: #DCDCDC;
}
-->
-</STYLE>
+</style>
END
;
####################### End added for snort rules control #################################
$Lang::tr{'snort working'}
<tr><td colspan='2' align='center'>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
- <input type='image' alt='$Lang::tr{'reload'}' src='/images/view-refresh.png' />
+ <input type='image' alt='$Lang::tr{'reload'}' title='$Lang::tr{'reload'}' src='/images/view-refresh.png' />
</form>
<tr><td colspan='2' align='left'><pre>
END
refreshpage();
}
-&Header::openbox('100%', 'left', $Lang::tr{'intrusion detection system2'});
+&Header::openbox('100%', 'left', $Lang::tr{'intrusion detection system'});
print <<END
<form method='post' action='$ENV{'SCRIPT_NAME'}'><table width='100%'>
<tr><td class='base'><input type='checkbox' name='ENABLE_SNORT_GREEN' $checked{'ENABLE_SNORT_GREEN'}{'on'} />GREEN Snort
print <<END
</td></tr>
<tr>
- <td><hr /></td>
+ <td><br><br></td>
</tr>
<tr>
<td><b>$Lang::tr{'ids rules update'}</b></td>
<tr>
<td><select name='RULES'>
<option value='nothing' $selected{'RULES'}{'nothing'} >$Lang::tr{'no'}</option>
+ <option value='emerging' $selected{'RULES'}{'emerging'} >$Lang::tr{'emerging rules'}</option>
<option value='community' $selected{'RULES'}{'community'} >$Lang::tr{'community rules'}</option>
<option value='registered' $selected{'RULES'}{'registered'} >$Lang::tr{'registered user rules'}</option>
<option value='subscripted' $selected{'RULES'}{'subscripted'} >$Lang::tr{'subscripted user rules'}</option>
</tr>
<tr>
<td><br />
- $Lang::tr{'ids rules license'} <a href='https://www.snort.org/signup' target='_blank'>www.snort.org</a>$Lang::tr{'ids rules license1'}<br /><br />
+ $Lang::tr{'ids rules license'} <a href='https://www.snort.org/subscribe' target='_blank'>www.snort.org</a>$Lang::tr{'ids rules license1'}<br /><br />
$Lang::tr{'ids rules license2'} <a href='https://www.snort.org/account/oinkcode' target='_blank'>Get an Oinkcode</a>, $Lang::tr{'ids rules license3'}
</td>
</tr>
<td nowrap='nowrap'>Oinkcode: <input type='text' size='40' name='OINKCODE' value='$snortsettings{'OINKCODE'}' /></td>
</tr>
<tr>
- <td width='30%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'download new ruleset'}' />
+ <td width='30%' align='left'><br><input type='submit' name='ACTION' value='$Lang::tr{'download new ruleset'}' />
END
;
if ( -e "/var/tmp/snortrules.tar.gz"){
print <<END
</tr>
</table>
-<hr />
+<br><br>
<table width='100%'>
<tr>
- <td align='center'><input type='hidden' name='ACTION2' value='snort' /><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
+ <td align='right'><input type='hidden' name='ACTION2' value='snort' /><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
</tr>
</table>
</form>
print `cat /var/ipfire/guardian/guardian.ignore`;
print <<END
</textarea></td></tr>
-<tr><td align='center' colspan='2'><input type='hidden' name='ACTION2' value='guardian' /><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td></tr>
+<tr><td align='right' colspan='2'><input type='hidden' name='ACTION2' value='guardian' /><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td></tr>
</table>
</form>
END
if ( -e "${General::swroot}/snort/enable" || -e "${General::swroot}/snort/enable_green" || -e "${General::swroot}/snort/enable_blue" || -e "${General::swroot}/snort/enable_orange" ) {
&Header::openbox('100%', 'LEFT', $Lang::tr{'intrusion detection system rules'});
# Output display table for rule files
- print "<TABLE width='100%'><TR><TD VALIGN='TOP'><TABLE>";
+ print "<table width='100%'><tr><td valign='top'><table>";
print "<form method='post'>";
# Check if reached half-way through rule file rules to start new column
if ($ruledisplaycnt > $rulecnt) {
- print "</TABLE></TD><TD VALIGN='TOP'><TABLE>";
+ print "</table></td><td valign='top'><table>";
$ruledisplaycnt = 0;
}
}
# Output rule file name and checkbox
- print "<TR><TD CLASS='base' VALIGN='TOP'><INPUT TYPE='checkbox' NAME='SNORT_RULE_$rulefile' $rulechecked> <A HREF='$rulefilelink'>$rulefile</A></TD></TR>";
- print "<TR><TD CLASS='base' VALIGN='TOP'>";
+ print "<tr><td class='base' valign='top'><input type='checkbox' NAME='SNORT_RULE_$rulefile' $rulechecked> <a href='$rulefilelink'>$rulefile</a></td></tr>";
+ print "<tr><td class='base' valign='top'>";
# Check for empty 'Description'
if ($snortrules{$rulefile}{'Description'} eq '') {
- print "<TABLE WIDTH='100%'><TR><TD CLASS='base'>No description available</TD></TR>";
+ print "<table width='100%'><tr><td class='base'>No description available</td></tr>";
} else {
# Output rule file 'Description'
- print "<TABLE WIDTH='100%'><TR><TD CLASS='base'>$snortrules{$rulefile}{'Description'}</TD></TR>";
+ print "<table width='100%'><tr><td class='base'>$snortrules{$rulefile}{'Description'}</td></tr>";
}
# Check for display flag
if ($displayrulefilerules) {
# Rule file definition rule display
- print "<TR><TD CLASS='base' VALIGN='TOP'><TABLE border=1><TR>";
+ print "<tr><td class='base' valign='top'><table border='0'><tr>";
# Local vars
my $ruledefdisplaycnt = 0;
# If have display 2 rules, start new row
if (($ruledefdisplaycnt % 2) == 0) {
- print "</TR><TR>";
+ print "</tr><tr>";
$ruledefdisplaycnt = 0;
}
# Create rule file rule's checkbox
$checkboxname = "SNORT_RULE_$rulefile";
$checkboxname .= "_$ruledef";
- print "<TD CLASS='base'><INPUT TYPE='checkbox' NAME='$checkboxname' $ruledefchecked> $snortrules{$rulefile}{'Definition'}{$ruledef}{'Description'}</TD>";
+ print "<td class='base'><input type='checkbox' NAME='$checkboxname' $ruledefchecked> $snortrules{$rulefile}{'Definition'}{$ruledef}{'Description'}</td>";
# Increment count
$ruledefdisplaycnt++;
# If do not have second rule for row, create empty cell
if (($ruledefdisplaycnt % 2) != 0) {
- print "<TD CLASS='base'></TD>";
+ print "<td class='base'></td>";
}
# Close display table
- print "</TR></TABLE></TD></TR>";
+ print "</tr></table></td></tr>";
}
# Close display table
- print "</TABLE>";
+ print "</table>";
# Increment ruledisplaycnt
$ruledisplaycnt++;
}
- print "</TD></TR></TABLE></TD></TR></TABLE>";
+ print "</td></tr></table></td></tr></table>";
print <<END
<table width='100%'>
<tr>
- <td width='33%'> </td>
- <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'update'}' /></td>
- <td width='33%'>
+ <td width='100%' align='right'><input type='submit' name='ACTION' value='$Lang::tr{'update'}' /></td>
<!-- space for future online help link -->
</td>
</tr>