diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2014-09-17 15:20:53 -0400 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2014-09-17 15:20:53 -0400 |
commit | 69e99bed09652ef93607cc353cafcc99d7e54b2e (patch) | |
tree | ded0bceb5c506c61cb899b230226965d9690557d /config/snort | |
parent | 834c580f3bcfea9b8c23e61fc00a8250cfa0dabf (diff) | |
download | pfsense-packages-69e99bed09652ef93607cc353cafcc99d7e54b2e.tar.gz pfsense-packages-69e99bed09652ef93607cc353cafcc99d7e54b2e.tar.bz2 pfsense-packages-69e99bed09652ef93607cc353cafcc99d7e54b2e.zip |
Rename service entry when moving Snort/BY2 to another interface.
Diffstat (limited to 'config/snort')
-rwxr-xr-x | config/snort/snort_interfaces_edit.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/config/snort/snort_interfaces_edit.php b/config/snort/snort_interfaces_edit.php index aff9b4f7..98e05d82 100755 --- a/config/snort/snort_interfaces_edit.php +++ b/config/snort/snort_interfaces_edit.php @@ -32,7 +32,7 @@ require_once("guiconfig.inc"); require_once("/usr/local/pkg/snort/snort.inc"); -global $g, $rebuild_rules; +global $g, $config, $rebuild_rules; $snortdir = SNORTDIR; $snortlogdir = SNORTLOGDIR; @@ -230,6 +230,19 @@ if ($_POST["save"] && !$input_errors) { } else $snort_start = false; + // Need to rename the service entries when moving instance to another interface + foreach ($config['installedpackages']['service'] as &$service) { + if (isset($service['uuid']) && $service['uuid'] == $a_rule[$id]['uuid'] && + $service['name'] == "snort_" . strtolower(convert_friendly_interface_to_friendly_descr($a_rule[$id]['interface']))) { + $service['name'] = "snort_" . strtolower(convert_friendly_interface_to_friendly_descr($natent['interface'])); + $service['description'] = "Snort IDS/IPS - " . convert_friendly_interface_to_friendly_descr($natent['interface']); + } + if (isset($service['uuid']) && $service['uuid'] == $a_rule[$id]['uuid'] && + $service['name'] == "barnyard2_" . strtolower(convert_friendly_interface_to_friendly_descr($a_rule[$id]['interface']))) { + $service['name'] = "barnyard2_" . strtolower(convert_friendly_interface_to_friendly_descr($natent['interface'])); + $service['description'] = "Barnyard2 Logging - " . convert_friendly_interface_to_friendly_descr($natent['interface']); + } + } @rename("{$snortlogdir}/snort_{$oif_real}{$a_rule[$id]['uuid']}", "{$snortlogdir}/snort_{$if_real}{$a_rule[$id]['uuid']}"); conf_mount_rw(); @rename("{$snortdir}/snort_{$a_rule[$id]['uuid']}_{$oif_real}", "{$snortdir}/snort_{$a_rule[$id]['uuid']}_{$if_real}"); |