From bf081ef5f597ddd5a94477592ff9e1956707de3c Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 2 Aug 2011 18:31:02 +0000 Subject: Fix snort updates fetching. --- config/snort/snort_rules.php | 125 ++++++++++++++++++++++--------------------- 1 file changed, 65 insertions(+), 60 deletions(-) (limited to 'config/snort/snort_rules.php') diff --git a/config/snort/snort_rules.php b/config/snort/snort_rules.php index 27fb1149..dad21605 100644 --- a/config/snort/snort_rules.php +++ b/config/snort/snort_rules.php @@ -61,65 +61,69 @@ if (!is_dir("/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules")) $isrulesfolderempty = exec("ls -A /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/*.rules"); if ($isrulesfolderempty == "") { - - include_once("head.inc"); - include_once("fbegin.inc"); - - echo ""; - - if($pfsense_stable == 'yes'){echo '

' . $pgtitle . '

';} - - echo "\n -\n -\n - \n - \n - \n - \n - \n - \n -
\n"; - - $tab_array = array(); - $tabid = 0; - $tab_array[$tabid] = array(gettext("Snort Interfaces"), false, "/snort/snort_interfaces.php"); - $tabid++; - $tab_array[$tabid] = array(gettext("If Settings"), false, "/snort/snort_interfaces_edit.php?id={$id}"); - $tabid++; - $tab_array[$tabid] = array(gettext("Categories"), false, "/snort/snort_rulesets.php?id={$id}"); - $tabid++; - $tab_array[$tabid] = array(gettext("Rules"), true, "/snort/snort_rules.php?id={$id}"); - $tabid++; - $tab_array[$tabid] = array(gettext("Servers"), false, "/snort/snort_define_servers.php?id={$id}"); - $tabid++; - $tab_array[$tabid] = array(gettext("Preprocessors"), false, "/snort/snort_preprocessors.php?id={$id}"); - $tabid++; - $tab_array[$tabid] = array(gettext("Barnyard2"), false, "/snort/snort_barnyard.php?id={$id}"); - display_top_tabs($tab_array); -echo "
\n -
\n - \n - \n - \n - \n -
\n -# The rules directory is empty.\n -
\n -
\n -
\n -\n -\n -\n -

\n\n"; - - echo "Please click on the Update Rules tab to install your selected rule sets."; - include("fend.inc"); - - echo ""; - echo ""; - - exit(0); - + //$isrulesfolderempty = exec("ls -A /usr/local/etc/snort/rules/*.rules"); + //if ($isrulesfolderempty == "") { + include_once("head.inc"); + include_once("fbegin.inc"); + + echo ""; + + if($pfsense_stable == 'yes'){echo '

' . $pgtitle . '

';} + + echo "\n + \n + \n + \n + \n + \n + \n + \n + \n +
\n"; + + $tab_array = array(); + $tabid = 0; + $tab_array[$tabid] = array(gettext("Snort Interfaces"), false, "/snort/snort_interfaces.php"); + $tabid++; + $tab_array[$tabid] = array(gettext("If Settings"), false, "/snort/snort_interfaces_edit.php?id={$id}"); + $tabid++; + $tab_array[$tabid] = array(gettext("Categories"), false, "/snort/snort_rulesets.php?id={$id}"); + $tabid++; + $tab_array[$tabid] = array(gettext("Rules"), true, "/snort/snort_rules.php?id={$id}"); + $tabid++; + $tab_array[$tabid] = array(gettext("Servers"), false, "/snort/snort_define_servers.php?id={$id}"); + $tabid++; + $tab_array[$tabid] = array(gettext("Preprocessors"), false, "/snort/snort_preprocessors.php?id={$id}"); + $tabid++; + $tab_array[$tabid] = array(gettext("Barnyard2"), false, "/snort/snort_barnyard.php?id={$id}"); + display_top_tabs($tab_array); + echo "
\n +
\n + \n + \n + \n + \n +
\n + # The rules directory is empty.\n +
\n +
\n +
\n + \n + \n + \n +

\n\n"; + + echo "Please click on the Update Rules tab to install your selected rule sets."; + include("fend.inc"); + + echo ""; + echo ""; + + exit(0); + //} else { + /* Make sure that we have the rules */ + // mwexec("/bin/cp /usr/local/etc/snort/rules/*.rules /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules", true); + //} } function get_middle($source, $beginning, $ending, $init_pos) { @@ -182,7 +186,8 @@ if ($_GET['openruleset'] != '' && $_GET['ids'] != '') { } */ -$ruledir = "/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/"; +//$ruledir = "/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/"; +$ruledir = "/usr/local/etc/snort/rules/"; $dh = opendir($ruledir); while (false !== ($filename = readdir($dh))) { -- cgit v1.2.3