summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2016-04-21 15:19:54 -0300
committerRenato Botelho <garga@FreeBSD.org>2016-04-21 15:19:54 -0300
commita1bf37b9d365c195de107bbcdc00542f7b69158c (patch)
tree062016da5998491981870f2568fb56fde570d014
parenta6a7009cf797fdb8252268e12d23e7143174487f (diff)
parentafabafecff22306feadb2eeda0b68a60eb72710a (diff)
downloadFreeBSD-ports-a1bf37b9d365c195de107bbcdc00542f7b69158c.zip
FreeBSD-ports-a1bf37b9d365c195de107bbcdc00542f7b69158c.tar.gz
Merge pull request #116 from bmeeks8/pfSense-pkg-snort-3.2.9.1_12
-rw-r--r--security/pfSense-pkg-snort/Makefile4
-rw-r--r--security/pfSense-pkg-snort/files/usr/local/pkg/snort.xml6
-rw-r--r--security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort.inc129
-rw-r--r--security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_migrate_config.php23
-rw-r--r--security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_post_install.php6
-rw-r--r--security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_uninstall.php202
-rw-r--r--security/pfSense-pkg-snort/files/usr/local/www/snort/snort_interfaces_edit.php33
-rw-r--r--security/pfSense-pkg-snort/files/usr/local/www/widgets/include/widget-snort.inc2
-rw-r--r--security/pfSense-pkg-snort/pkg-plist1
9 files changed, 255 insertions, 151 deletions
diff --git a/security/pfSense-pkg-snort/Makefile b/security/pfSense-pkg-snort/Makefile
index 14812c1..e2fbf6a 100644
--- a/security/pfSense-pkg-snort/Makefile
+++ b/security/pfSense-pkg-snort/Makefile
@@ -2,7 +2,7 @@
PORTNAME= pfSense-pkg-snort
PORTVERSION= 3.2.9.1
-PORTREVISION= 11
+PORTREVISION= 12
CATEGORIES= security
MASTER_SITES= # empty
DISTFILES= # empty
@@ -47,6 +47,8 @@ do-install:
${STAGEDIR}${PREFIX}/pkg/snort
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/snort/snort_post_install.php \
${STAGEDIR}${PREFIX}/pkg/snort
+ ${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/snort/snort_uninstall.php \
+ ${STAGEDIR}${PREFIX}/pkg/snort
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/snort/snort_sync.xml \
${STAGEDIR}${PREFIX}/pkg/snort
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/snort/deprecated_rules \
diff --git a/security/pfSense-pkg-snort/files/usr/local/pkg/snort.xml b/security/pfSense-pkg-snort/files/usr/local/pkg/snort.xml
index 7d6e964..e5deee7 100644
--- a/security/pfSense-pkg-snort/files/usr/local/pkg/snort.xml
+++ b/security/pfSense-pkg-snort/files/usr/local/pkg/snort.xml
@@ -74,9 +74,9 @@
include_once("/usr/local/pkg/snort/snort_post_install.php");
]]>
</custom_php_install_command>
- <custom_php_deinstall_command>
+ <custom_php_pre_deinstall_command>
<![CDATA[
- snort_deinstall();
+ include_once("/usr/local/pkg/snort/snort_uninstall.php");
]]>
- </custom_php_deinstall_command>
+ </custom_php_pre_deinstall_command>
</packagegui>
diff --git a/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort.inc b/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort.inc
index f1a093c..6e4e817 100644
--- a/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort.inc
+++ b/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort.inc
@@ -3090,135 +3090,6 @@ EOD;
unset($barnyard2_conf_text);
}
-function snort_deinstall() {
-
- global $config, $g;
-
- $snortdir = SNORTDIR;
- $snortlibdir = SNORT_PBI_BASEDIR . "lib";
- $snortlogdir = SNORTLOGDIR;
- $rcdir = RCFILEPREFIX;
- $snort_rules_upd_log = SNORT_RULES_UPD_LOGFILE;
- $mounted_rw = FALSE;
-
- log_error(gettext("[Snort] Snort package uninstall in progress..."));
-
- /* Remove our rc.d startup shell script */
- unlink_if_exists("{$rcdir}snort.sh");
-
- /* Make sure all active Snort processes are terminated */
- /* Log a message only if a running process is detected */
- if (is_process_running("snort")) {
- log_error(gettext("[Snort] Snort STOP for all interfaces..."));
- snort_stop_all_interfaces();
- }
- sleep(2);
- mwexec('/usr/bin/killall -z snort', true);
- sleep(2);
- mwexec('/usr/bin/killall -9 snort', true);
- sleep(2);
- // Delete any leftover snort PID files in /var/run
- unlink_if_exists("{$g['varrun_path']}/snort_*.pid");
-
- /* Make sure all active Barnyard2 processes are terminated */
- /* Log a message only if a running process is detected */
- if (is_process_running("barnyard2"))
- log_error(gettext("[Snort] Barnyard2 STOP for all interfaces..."));
- mwexec('/usr/bin/killall -z barnyard2', true);
- sleep(2);
- mwexec('/usr/bin/killall -9 barnyard2', true);
- sleep(2);
- // Delete any leftover barnyard2 PID files in /var/run
- unlink_if_exists("{$g['varrun_path']}/barnyard2_*.pid");
-
- /* Remove all the existing Snort cron jobs. */
- if (snort_cron_job_exists("snort2c", FALSE))
- install_cron_job("snort2c", false);
- if (snort_cron_job_exists("snort_check_for_rule_updates.php", FALSE))
- install_cron_job("snort_check_for_rule_updates.php", false);
- if (snort_cron_job_exists("snort_check_cron_misc.inc", FALSE))
- install_cron_job("snort_check_cron_misc.inc", false);
-
- /* Remove our associated Dashboard widget config. If */
- /* "save settings" is enabled, then save old widget */
- /* container settings so we can restore them later. */
- $widgets = $config['widgets']['sequence'];
- if (!empty($widgets)) {
- $widgetlist = explode(",", $widgets);
- foreach ($widgetlist as $key => $widget) {
- if (strstr($widget, "snort_alerts-container")) {
- if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') {
- $config['installedpackages']['snortglobal']['dashboard_widget'] = $widget;
- }
- unset($widgetlist[$key]);
- break;
- }
- }
- $config['widgets']['sequence'] = implode(",", $widgetlist);
- }
-
- /* See if we are to clear blocked hosts on uninstall */
- if ($config['installedpackages']['snortglobal']['clearblocks'] == 'on') {
- log_error(gettext("[Snort] Removing all blocked hosts from <snort2c> table..."));
- mwexec("/sbin/pfctl -t snort2c -T flush");
- }
-
- /* See if we are to clear Snort log files on uninstall */
- if ($config['installedpackages']['snortglobal']['clearlogs'] == 'on') {
- log_error(gettext("[Snort] Clearing all Snort-related log files..."));
- unlink_if_exists("{$snort_rules_upd_log}");
- rmdir_recursive($snortlogdir);
- }
-
- /**********************************************************/
- /* If not already, set Snort conf partition to read-write */
- /* so we can make changes there */
- /**********************************************************/
- if (!is_subsystem_dirty('mount')) {
- conf_mount_rw();
- $mounted_rw = TRUE;
- }
-
- /**********************************************************/
- /* Test for existence of the snort directory in the PBI */
- /* path. If not present, then a package "delete" */
- /* operation is in progress and we need to wipe out the */
- /* configuration files. Otherwise we leave the binary- */
- /* side configuration intact since only a GUI files */
- /* deinstall and reinstall operation is in progress. */
- /**********************************************************/
- if (!is_dir("{$snortdir}")) {
- log_error(gettext("[Snort] Package deletion requested... removing all files..."));
- unlink_if_exists("{$rcdir}snort.sh");
- rmdir_recursive("/usr/local/pkg/snort");
- rmdir_recursive("/usr/local/www/snort");
- rmdir_recursive("/usr/local/etc/snort");
- rmdir_recursive("/usr/local/lib/snort");
- rmdir_recursive("/usr/local/lib/snort_dynamicengine");
- rmdir_recursive("/usr/local/lib/snort_dynamicpreprocessor");
- }
-
- /* Keep this as a last step */
- if ($config['installedpackages']['snortglobal']['forcekeepsettings'] != 'on') {
- log_error(gettext("Not saving settings... all Snort configuration info and logs deleted..."));
- unset($config['installedpackages']['snortglobal']);
- unset($config['installedpackages']['snortsync']);
- unlink_if_exists("{$snort_rules_upd_log}");
- log_error(gettext("[Snort] Flushing <snort2c> firewall table to remove addresses blocked by Snort..."));
- mwexec("/sbin/pfctl -t snort2c -T flush");
- rmdir_recursive("{$snortlogdir}");
- rmdir_recursive("{$g['vardb_path']}/snort");
- log_error(gettext("[Snort] The package has been removed from this system..."));
- }
-
- /**********************************************************/
- /* We're finished with conf partition mods, return to */
- /* read-only if we changed it */
- /**********************************************************/
- if ($mounted_rw == TRUE)
- conf_mount_ro();
-}
-
function snort_prepare_rule_files($snortcfg, $snortcfgdir) {
/***********************************************************/
diff --git a/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_migrate_config.php b/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_migrate_config.php
index a0cf24f..aebe286 100644
--- a/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_migrate_config.php
+++ b/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_migrate_config.php
@@ -534,6 +534,29 @@ foreach ($rule as &$r) {
$updated_cfg = true;
}
+ // Check for and fix an incorrect value for <blockoffendersip>.
+ // The value should be a string and not the index of the string.
+ // This corrects for the impact of a Bootstrap conversion bug.
+ if ($pconfig['blockoffendersip'] == '0' || $pconfig['blockoffendersip'] == '1' || $pconfig['blockoffendersip'] == '2') {
+ switch ($pconfig['blockoffendersip']) {
+ case '0':
+ $pconfig['blockoffendersip'] = 'src';
+ break;
+
+ case '1':
+ $pconfig['blockoffendersip'] = 'dst';
+ break;
+
+ case '2':
+ $pconfig['blockoffendersip'] = 'both';
+ break;
+
+ default:
+ break;
+ }
+ $updated_cfg = true;
+ }
+
// Save the new configuration data into the $config array pointer
$r = $pconfig;
}
diff --git a/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_post_install.php b/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_post_install.php
index 2368bb3..5949cdd 100644
--- a/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_post_install.php
+++ b/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_post_install.php
@@ -117,7 +117,7 @@ if ($pkgid >= 0) {
}
/* Define a default Dashboard Widget Container for Snort */
-$snort_widget_container = "snort_alerts-container:col2:close";
+$snort_widget_container = "snort_alerts:col2:open";
/*********************************************************/
/* START OF BUG FIX CODE */
@@ -238,7 +238,7 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') {
/* Restore the last Snort Dashboard Widget setting if none is set */
if (!empty($config['installedpackages']['snortglobal']['dashboard_widget']) &&
- stristr($config['widgets']['sequence'], "snort_alerts-container") === FALSE)
+ stristr($config['widgets']['sequence'], "snort_alerts") === FALSE)
$config['widgets']['sequence'] .= "," . $config['installedpackages']['snortglobal']['dashboard_widget'];
$rebuild_rules = false;
@@ -251,7 +251,7 @@ conf_mount_ro();
/* If an existing Snort Dashboard Widget container is not found, */
/* then insert our default Widget Dashboard container. */
-if (stristr($config['widgets']['sequence'], "snort_alerts-container") === FALSE)
+if (stristr($config['widgets']['sequence'], "snort_alerts") === FALSE)
$config['widgets']['sequence'] .= ",{$snort_widget_container}";
/* Update Snort package version in configuration */
diff --git a/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_uninstall.php b/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_uninstall.php
new file mode 100644
index 0000000..c41858a
--- /dev/null
+++ b/security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort_uninstall.php
@@ -0,0 +1,202 @@
+<?php
+/*
+ * snort_uninstall.php
+ *
+ * Copyright (C) 2006 Scott Ullrich
+ * Copyright (C) 2009-2010 Robert Zelaya
+ * Copyright (C) 2011-2012 Ermal Luci
+ * Copyright (C) 2013-2016 Bill Meeks
+ * part of pfSense
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/****************************************************************************/
+/* This module is called once during the Snort package deinstallation to */
+/* remove Snort components created/modified outside of the pkg install */
+/* process. It is called via the custom-pre-deinstall hook in the */
+/* the snort.xml package configuration file. */
+/****************************************************************************/
+
+require_once("config.inc");
+require_once("functions.inc");
+require_once("service-utils.inc"); // Need this to get RCFILEPREFIX constant
+require_once("/usr/local/pkg/snort/snort.inc");
+require("/usr/local/pkg/snort/snort_defs.inc");
+
+global $config, $g;
+
+$snortdir = SNORTDIR;
+$snortlibdir = SNORT_PBI_BASEDIR . "lib";
+$snortlogdir = SNORTLOGDIR;
+$rcdir = RCFILEPREFIX;
+$snort_rules_upd_log = SNORT_RULES_UPD_LOGFILE;
+$mounted_rw = FALSE;
+
+log_error(gettext("[Snort] Snort package uninstall in progress..."));
+
+// Remove our rc.d startup shell script
+unlink_if_exists("{$rcdir}snort.sh");
+
+// Make sure all active Snort processes are terminated
+// Log a message only if a running process is detected
+if (is_process_running("snort")) {
+ log_error(gettext("[Snort] Snort STOP on all interfaces..."));
+ snort_stop_all_interfaces();
+}
+sleep(2);
+mwexec('/usr/bin/killall -z snort', true);
+sleep(2);
+mwexec('/usr/bin/killall -9 snort', true);
+sleep(2);
+
+// Delete any leftover snort PID files in /var/run
+unlink_if_exists("{$g['varrun_path']}/snort_*.pid");
+
+// Make sure all active Barnyard2 processes are terminated
+// Log a message only if a running process is detected
+if (is_process_running("barnyard2")) {
+ log_error(gettext("[Snort] Barnyard2 STOP on all interfaces..."));
+}
+mwexec('/usr/bin/killall -z barnyard2', true);
+sleep(2);
+mwexec('/usr/bin/killall -9 barnyard2', true);
+sleep(2);
+
+// Delete any leftover barnyard2 PID files in /var/run
+unlink_if_exists("{$g['varrun_path']}/barnyard2_*.pid");
+
+// Remove any LCK files for Snort that might have been left behind
+unlink_if_exists("{$g['varrun_path']}/snort_pkg_starting.lck");
+
+// Remove all the existing Snort cron jobs.
+if (snort_cron_job_exists("snort2c", FALSE)) {
+ install_cron_job("snort2c", false);
+}
+if (snort_cron_job_exists("snort_check_for_rule_updates.php", FALSE)) {
+ install_cron_job("snort_check_for_rule_updates.php", false);
+}
+if (snort_cron_job_exists("snort_check_cron_misc.inc", FALSE)) {
+ install_cron_job("snort_check_cron_misc.inc", false);
+}
+
+/**********************************************************/
+/* Remove our associated Dashboard widget config. If */
+/* "save settings" is enabled, then save old widget */
+/* container settings so we can restore them later. */
+/**********************************************************/
+$widgets = $config['widgets']['sequence'];
+if (!empty($widgets)) {
+ $widgetlist = explode(",", $widgets);
+ foreach ($widgetlist as $key => $widget) {
+ if (strstr($widget, "snort_alerts")) {
+ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') {
+ $config['installedpackages']['snortglobal']['dashboard_widget'] = $widget;
+ }
+ unset($widgetlist[$key]);
+ break;
+ }
+ }
+ $config['widgets']['sequence'] = implode(",", $widgetlist);
+ write_config("Snort pkg uninstall removed Dashboard widget.");
+}
+
+// See if we are to clear blocked hosts on uninstall
+if ($config['installedpackages']['snortglobal']['clearblocks'] == 'on') {
+ log_error(gettext("[Snort] Removing all blocked hosts from <snort2c> table..."));
+ mwexec("/sbin/pfctl -t snort2c -T flush");
+}
+
+// See if we are to clear Snort log files on uninstall
+if ($config['installedpackages']['snortglobal']['clearlogs'] == 'on') {
+ log_error(gettext("[Snort] Clearing all Snort-related log files..."));
+ unlink_if_exists("{$snort_rules_upd_log}");
+ rmdir_recursive($snortlogdir);
+}
+
+/**********************************************************/
+/* If not already, set Snort conf partition to read-write */
+/* so we can make changes there */
+/**********************************************************/
+if (!is_subsystem_dirty('mount')) {
+ conf_mount_rw();
+ $mounted_rw = TRUE;
+}
+
+/**********************************************************/
+/* Remove files and directories that pkg will not because */
+/* we changed or created them post-install. */
+/**********************************************************/
+log_error(gettext("[Snort] Removing package files..."));
+if (is_dir("{$snortdir}/appid")) {
+ rmdir_recursive("{$snortdir}/appid");
+}
+if (is_dir("{$snortdir}/rules")) {
+ rmdir_recursive("{$snortdir}/rules");
+}
+if (is_dir("{$snortdir}/signatures")) {
+ rmdir_recursive("{$snortdir}/signatures");
+}
+unlink_if_exists("{$snortdir}/*.md5");
+unlink_if_exists("{$snortdir}/*.conf");
+unlink_if_exists("{$snortdir}/*.map");
+unlink_if_exists("{$snortdir}/*.config");
+if (is_array($config['installedpackages']['snortglobal']['rule']) && count($config['installedpackages']['snortglobal']['rule']) > 0) {
+ foreach ($config['installedpackages']['snortglobal']['rule'] as $snortcfg) {
+ $if_real = get_real_interface($snortcfg['interface']);
+ $snort_uuid = $snortcfg['uuid'];
+ if (is_dir("{$snortdir}/snort_{$snort_uuid}_{$if_real}")) {
+ rmdir_recursive("{$snortdir}/snort_{$snort_uuid}_{$if_real}");
+ }
+ }
+}
+
+/**********************************************************/
+/* Keep this as a last step because it is the total */
+/* removal of the configuration settings when the user */
+/* has elected to not retain the package configuration. */
+/**********************************************************/
+if ($config['installedpackages']['snortglobal']['forcekeepsettings'] != 'on') {
+ log_error(gettext("[Snort] Not saving settings... all Snort configuration info and logs will be deleted..."));
+ unset($config['installedpackages']['snortglobal']);
+ unset($config['installedpackages']['snortsync']);
+ unlink_if_exists("{$snort_rules_upd_log}");
+ log_error(gettext("[Snort] Flushing <snort2c> firewall table to remove addresses blocked by Snort..."));
+ mwexec("/sbin/pfctl -t snort2c -T flush");
+ rmdir_recursive("{$snortlogdir}");
+ rmdir_recursive("{$g['vardb_path']}/snort");
+ log_error(gettext("[Snort] The package has been completely removed from this system."));
+}
+else {
+ log_error(gettext("[Snort] Package files removed but all Snort configuration info has been retained."));
+}
+
+/**********************************************************/
+/* We're finished with conf partition mods, return to */
+/* read-only if we changed it. */
+/**********************************************************/
+if ($mounted_rw == TRUE) {
+ conf_mount_ro();
+}
+return true;
+?>
diff --git a/security/pfSense-pkg-snort/files/usr/local/www/snort/snort_interfaces_edit.php b/security/pfSense-pkg-snort/files/usr/local/www/snort/snort_interfaces_edit.php
index 352422a..260de77 100644
--- a/security/pfSense-pkg-snort/files/usr/local/www/snort/snort_interfaces_edit.php
+++ b/security/pfSense-pkg-snort/files/usr/local/www/snort/snort_interfaces_edit.php
@@ -5,7 +5,7 @@
*
* Copyright (C) 2008-2009 Robert Zelaya.
* Copyright (C) 2011-2012 Ermal Luci
- * Copyright (C) 2015 Bill Meeks
+ * Copyright (C) 2016 Bill Meeks
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -154,6 +154,8 @@ elseif (isset($id) && !isset($a_rule[$id])) {
// Set defaults for empty key parameters
if (empty($pconfig['blockoffendersip']))
$pconfig['blockoffendersip'] = "both";
+if (empty($pconfig['blockoffenderskill']))
+ $pconfig['blockoffenderskill'] = "on";
if (empty($pconfig['performance']))
$pconfig['performance'] = "ac-bnfa";
if (empty($pconfig['alertsystemlog_facility']))
@@ -248,7 +250,7 @@ if ($_POST['save'] && !$input_errors) {
if ($_POST['performance']) $natent['performance'] = $_POST['performance']; else unset($natent['performance']);
/* if post = on use on off or rewrite the conf */
if ($_POST['blockoffenders7'] == "on") $natent['blockoffenders7'] = 'on'; else $natent['blockoffenders7'] = 'off';
- if ($_POST['blockoffenderskill'] == "on") $natent['blockoffenderskill'] = 'on'; else unset($natent['blockoffenderskill']);
+ if ($_POST['blockoffenderskill'] == "on") $natent['blockoffenderskill'] = 'on'; else $natent['blockoffenderskill'] = 'off';
if ($_POST['blockoffendersip']) $natent['blockoffendersip'] = $_POST['blockoffendersip']; else unset($natent['blockoffendersip']);
if ($_POST['whitelistname']) $natent['whitelistname'] = $_POST['whitelistname']; else unset($natent['whitelistname']);
if ($_POST['homelistname']) $natent['homelistname'] = $_POST['homelistname']; else unset($natent['homelistname']);
@@ -468,7 +470,7 @@ function snort_get_config_lists($lists) {
$result['default'] = 'default';
if (is_array($config['installedpackages']['snortglobal'][$lists]['item'])) {
foreach ($config['installedpackages']['snortglobal'][$lists]['item'] as $v)
- $result[$v['name']] = $v['name'];
+ $result[$v['name']] = gettext($v['name']);
}
return $result;
}
@@ -525,14 +527,17 @@ $section->addInput(new Form_Select(
'alertsystemlog_facility',
'System Log Facility',
$pconfig['alertsystemlog_facility'],
- array( 'log_auth','log_authpriv','log_daemon','log_user','log_local0','log_local1','log_local2','log_local3','log_local4','log_local5','log_local6','log_local7' )
-))->setHelp('Select system log Facility to use for reporting. Default is log_auth.');
+ array( "log_auth" => gettext("LOG_AUTH"), "log_authpriv" => gettext("LOG_AUTHPRIV"), "log_daemon" => gettext("LOG_DAEMON"), "log_user" => gettext("LOG_USER"),
+ "log_local0" => gettext("LOG_LOCAL0"), "log_local1" => gettext("LOG_LOCAL1"), "log_local2" => gettext("LOG_LOCAL2"), "log_local3" => gettext("LOG_LOCAL3"),
+ "log_local4" => gettext("LOG_LOCAL4"), "log_local5" => gettext("LOG_LOCAL5"), "log_local6" => gettext("LOG_LOCAL6"), "log_local7" => gettext("LOG_LOCAL7") )
+))->setHelp('Select system log Facility to use for reporting. Default is LOG_AUTH.');
$section->addInput(new Form_Select(
'alertsystemlog_priority',
'System Log Priority',
$pconfig['alertsystemlog_priority'],
- array( 'log_emerg','log_crit','log_alert','log_err','log_warning','log_notice','log_info','log_debug' )
-))->setHelp('Select system log Priority (Level) to use for reporting. Default is log_alert.');
+ array( 'log_emerg' => gettext('LOG_EMERG'), 'log_crit' => gettext('LOG_CRIT'), 'log_alert' => gettext('LOG_ALERT'), 'log_err' => gettext('LOG_ERR'),
+ 'log_warning' => gettext('LOG_WARNING'), 'log_notice' => gettext('LOG_NOTICE'), 'log_info' => gettext('LOG_INFO'), 'log_debug' => gettext('LOG_DEBUG') )
+))->setHelp('Select system log Priority (Level) to use for reporting. Default is LOG_ALERT.');
$section->addInput(new Form_Checkbox(
'blockoffenders7',
'Block Offenders',
@@ -543,7 +548,7 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_Checkbox(
'blockoffenderskill',
'Kill States',
- 'Checking this option will kill firewall states for the blocked IP',
+ 'Checking this option will kill firewall states for the blocked IP. Default is checked.',
$pconfig['blockoffenderskill'] == 'on' ? true:false,
'on'
));
@@ -551,8 +556,8 @@ $section->addInput(new Form_Select(
'blockoffendersip',
'Which IP to Block',
$pconfig['blockoffendersip'],
- array( 'src','dst','both' )
-))->setHelp('Select which IP extracted from the packet you wish to block');
+ array( 'src' => gettext('SRC'), 'dst' => gettext('DST'), 'both' => gettext('BOTH') )
+))->setHelp('Select which IP extracted from the packet you wish to block. Default is BOTH.');
$form->add($section);
@@ -561,10 +566,10 @@ $section->addInput(new Form_Select(
'performance',
'Search Method',
$pconfig['performance'],
- array('ac-bnfa' => 'AC-BNFA', 'ac-split' => 'AC-SPLIT', 'lowmem' => 'LOWMEM', 'ac-std' => 'AC-STD',
- 'ac' => 'AC', 'ac-nq' => 'AC-NQ', 'ac-bnfa-nq' => 'AC-BNFA-NQ', 'lowmem-nq' => 'LOWMEM-NQ',
- 'ac-banded' => 'AC-BANDED', 'ac-sparsebands' => 'AC-SPARSEBANDS', 'acs' => 'ACS')
-))->setHelp('Choose a fast pattern matcher algorithm.');
+ array('ac-bnfa' => gettext('AC-BNFA'), 'ac-split' => gettext('AC-SPLIT'), 'lowmem' => gettext('LOWMEM'), 'ac-std' => gettext('AC-STD'),
+ 'ac' => gettext('AC'), 'ac-nq' => gettext('AC-NQ'), 'ac-bnfa-nq' => gettext('AC-BNFA-NQ'), 'lowmem-nq' => gettext('LOWMEM-NQ'),
+ 'ac-banded' => gettext('AC-BANDED'), 'ac-sparsebands' => gettext('AC-SPARSEBANDS'), 'acs' => gettext('ACS') )
+))->setHelp('Choose a fast pattern matcher algorithm. Default is AC-BNFA.');
$section->addInput(new Form_Checkbox(
'fpm_split_any_any',
'Split ANY-ANY',
diff --git a/security/pfSense-pkg-snort/files/usr/local/www/widgets/include/widget-snort.inc b/security/pfSense-pkg-snort/files/usr/local/www/widgets/include/widget-snort.inc
index 3c4d971..ad7f979 100644
--- a/security/pfSense-pkg-snort/files/usr/local/www/widgets/include/widget-snort.inc
+++ b/security/pfSense-pkg-snort/files/usr/local/www/widgets/include/widget-snort.inc
@@ -14,7 +14,7 @@ function widget_snort_uninstall() {
if (!empty($widgets)) {
$widgetlist = explode(",", $widgets);
foreach ($widgetlist as $key => $widget) {
- if (strstr($widget, "snort_alerts-container"))
+ if (strstr($widget, "snort_alerts"))
unset($widgetlist[$key]);
}
$config['widgets']['sequence'] = implode(",", $widgetlist);
diff --git a/security/pfSense-pkg-snort/pkg-plist b/security/pfSense-pkg-snort/pkg-plist
index 3153a76..e2abefa 100644
--- a/security/pfSense-pkg-snort/pkg-plist
+++ b/security/pfSense-pkg-snort/pkg-plist
@@ -4,6 +4,7 @@ pkg/snort/snort_check_cron_misc.inc
pkg/snort/snort_conf_template.inc
pkg/snort/snort_migrate_config.php
pkg/snort/snort_post_install.php
+pkg/snort/snort_uninstall.php
pkg/snort/snort_sync.xml
pkg/snort/deprecated_rules
www/snort/snort_alerts.php
OpenPOWER on IntegriCloud