Skip to content

Commit

Permalink
Merge pull request #63 from bmeeks8/snort-3.2.9.1_2
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgarga committed Feb 29, 2016
2 parents 186cc63 + e16ae8d commit e942b8c
Show file tree
Hide file tree
Showing 38 changed files with 7,586 additions and 8,154 deletions.
2 changes: 1 addition & 1 deletion security/pfSense-pkg-snort/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PORTNAME= pfSense-pkg-snort
PORTVERSION= 3.2.9.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
9 changes: 1 addition & 8 deletions security/pfSense-pkg-snort/files/usr/local/pkg/snort.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
</copyright>
<description>Snort IDS/IPS Package</description>
<name>Snort</name>
<version>3.2.9.1</version>
<title>Services: Snort IDS</title>
<include_file>/usr/local/pkg/snort/snort.inc</include_file>
<menu>
Expand Down Expand Up @@ -137,10 +138,6 @@
<prefix>/usr/local/www/snort/</prefix>
<item>https://packages.pfsense.org/packages/config/snort/snort_rules.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/snort/</prefix>
<item>https://packages.pfsense.org/packages/config/snort/snort_rules_edit.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/snort/</prefix>
<item>https://packages.pfsense.org/packages/config/snort/snort_rulesets.php</item>
Expand All @@ -165,10 +162,6 @@
<prefix>/usr/local/www/snort/</prefix>
<item>https://packages.pfsense.org/packages/config/snort/snort_interfaces_suppress_edit.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/snort/</prefix>
<item>https://packages.pfsense.org/packages/config/snort/snort_list_view.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/snort/</prefix>
<item>https://packages.pfsense.org/packages/config/snort/snort_rules_flowbits.php</item>
Expand Down
11 changes: 3 additions & 8 deletions security/pfSense-pkg-snort/files/usr/local/pkg/snort/snort.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,10 @@

require_once("pfsense-utils.inc");
require_once("config.inc");
require_once("globals.inc");
require_once("functions.inc");
require_once("service-utils.inc");
require_once("pkg-utils.inc");
require_once("filter.inc");
require_once("notices.inc");
require_once("util.inc");
require_once("xmlrpc.inc");
require_once("xmlrpc_client.inc");
require("/usr/local/pkg/snort/snort_defs.inc");

// Snort GUI needs some extra PHP memory space to manipulate large rules arrays
Expand Down Expand Up @@ -819,7 +814,7 @@ function snort_snortloglimit_install_cron($should_install=TRUE) {
// Else install the new or updated cron job by removing the
// existing job first, then installing the new or updated job.
install_cron_job("snort_check_cron_misc.inc", false);
install_cron_job("/usr/bin/nice -n20 /usr/local/bin/php-cgi -f /usr/local/pkg/snort/snort_check_cron_misc.inc", $should_install, "*/5");
install_cron_job("/usr/bin/nice -n20 /usr/local/bin/php -f /usr/local/pkg/snort/snort_check_cron_misc.inc", $should_install, "*/5");
}

function snort_rm_blocked_install_cron($should_install) {
Expand Down Expand Up @@ -1008,7 +1003,7 @@ function snort_rules_up_install_cron($should_install) {
}

// Construct the basic cron command task
$command = "/usr/bin/nice -n20 /usr/local/bin/php-cgi -f /usr/local/pkg/snort/snort_check_for_rule_updates.php";
$command = "/usr/bin/nice -n20 /usr/local/bin/php -f /usr/local/pkg/snort/snort_check_for_rule_updates.php";

// If there are no changes in the cron job command string from the existing job, then exit
if (snort_cron_job_exists($command, TRUE, $snort_rules_up_min, $snort_rules_up_hr, $snort_rules_up_mday, $snort_rules_up_month, $snort_rules_up_wday, "root"))
Expand Down Expand Up @@ -4034,7 +4029,7 @@ EOD;
/* Now assemble a command to execute the */
/* previously sent PHP file in the background. */
/*************************************************/
$execcmd = "exec(\"/usr/local/bin/php-cgi -f '/tmp/snort_sync_cmds.php' > /dev/null 2>&1 &\");";
$execcmd = "exec(\"/usr/local/bin/php -f '/tmp/snort_sync_cmds.php' > /dev/null 2>&1 &\");";
$params2 = array(
XML_RPC_encode($password),
XML_RPC_encode($execcmd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ global $g, $config;

/* Define some useful constants for Snort */
if (!defined("SNORT_PBI_BASEDIR")) {
$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
if ($pf_version == "2.1" || $pf_version == "2.2")
define("SNORT_PBI_BASEDIR", "/usr/pbi/snort-" . php_uname("m") . "/");
else
define("SNORT_PBI_BASEDIR", "/usr/local/");
define("SNORT_PBI_BASEDIR", "/usr/local/");
}
if (!defined("SNORT_PBI_BINDIR"))
define("SNORT_PBI_BINDIR", SNORT_PBI_BASEDIR . "bin/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
</copyright>
<description>Snort: XMLRPC Sync</description>
<name>snortsync</name>
<version>3.2.6</version>
<title>Snort: XMLRPC Sync</title>
<include_file>/usr/local/pkg/snort/snort.inc</include_file>
<tabs>
Expand Down Expand Up @@ -171,11 +172,11 @@
</options>
</rowhelperfield>
<rowhelperfield>
<fielddescr>IP Address/Hostname</fielddescr>
<fielddescr>IP-Address</fielddescr>
<fieldname>varsyncipaddress</fieldname>
<description><![CDATA[IP address or hostname of the destination host.]]></description>
<description><![CDATA[IP Address of the destination host.]]></description>
<type>input</type>
<size>40</size>
<size>15</size>
</rowhelperfield>
<rowhelperfield>
<fielddescr>Port</fielddescr>
Expand All @@ -201,6 +202,8 @@
</rowhelper>
</field>
</fields>
<custom_delete_php_command>
</custom_delete_php_command>
<custom_php_resync_config_command>
write_config("Snort pkg: saved changes to XMLRPC sync configuration.");snort_sync_on_changes();
</custom_php_resync_config_command>
Expand Down
Loading

0 comments on commit e942b8c

Please sign in to comment.