From 3741dae76ea2aa19e478fac55e75acc663007eb7 Mon Sep 17 00:00:00 2001 From: robiscool Date: Tue, 16 Mar 2010 23:37:56 -0700 Subject: snort-dev, update paths, update rules. --- config/snort-dev/snort_interfaces_edit.php | 2 +- config/snort-dev/snort_rules.php | 8 +++++--- config/snort-dev/snort_rulesets.php | 17 ++++++++++++----- 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'config/snort-dev') diff --git a/config/snort-dev/snort_interfaces_edit.php b/config/snort-dev/snort_interfaces_edit.php index 45580d11..f91f56eb 100644 --- a/config/snort-dev/snort_interfaces_edit.php +++ b/config/snort-dev/snort_interfaces_edit.php @@ -444,7 +444,7 @@ if ($a_nat[$id]['interface'] != '') { $tab_array = array(); $tab_array[] = array("Snort Interfaces", false, "/snort/snort_interfaces.php"); $tab_array[] = array("If Settings", true, "/snort/snort_interfaces_edit.php?id={$id}"); - $tab_array[] = array("Conf upload", false, "/snort/snort_conf_upload.php?id={$id}"); + //$tab_array[] = array("upload", false, "/snort/snort_conf_upload.php?id={$id}"); $tab_array[] = array("Categories", false, "/snort/snort_rulesets.php?id={$id}"); $tab_array[] = array("Rules", false, "/snort/snort_rules.php?id={$id}"); $tab_array[] = array("Servers", false, "/snort/snort_define_servers.php?id={$id}"); diff --git a/config/snort-dev/snort_rules.php b/config/snort-dev/snort_rules.php index 7a5a0cce..99e932b7 100644 --- a/config/snort-dev/snort_rules.php +++ b/config/snort-dev/snort_rules.php @@ -53,12 +53,14 @@ if (isset($id) && $a_nat[$id]) { /* convert fake interfaces to real */ $if_real = convert_friendly_interface_to_real_interface_name($pconfig['interface']); +$iface_uuid = $a_nat[$id]['uuid']; + // if(!is_dir("/usr/local/etc/snort/rules")) // exec('mkdir /usr/local/etc/snort/rules/'); /* Check if the rules dir is empy if so warn the user */ /* TODO give the user the option to delete the installed rules rules */ -$isrulesfolderempty = exec("ls -A /usr/local/etc/snort/snort_{$id}{$if_real}/rules/*.rules"); +$isrulesfolderempty = exec("ls -A /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/*.rules"); if ($isrulesfolderempty == "") { include("head.inc"); @@ -166,7 +168,7 @@ function load_rule_file($incoming_file) } -$ruledir = "/usr/local/etc/snort/snort_{$id}{$if_real}/rules/"; +$ruledir = "/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/"; $dh = opendir($ruledir); if ($_GET['openruleset'] != '' && $_GET['ids'] != '') @@ -404,7 +406,7 @@ $ifname = strtoupper($pconfig['interface']); require("guiconfig.inc"); include("head.inc"); -$pgtitle = "Snort: Interface $id$if_real Rule Category: $currentruleset"; +$pgtitle = "Snort: $id $iface_uuid $if_real Category: $currentruleset"; ?> diff --git a/config/snort-dev/snort_rulesets.php b/config/snort-dev/snort_rulesets.php index 3c99e608..dc3320fe 100644 --- a/config/snort-dev/snort_rulesets.php +++ b/config/snort-dev/snort_rulesets.php @@ -33,7 +33,7 @@ require_once("filter.inc"); require_once("service-utils.inc"); include_once("/usr/local/pkg/snort/snort.inc"); -$pgtitle = "Snort: Interface $id$if_real Categories"; + if (!is_array($config['installedpackages']['snortglobal']['rule'])) { $config['installedpackages']['snortglobal']['rule'] = array(); @@ -60,9 +60,16 @@ $if_real = convert_friendly_interface_to_real_interface_name($pconfig['interface //if(!is_dir("/usr/local/etc/snort/rules")) // exec('mkdir /usr/local/etc/snort/rules/'); +$iface_uuid = $a_nat[$id]['uuid']; + +$pgtitle = "Snort: Interface $id $iface_uuid $if_real Categories"; + + + + /* Check if the rules dir is empy if so warn the user */ /* TODO give the user the option to delete the installed rules rules */ -$isrulesfolderempty = exec("ls -A /usr/local/etc/snort/snort_{$id}{$if_real}/rules/*.rules"); +$isrulesfolderempty = exec("ls -A /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/*.rules"); if ($isrulesfolderempty == "") { include("head.inc"); @@ -98,7 +105,7 @@ echo "\n \n \n \n \n
\n -# The rules directory is empty. /usr/local/etc/snort/snort_{$id}{$if_real}/rules \n +# The rules directory is empty. /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules \n
\n @@ -192,7 +199,7 @@ echo "
Description --> "; echo ""; echo ""; - echo "{$file}"; + echo "{$file}"; echo ""; //echo ""; //echo "description"; -- cgit v1.2.3