aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_interfaces_whitelist_edit.php
diff options
context:
space:
mode:
authorrobiscool <robrob2626@yahoo.com>2010-04-27 23:15:56 -0700
committerrobiscool <robrob2626@yahoo.com>2010-04-27 23:16:44 -0700
commit20ded7753eba0d96560e715a0b07c38e6dbf8a07 (patch)
treed6e51be135db4c1f9ce79a296360f2037f64bb2d /config/snort/snort_interfaces_whitelist_edit.php
parent0e246330ee7178450c588901a4ae362c6e21aa9e (diff)
downloadpfsense-packages-20ded7753eba0d96560e715a0b07c38e6dbf8a07.tar.gz
pfsense-packages-20ded7753eba0d96560e715a0b07c38e6dbf8a07.tar.bz2
pfsense-packages-20ded7753eba0d96560e715a0b07c38e6dbf8a07.zip
snort, add suppress tab, fix javascript on pfsense 2.0
Diffstat (limited to 'config/snort/snort_interfaces_whitelist_edit.php')
-rw-r--r--config/snort/snort_interfaces_whitelist_edit.php78
1 files changed, 61 insertions, 17 deletions
diff --git a/config/snort/snort_interfaces_whitelist_edit.php b/config/snort/snort_interfaces_whitelist_edit.php
index 8fea1a65..ef96c429 100644
--- a/config/snort/snort_interfaces_whitelist_edit.php
+++ b/config/snort/snort_interfaces_whitelist_edit.php
@@ -35,7 +35,9 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-require("guiconfig.inc");
+require_once("guiconfig.inc");
+require_once("/usr/local/pkg/snort/snort.inc");
+require_once("/usr/local/pkg/snort/snort_gui.inc");
if (!is_array($config['installedpackages']['snortglobal']['whitelist']['item']))
$config['installedpackages']['snortglobal']['whitelist']['item'] = array();
@@ -101,7 +103,23 @@ if (isset($id) && $a_whitelist[$id]) {
$addresssubnettest = false;
}
-if ($_POST) {
+ /* this will exec when alert says apply */
+ if ($_POST['apply']) {
+
+ if (file_exists("$d_snort_whitelist_dirty_path")) {
+
+ write_config();
+
+ sync_snort_package_config();
+ sync_snort_package();
+
+ unlink("$d_snort_whitelist_dirty_path");
+
+ }
+
+ }
+
+if ($_POST['submit']) {
unset($input_errors);
$pconfig = $_POST;
@@ -219,17 +237,6 @@ if ($_POST) {
include("head.inc");
-
-
-
-$description_str = gettext("Description");
-$hosts_str = gettext("IP or CIDR items");
-$ip_str = gettext("IP");
-
-$update_freq_str = gettext("Update Freq.");
-
-
-
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
@@ -238,7 +245,7 @@ $update_freq_str = gettext("Update Freq.");
echo $jscriptstr;
?>
-<script type="text/javascript" src="../row_helper.js"></script>
+<script type="text/javascript" src="/snort/javascript/row_helper.js"></script>
<input type='hidden' name='address_type' value='textbox' />
<script type="text/javascript">
rowname[0] = "address";
@@ -257,6 +264,31 @@ $update_freq_str = gettext("Update Freq.");
<form action="snort_interfaces_whitelist_edit.php?id=<?=$id?>" method="post" name="iform" id="iform">
+<?php
+ /* Display Alert message */
+ if ($input_errors) {
+ print_input_errors($input_errors); // TODO: add checks
+ }
+
+ if ($savemsg) {
+ print_info_box2($savemsg);
+ }
+
+ //if (file_exists($d_snortconfdirty_path)) {
+ if (file_exists($d_snort_whitelist_dirty_path)) {
+ echo '<p>';
+
+ if($savemsg) {
+ print_info_box_np2("{$savemsg}");
+ }else{
+ print_info_box_np2('
+ The Snort configuration has changed and snort needs to be restarted on this interface.<br>
+ You must apply the changes in order for them to take effect.<br>
+ ');
+ }
+ }
+?>
+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
@@ -267,6 +299,7 @@ $update_freq_str = gettext("Update Freq.");
$tab_array[] = array("Alerts", false, "/snort/snort_alerts.php");
$tab_array[] = array("Blocked", false, "/snort/snort_blocked.php");
$tab_array[] = array("Whitelists", true, "/snort/snort_interfaces_whitelist.php");
+ $tab_array[] = array("Suppress", false, "/snort/snort_interfaces_suppress.php");
$tab_array[] = array("Help", false, "/snort/snort_help_info.php");
display_top_tabs($tab_array);
?> </td></tr>
@@ -276,6 +309,9 @@ $update_freq_str = gettext("Update Freq.");
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<?php if(is_alias_inuse($pconfig['name']) == true): ?>
<tr>
+ <td colspan="2" valign="top" class="listtopic">Add the name and description of the file.</td>
+ </tr>
+ <tr>
<td valign="top" class="vncellreq">Name</td>
<td class="vtable"> <input name="name" type="hidden" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" />
<?php echo $pconfig['name']; ?>
@@ -286,6 +322,9 @@ $update_freq_str = gettext("Update Freq.");
</tr>
<?php else: ?>
<tr>
+ <td colspan="2" valign="top" class="listtopic">Add the name and description of the file.</td>
+ </tr>
+ <tr>
<td valign="top" class="vncellreq">Name</td>
<td class="vtable">
<input name="name" type="text" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" />
@@ -321,6 +360,9 @@ $update_freq_str = gettext("Update Freq.");
<span class="vexpl">Choose the type of list you will like see in your Interface Edit Tab.&nbsp;Hint: Best pratice is to test every list you make.
</span>&nbsp;<span class="red">Note:</span>&nbsp;NETLIST's are only for defining snort.conf's external or home NETS.</td>
</tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Add auto generated ips.</td>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncell">WAN IPs</td>
<td width="78%" class="vtable">
@@ -367,6 +409,9 @@ $update_freq_str = gettext("Update Freq.");
</td>
</tr>
<tr>
+ <td colspan="2" valign="top" class="listtopic">Add your own custom ips.</td>
+ </tr>
+ <tr>
<td width="22%" valign="top" class="vncellreq"><div id="addressnetworkport">IP or CIDR items</div></td>
<td width="78%" class="vtable">
<table id="maintable">
@@ -413,9 +458,8 @@ $update_freq_str = gettext("Update Freq.");
} // end foreach
?>
</tbody>
- </table>
- <a onclick="javascript:addRowTo('maintable'); typesel_change(); return false;" href="#">
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="add another entry" />
+ </table>
+ <a onclick="javascript:addRowTo('maintable'); return false;" href="#"><img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="add another entry" />
</a>
</td>
</tr>