From d952d1ee53bae2150c789fe86ee6673eb0c6d262 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Wed, 17 Sep 2014 20:49:00 -0400 Subject: Use Snort description for service descr or friendly descr otherwise. --- config/snort/snort_post_install.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'config/snort/snort_post_install.php') diff --git a/config/snort/snort_post_install.php b/config/snort/snort_post_install.php index 5c47e151..ece75f2b 100644 --- a/config/snort/snort_post_install.php +++ b/config/snort/snort_post_install.php @@ -229,18 +229,21 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') { $barnyard_found = FALSE; foreach ($config['installedpackages']['service'] as $service) { if (isset($service['uuid']) && $service['uuid'] == $snortcfg['uuid'] && - $service['name'] == "snort_" . strtolower(convert_friendly_interface_to_friendly_descr($snortcfg['interface']))) { + $service['name'] == "snort_" . strtolower($snortcfg['interface'])) { $snort_found = TRUE; } if (isset($service['uuid']) && $service['uuid'] == $snortcfg['uuid'] && - $service['name'] == "barnyard2_" . strtolower(convert_friendly_interface_to_friendly_descr($snortcfg['interface']))) { + $service['name'] == "barnyard2_" . strtolower($snortcfg['interface'])) { $barnyard_found = TRUE; } } if (!$snort_found) { $service = array(); - $service['name'] = "snort_" . strtolower(convert_friendly_interface_to_friendly_descr($snortcfg['interface'])); - $service['description'] = "Snort IDS/IPS - " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']); + $service['name'] = "snort_" . strtolower($snortcfg['interface']); + if (!empty($snortcfg['descr'])) + $service['description'] = "Snort IDS - " . $snortcfg['descr']; + else + $service['description'] = "Snort IDS - " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']); $service['uuid'] = $snortcfg['uuid']; $service['startcmd'] = "\$action='start';\$service='snort';\$uuid={$snortcfg['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';"; $service['stopcmd'] = "\$action='stop';\$service='snort';\$uuid={$snortcfg['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';"; @@ -251,8 +254,11 @@ if ($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') { } if (!$barnyard_found && $snortcfg['barnyard_enable'] == 'on') { $service = array(); - $service['name'] = "barnyard2_" . strtolower(convert_friendly_interface_to_friendly_descr($snortcfg['interface'])); - $service['description'] = "Barnyard2 Logging - " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']); + $service['name'] = "barnyard2_" . strtolower($snortcfg['interface']); + if (!empty($snortcfg['descr'])) + $service['description'] = "Barnyard2 Logging - " . $snortcfg['descr']; + else + $service['description'] = "Barnyard2 Logging - " . convert_friendly_interface_to_friendly_descr($snortcfg['interface']); $service['uuid'] = $snortcfg['uuid']; $service['startcmd'] = "\$action='start';\$service='barnyard2';\$uuid={$snortcfg['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';"; $service['stopcmd'] = "\$action='stop';\$service='barnyard2';\$uuid={$snortcfg['uuid']};\$rc = include '/usr/local/pkg/snort/snort_service_utils.php';"; -- cgit v1.2.3