From 0f4ea6c032de0d287d9a1620abbe32c59d557ab4 Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 3 Aug 2011 18:21:20 +0000 Subject: Fixes for whitelists and suppress generation. --- config/snort/snort.inc | 4 +- config/snort/snort_interfaces_edit.php | 112 +++++++++++++-------------------- 2 files changed, 46 insertions(+), 70 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 7a5a4ffb..79d4cde8 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -520,7 +520,7 @@ function snort_postinstall() if (!is_dir('/usr/local/etc/snort')) exec('/bin/mkdir -p /usr/local/etc/snort/custom_rules'); - if (!file_exists('/usr/local/etc/snort/whitelist')) + if (!is_dir('/usr/local/etc/snort/whitelist')) exec('/bin/mkdir -p /usr/local/etc/snort/whitelist/'); if (!is_dir('/var/log/snort/run')) @@ -1151,8 +1151,6 @@ function create_snort_suppress($id, $if_real) { if ($config['installedpackages']['snortglobal']['rule'][$id]['suppresslistname'] != 'default') { $whitelist_key_s = find_suppress_key($config['installedpackages']['snortglobal']['rule'][$id]['suppresslistname']); - if (empty($whitelist_key_s)) - return ""; /* file name */ $suppress_file_name = $config['installedpackages']['snortglobal']['suppress']['item'][$whitelist_key_s]['name']; diff --git a/config/snort/snort_interfaces_edit.php b/config/snort/snort_interfaces_edit.php index 019a8af0..667f3571 100644 --- a/config/snort/snort_interfaces_edit.php +++ b/config/snort/snort_interfaces_edit.php @@ -537,30 +537,24 @@ function enable_change(enable_change) {
Choose the home net you will like this rule to - use.  Note: Default home + use.  
Note: Default home net adds only local networks.
Hint: Most users add a list of friendly ips that the firewall cant see. @@ -570,31 +564,24 @@ function enable_change(enable_change) {
+
Choose the external net you will like this rule - to use.  Note: Default + to use.  
Note: Default external net, networks that are not home net.
Hint: Most users should leave this setting at default. @@ -610,46 +597,37 @@ function enable_change(enable_change) { Whitelist - default - "; - foreach ($wlist_select as $value): - $wid += 1; - if ($config['installedpackages']['snortglobal']['whitelist']['item'][$wid]['snortlisttype'] == 'whitelist') { - $ilistname = $config['installedpackages']['snortglobal']['whitelist']['item'][$wid]['name']; - $whitelist_uuid = $config['installedpackages']['snortglobal']['whitelist']['item'][$wid]['uuid']; - if ($ilistname == $wlist_sub[0]){ - echo "\n"; + if (is_array($config['installedpackages']['snortglobal']['whitelist']['item'])) { + foreach ($config['installedpackages']['snortglobal']['whitelist']['item'] as $value) { + if ($value['snortlisttype'] == 'whitelist') { + if ($value['name'] == $pconfig['whitelist']) + echo "'; + } } - echo htmlspecialchars($ilistname) . ' - '; } - endforeach; ?>
Choose the whitelist you will like this rule to - use.  Note: Default - whitelist adds only local networks. + use.  
Note: Default + whitelist adds only local networks.
+ Note: This option will only be used when block offenders is on. + - Suppression and filtering - default"; + echo "\n"; if (is_array($config['installedpackages']['snortglobal']['suppress']['item'])) { $slist_select = $config['installedpackages']['snortglobal']['suppress']['item']; foreach ($slist_select as $value) { @@ -664,7 +642,7 @@ function enable_change(enable_change) { ?>
Choose the suppression or filtering file you - will like this rule to use.  Note: Default + will like this rule to use.  
Note: Default option disables suppression and filtering. -- cgit v1.2.3