aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort-dev
diff options
context:
space:
mode:
Diffstat (limited to 'config/snort-dev')
-rw-r--r--config/snort-dev/pfsense_rules/local.rules7
-rw-r--r--config/snort-dev/snort.inc28
-rw-r--r--config/snort-dev/snort.xml1
-rw-r--r--config/snort-dev/snort_rules.php2
4 files changed, 11 insertions, 27 deletions
diff --git a/config/snort-dev/pfsense_rules/local.rules b/config/snort-dev/pfsense_rules/local.rules
new file mode 100644
index 00000000..a9072733
--- /dev/null
+++ b/config/snort-dev/pfsense_rules/local.rules
@@ -0,0 +1,7 @@
+# ----------------
+# LOCAL RULES
+# ----------------
+# This file intentionally does not come with signatures. Put your local
+# additions here. Pfsense first install rule. Rule edit tabe fails with out this file.
+#
+# \ No newline at end of file
diff --git a/config/snort-dev/snort.inc b/config/snort-dev/snort.inc
index f09f2804..3f8ccc79 100644
--- a/config/snort-dev/snort.inc
+++ b/config/snort-dev/snort.inc
@@ -64,7 +64,7 @@ function sync_package_snort_install() {
exec("/bin/mkdir -p /var/log/snort");
exec("/bin/mkdir -p /usr/local/etc/snort/rules");
- if(file_exists("/usr/local/etc/snort/unicode.map-sample")) {
+ if(!file_exists("/usr/local/etc/snort/unicode.map-sample"))
exec("/bin/cp /usr/local/etc/snort/unicode.map-sample /usr/local/etc/snort/unicode.map");
exec("/bin/cp /usr/local/etc/snort/classification.config-sample /usr/local/etc/snort/classification.config");
exec("/bin/cp /usr/local/etc/snort/gen-msg.map-sample /usr/local/etc/snort/gen-msg.map");
@@ -76,7 +76,6 @@ function sync_package_snort_install() {
exec("/bin/cp /usr/local/etc/snort/unicode.map-sample /usr/local/etc/snort/unicode.map");
exec("/bin/rm -f /usr/local/etc/rc.d/snort");
exec("/bin/rm /usr/local/lib/snort/dynamicrules/*");
- }
if(!file_exists("/usr/local/etc/snort/rules/local.rules"))
exec("/bin/cp /usr/local/pkg/local.rules /usr/local/etc/snort/rules/local.rules");
@@ -85,30 +84,7 @@ function sync_package_snort_install() {
function sync_package_snort()
{
- global $config, $g;
-
- /* create a few directories and ensure the sample files are in place */
- exec("/bin/mkdir -p /usr/local/etc/snort_bkup");
- exec("/bin/mkdir -p /usr/local/etc/snort");
- exec("/bin/mkdir -p /var/log/snort");
- exec("/bin/mkdir -p /usr/local/etc/snort/rules");
-
- if(file_exists("/usr/local/etc/snort/unicode.map-sample")) {
- exec("/bin/cp /usr/local/etc/snort/unicode.map-sample /usr/local/etc/snort/unicode.map");
- exec("/bin/cp /usr/local/etc/snort/classification.config-sample /usr/local/etc/snort/classification.config");
- exec("/bin/cp /usr/local/etc/snort/gen-msg.map-sample /usr/local/etc/snort/gen-msg.map");
- exec("/bin/cp /usr/local/etc/snort/generators-sample /usr/local/etc/snort/generators");
- exec("/bin/cp /usr/local/etc/snort/reference.config-sample /usr/local/etc/snort/reference.config");
- exec("/bin/cp /usr/local/etc/snort/sid-msg.map-sample /usr/local/etc/snort/sid-msg.map");
- exec("/bin/cp /usr/local/etc/snort/sid-sample /usr/local/etc/snort/sid");
- exec("/bin/cp /usr/local/etc/snort/threshold.conf-sample /usr/local/etc/snort/threshold.conf");
- exec("/bin/cp /usr/local/etc/snort/unicode.map-sample /usr/local/etc/snort/unicode.map");
- exec("/bin/rm -f /usr/local/etc/rc.d/snort");
- exec("/bin/rm /usr/local/lib/snort/dynamicrules/*");
- }
-
- if(!file_exists("/usr/local/etc/snort/rules/local.rules"))
- exec("/bin/cp /usr/local/pkg/local.rules /usr/local/etc/snort/rules/local.rules");
+ global $config, $g;
if(!file_exists("/var/log/snort/alert"))
touch("/var/log/snort/alert");
diff --git a/config/snort-dev/snort.xml b/config/snort-dev/snort.xml
index fdefc809..56da6e17 100644
--- a/config/snort-dev/snort.xml
+++ b/config/snort-dev/snort.xml
@@ -367,6 +367,7 @@
<custom_add_php_command>
</custom_add_php_command>
<custom_php_resync_config_command>
+ sync_package_snort_install();
sync_package_snort();
</custom_php_resync_config_command>
<custom_php_install_command>
diff --git a/config/snort-dev/snort_rules.php b/config/snort-dev/snort_rules.php
index 76413727..0ce9ca0d 100644
--- a/config/snort-dev/snort_rules.php
+++ b/config/snort-dev/snort_rules.php
@@ -29,7 +29,7 @@
require("guiconfig.inc");
if(!is_dir("/usr/local/etc/snort/rules"))
- Header("Location: snort_download_rules.php");
+ header("Location: snort_rules.php", false);
function get_middle($source, $beginning, $ending, $init_pos) {
$beginning_pos = strpos($source, $beginning, $init_pos);