aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_migrate_config.php
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2014-01-27 20:24:52 -0500
committerbmeeks8 <bmeeks8@bellsouth.net>2014-01-27 20:24:52 -0500
commit03ac95899a4c7f4e883fbddd29296c442787ac47 (patch)
treef6e8a67a77a5298a4912f7be61f7e23d654af51f /config/snort/snort_migrate_config.php
parent9284e7398d6f6f3a1a3f12748f52fcc51331768c (diff)
downloadpfsense-packages-03ac95899a4c7f4e883fbddd29296c442787ac47.tar.gz
pfsense-packages-03ac95899a4c7f4e883fbddd29296c442787ac47.tar.bz2
pfsense-packages-03ac95899a4c7f4e883fbddd29296c442787ac47.zip
Add enable/disable for decoder & preproc rules
Diffstat (limited to 'config/snort/snort_migrate_config.php')
-rw-r--r--config/snort/snort_migrate_config.php38
1 files changed, 36 insertions, 2 deletions
diff --git a/config/snort/snort_migrate_config.php b/config/snort/snort_migrate_config.php
index 61989e99..1a812b24 100644
--- a/config/snort/snort_migrate_config.php
+++ b/config/snort/snort_migrate_config.php
@@ -1,8 +1,8 @@
<?php
/*
- * snort_migrate_config.inc
+ * snort_migrate_config.php
*
- * Copyright (C) 2013 Bill Meeks
+ * Copyright (C) 2013, 2014 Bill Meeks
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -288,6 +288,40 @@ foreach ($rule as &$r) {
}
}
+ // Change any ENABLE_SID settings to new format of GID:SID
+ if (!empty($pconfig['rule_sid_on'])) {
+ $tmp = explode("||", $pconfig['rule_sid_on']);
+ $new_tmp = "";
+ foreach ($tmp as $v) {
+ if (strpos($v, ":") === false) {
+ if (preg_match('/(\d+)/', $v, $match))
+ $new_tmp .= "1:{$match[1]}||";
+ }
+ }
+ $new_tmp = rtrim($new_tmp, " ||");
+ if (!empty($new_tmp)) {
+ $pconfig['rule_sid_on'] = $new_tmp;
+ $updated_cfg = true;
+ }
+ }
+
+ // Change any DISABLE_SID settings to new format of GID:SID
+ if (!empty($pconfig['rule_sid_off'])) {
+ $tmp = explode("||", $pconfig['rule_sid_off']);
+ $new_tmp = "";
+ foreach ($tmp as $v) {
+ if (strpos($v, ":") === false) {
+ if (preg_match('/(\d+)/', $v, $match))
+ $new_tmp .= "1:{$match[1]}||";
+ }
+ }
+ $new_tmp = rtrim($new_tmp, " ||");
+ if (!empty($new_tmp)) {
+ $pconfig['rule_sid_off'] = $new_tmp;
+ $updated_cfg = true;
+ }
+ }
+
// Save the new configuration data into the $config array pointer
$r = $pconfig;
}