From 080fb922c15c959be4f0bd101d0cf3f529f0e866 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Mon, 13 May 2013 16:58:53 -0400 Subject: Snort Pkg 2.5.8 Update - bug fixes and new features --- config/snort/snort_interfaces.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'config/snort/snort_interfaces.php') diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php index e96be262..4c21cdd9 100755 --- a/config/snort/snort_interfaces.php +++ b/config/snort/snort_interfaces.php @@ -28,12 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -// Turn on buffering to speed up rendering -ini_set('output_buffering','true'); - -// Start buffering with a cache size of 100000 -ob_start(null, "1000"); - $nocsrf = true; require_once("guiconfig.inc"); require_once("/usr/local/pkg/snort/snort.inc"); @@ -225,6 +219,13 @@ if ($pfsense_stable == 'yes') - + -- cgit v1.2.3 From 1ef295d754f838935412ddefc8d5fa00c51bcc1c Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Tue, 14 May 2013 00:38:49 -0300 Subject: snort - (re)include two level menu and change start stop icons to toggle status as well show current snort status --- config/snort/snort_interfaces.php | 45 ++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 15 deletions(-) (limited to 'config/snort/snort_interfaces.php') diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php index 4c21cdd9..a2523872 100755 --- a/config/snort/snort_interfaces.php +++ b/config/snort/snort_interfaces.php @@ -184,6 +184,7 @@ if ($pfsense_stable == 'yes') @@ -240,15 +242,28 @@ foreach ($a_nat as $natent): ?> /* convert fake interfaces to real and check if iface is up */ /* There has to be a smarter way to do this */ $if_real = snort_get_real_interface($natent['interface']); + $natend_friendly= snort_get_friendly_interface($natent['interface']); $snort_uuid = $natent['uuid']; - if (snort_is_running($snort_uuid, $if_real) == 'no') - $iconfn = 'pass'; - else + if (snort_is_running($snort_uuid, $if_real) == 'no'){ $iconfn = 'block'; - if (snort_is_running($snort_uuid, $if_real, 'barnyard2') == 'no') - $biconfn = 'pass'; - else + $iconfn_msg1 = 'Snort is not running on '; + $iconfn_msg2 = '. Click to start.'; + } + else{ + $iconfn = 'pass'; + $iconfn_msg1 = 'Snort is running on '; + $iconfn_msg = '. Click to stop.'; + } + if (snort_is_running($snort_uuid, $if_real, 'barnyard2') == 'no'){ $biconfn = 'block'; + $biconfn_msg1 = 'Barnyard2 is not running on '; + $biconfn_msg2 = '. Click to start.'; + } + else{ + $biconfn = 'pass'; + $biconfn_msg1 = 'Barnyard2 is running on '; + $biconfn_msg2 = '. Click to stop.'; + } /* See if interface has any rules defined and set boolean flag */ $no_rules = true; @@ -271,7 +286,7 @@ foreach ($a_nat as $natent): ?> id="frd" ondblclick="document.location='snort_interfaces_edit.php?id=';"> - @@ -417,9 +434,7 @@ foreach ($a_nat as $natent): ?> an interface and settings. - -- cgit v1.2.3 From 2ac73febaa378f102c7192f3d401b4f153acd45b Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Tue, 14 May 2013 01:52:55 -0300 Subject: snort - fix small typo --- config/snort/snort_interfaces.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/snort/snort_interfaces.php') diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php index a2523872..c2a66f98 100755 --- a/config/snort/snort_interfaces.php +++ b/config/snort/snort_interfaces.php @@ -252,7 +252,7 @@ foreach ($a_nat as $natent): ?> else{ $iconfn = 'pass'; $iconfn_msg1 = 'Snort is running on '; - $iconfn_msg = '. Click to stop.'; + $iconfn_msg2 = '. Click to stop.'; } if (snort_is_running($snort_uuid, $if_real, 'barnyard2') == 'no'){ $biconfn = 'block'; -- cgit v1.2.3 From f4e899011f9312f79d7f5448ebb99ec59590537d Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Thu, 16 May 2013 19:47:54 -0400 Subject: Add error trapping for Snort interface adds and deletes. --- config/snort/snort_interfaces.php | 53 +++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 8 deletions(-) (limited to 'config/snort/snort_interfaces.php') diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php index c2a66f98..4f7eaebf 100755 --- a/config/snort/snort_interfaces.php +++ b/config/snort/snort_interfaces.php @@ -57,6 +57,18 @@ if (isset($_POST['del_x'])) { exec("/bin/rm -r /var/log/snort/snort_{$if_real}{$snort_uuid}"); exec("/bin/rm -r {$snortdir}/snort_{$snort_uuid}_{$if_real}"); + // If interface had auto-generated Suppress List, then + // delete that along with the interface + $autolist = "{$a_nat[$rulei]['interface']}" . "suppress"; + $a_suppress = &$config['installedpackages']['snortglobal']['suppress']['item']; + foreach ($a_suppress as $k => $i) { + if ($i['name'] == $autolist) { + unset($config['installedpackages']['snortglobal']['suppress']['item'][$k]); + break; + } + } + + // Finally delete the interface's config entry entirely unset($a_nat[$rulei]); } conf_mount_ro(); @@ -215,7 +227,7 @@ if ($pfsense_stable == 'yes') + width="17" height="17" border="0" title="">
echo " "; + title='" . gettext($iconfn_msg1.$natend_friendly.$iconfn_msg2) . "'>"; echo ($no_rules) ? " " : ""; } else echo strtoupper("disabled"); @@ -325,7 +340,7 @@ foreach ($a_nat as $natent): ?> echo " "; + title='" . gettext($biconfn_msg1.$natend_friendly.$biconfn_msg2) . "'>"; } else echo strtoupper("disabled"); ?> @@ -406,9 +421,11 @@ foreach ($a_nat as $natent): ?>   Click on the "> icon to start - snort and barnyard2. + "> + "> icons will show current + snort and barnyard2 status.
  Click on the "> icon to stop - snort and barnyard2. + Click on the status icons to toggle snort and barnyard2 status.
@@ -354,7 +366,7 @@ foreach ($a_nat as $natent): ?> + width="17" height="17" border="0" title=""> @@ -374,11 +386,13 @@ foreach ($a_nat as $natent): ?> " border="0"> + width="17" height="17" " border="0"> + " - onclick="return confirm('Do you really want to delete the selected Snort mapping?')"> + width="17" height="17" title="" + onclick="return intf_del()"> + @@ -396,9 +410,12 @@ foreach ($a_nat as $natent): ?> @@ -448,6 +465,26 @@ foreach ($a_nat as $natent): ?>

- Snort Menu where you can see an over ' . - 'view of all your interface settings. ' . - 'Please visit the Global Settings tab before adding ' . 'an interface.'); ?> + " . gettext("Snort Menu ") . + "" . gettext("where you can see an overview of all your interface settings."); + if (empty($a_nat)) { + echo gettext("Please visit the ") . "" . gettext("Global Settings") . + "" . gettext(" tab before adding an interface."); + }?>
+ + + -- cgit v1.2.3 From e8f8b0ab273baa1d772ec914c51e242c3ff22f56 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Wed, 22 May 2013 12:20:35 -0400 Subject: Fix various HTML style issues to tidy up GUI. --- config/snort/snort_interfaces.php | 280 +++++++++++++++++++------------------- 1 file changed, 141 insertions(+), 139 deletions(-) (limited to 'config/snort/snort_interfaces.php') diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php index 4f7eaebf..ad492df2 100755 --- a/config/snort/snort_interfaces.php +++ b/config/snort/snort_interfaces.php @@ -194,25 +194,26 @@ if ($pfsense_stable == 'yes') ?> - - -
- -
-
- + + + + + - - - + + - - - - - - - - + + - - - - - -
+
+ @@ -226,82 +227,82 @@ if ($pfsense_stable == 'yes') + src="../themes//images/icons/icon_plus.gif" + width="17" height="17" border="0" title="">
 
+ /* See if interface has any rules defined and set boolean flag */ + $no_rules = true; + if (isset($natent['customrules']) && !empty($natent['customrules'])) + $no_rules = false; + if (isset($natent['rulesets']) && !empty($natent['rulesets'])) + $no_rules = false; + if (isset($natent['ips_policy']) && !empty($natent['ips_policy'])) + $no_rules = false; + /* Do not display the "no rules" warning if interface disabled */ + if ($natent['enable'] == "off") + $no_rules = false; + if ($no_rules) + $no_rules_footnote = true; + ?> + - + } else echo strtoupper("disabled"); ?> - + $check_performance = "lowmem"; } ?> - + $check_blockoffenders = disabled; } ?> - + } else echo strtoupper("disabled"); ?> - +   - +
-
-
-    -   - -
- - - - -
- - " - onclick="return intf_del()"> -
-
-
-
- -
- - - +
- + + + + + + + + + + + - + + + +
+
+    +   + +
+ + + + +
+ + " + onclick="return intf_del()"> +
+
 
  + - - - - - - - - - -

+

" . gettext("Snort Menu ") . "" . gettext("where you can see an overview of all your interface settings."); if (empty($a_nat)) { @@ -419,26 +416,26 @@ foreach ($a_nat as $natent): ?>

+


+


+

Click on the Click on the "> icon to add an interface.   +   "> "> icons will show current @@ -446,23 +443,28 @@ foreach ($a_nat as $natent): ?>
Click on the Click on the "> icon to edit an interface and settings.   Click on the status icons to toggle snort and barnyard2 status. + Click on the status icons to toggle snort and barnyard2 status.
Click on the Click on the "> icon to delete an interface and settings.
-
 
+ +
-- cgit v1.2.3