From 7a5feaaebb67f6c54695b24bdf4541a3727508e2 Mon Sep 17 00:00:00 2001 From: robiscool Date: Fri, 29 Jul 2011 15:45:42 -0700 Subject: snort-dev, finish ips gui for main tabs, update function create ips sid --- config/snort-dev/css/style_snort2.css | 39 ++++++------ config/snort-dev/snort_barnyard.php | 1 + config/snort-dev/snort_define_servers.php | 1 + config/snort-dev/snort_interfaces_edit.php | 1 + config/snort-dev/snort_interfaces_rules_edit.php | 5 +- config/snort-dev/snort_json_post.php | 20 ++++-- config/snort-dev/snort_preprocessors.php | 1 + config/snort-dev/snort_rules.php | 2 + config/snort-dev/snort_rules_ips.php | 81 ++++++++++++++++++------ config/snort-dev/snort_rulesets.php | 4 +- 10 files changed, 107 insertions(+), 48 deletions(-) (limited to 'config/snort-dev') diff --git a/config/snort-dev/css/style_snort2.css b/config/snort-dev/css/style_snort2.css index 942f3723..bd5383f4 100644 --- a/config/snort-dev/css/style_snort2.css +++ b/config/snort-dev/css/style_snort2.css @@ -1,13 +1,14 @@ @charset "utf-8"; -/* -a { - font-size: 11px; -} -*/ /* ips tab css */ +#infotext_ips { + + vertical-align: middle; + +} + .nextClickList { margin-bottom: 5px; } @@ -86,27 +87,27 @@ a { .odd_ruleset { - background-color: #eeeeee; - border-bottom-width: 1px; - border-bottom-style: solid; - border-bottom-color: #000; - border-right-width: 1px; - border-right-style: solid; - border-right-color: #000; + background-color: #ffffff; + border-left: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 14px; + padding-right: 2px; padding-left: 20px; + padding-top: 2px; + padding-bottom: 2px; } .even_ruleset { - background-color: #ffffff; - border-bottom-width: 1px; - border-bottom-style: solid; - border-bottom-color: #000; - border-right-width: 1px; - border-right-style: solid; - border-right-color: #000; + background-color: #eeeeee; + border-left: 1px solid #999999; + border-bottom: 1px solid #999999; + font-size: 14px; + padding-right: 2px; padding-left: 20px; + padding-top: 2px; + padding-bottom: 2px; } diff --git a/config/snort-dev/snort_barnyard.php b/config/snort-dev/snort_barnyard.php index 711dd8bd..5a40584b 100644 --- a/config/snort-dev/snort_barnyard.php +++ b/config/snort-dev/snort_barnyard.php @@ -173,6 +173,7 @@ jQuery(document).ready(function() {
  • If Settings
  • Categories
  • Rules
  • +
  • Ruleset Ips
  • Servers
  • Preprocessors
  • Barnyard2
  • diff --git a/config/snort-dev/snort_define_servers.php b/config/snort-dev/snort_define_servers.php index 948f769b..c35fd2c1 100644 --- a/config/snort-dev/snort_define_servers.php +++ b/config/snort-dev/snort_define_servers.php @@ -103,6 +103,7 @@ $a_list = snortSql_fetchAllSettings('snortDB', 'SnortIfaces', 'uuid', $uuid);
  • If Settings
  • Categories
  • Rules
  • +
  • Ruleset Ips
  • Servers
  • Preprocessors
  • Barnyard2
  • diff --git a/config/snort-dev/snort_interfaces_edit.php b/config/snort-dev/snort_interfaces_edit.php index 7d710fe5..86cd6857 100644 --- a/config/snort-dev/snort_interfaces_edit.php +++ b/config/snort-dev/snort_interfaces_edit.php @@ -198,6 +198,7 @@ jQuery(document).ready(function() {
  • If Settings
  • Categories
  • Rules
  • +
  • Ruleset Ips
  • Servers
  • Preprocessors
  • Barnyard2
  • diff --git a/config/snort-dev/snort_interfaces_rules_edit.php b/config/snort-dev/snort_interfaces_rules_edit.php index 6cc7dbb0..8106ba06 100644 --- a/config/snort-dev/snort_interfaces_rules_edit.php +++ b/config/snort-dev/snort_interfaces_rules_edit.php @@ -185,8 +185,9 @@ jQuery(document).ready(function() {
    diff --git a/config/snort-dev/snort_json_post.php b/config/snort-dev/snort_json_post.php index ee9d9ead..721ee0cc 100644 --- a/config/snort-dev/snort_json_post.php +++ b/config/snort-dev/snort_json_post.php @@ -66,12 +66,22 @@ function snortJsonReturnCode($returnStatus) if ($_POST['snortSamSaveSettings'] == 1) { unset($_POST['snortSamSaveSettings']); - - function snortSamSaveFunc() - { - print_r($_POST[snortsam][db]); + + if ($_POST['ifaceTab'] === 'snort_rulesets_ips') { + function snortSamSaveFunc() + { + print_r($_POST); + } + snortSamSaveFunc(); } - snortSamSaveFunc(); + + if ($_POST['ifaceTab'] === 'snort_rules_ips') { + function snortSamSaveFunc() + { + print_r($_POST); + } + snortSamSaveFunc(); + } } diff --git a/config/snort-dev/snort_preprocessors.php b/config/snort-dev/snort_preprocessors.php index ad61afe0..78863b35 100644 --- a/config/snort-dev/snort_preprocessors.php +++ b/config/snort-dev/snort_preprocessors.php @@ -102,6 +102,7 @@ $a_list = snortSql_fetchAllSettings('snortDB', 'SnortIfaces', 'uuid', $uuid);
  • If Settings
  • Categories
  • Rules
  • +
  • Ruleset Ips
  • Servers
  • Preprocessors
  • Barnyard2
  • diff --git a/config/snort-dev/snort_rules.php b/config/snort-dev/snort_rules.php index 4e8ba460..78134d52 100644 --- a/config/snort-dev/snort_rules.php +++ b/config/snort-dev/snort_rules.php @@ -228,6 +228,7 @@ function load_rule_file($incoming_file, $splitcontents)
  • If Settings
  • Categories
  • Rules
  • +
  • Ruleset Ips
  • Servers
  • Preprocessors
  • Barnyard2
  • @@ -262,6 +263,7 @@ function load_rule_file($incoming_file, $splitcontents)
  • Rules DB Edit
  • Categories
  • Rules
  • +
  • Ruleset Ips
  • diff --git a/config/snort-dev/snort_rules_ips.php b/config/snort-dev/snort_rules_ips.php index a7c845da..ce14bf30 100644 --- a/config/snort-dev/snort_rules_ips.php +++ b/config/snort-dev/snort_rules_ips.php @@ -90,24 +90,60 @@ if (isset($_GET['rulefilename'])) {
    - - + + '; + }else{ + echo ' + + - +
  • Global Settings
  • +
  • Updates
  • +
  • RulesDB
  • +
  • Alerts
  • +
  • Blocked
  • +
  • Whitelists
  • +
  • Suppress
  • +
  • Help
  • + + + + + + + + '; + } + ?>
    - -
    -
      + +
    + +
    + - -
    + +
    @@ -222,12 +258,15 @@ jQuery(document).ready(function() { return false; } - - exec('rm /usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/rules/dbBlockSplit/*.rules'); - exec('cp /usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/rules/' . $rulefilename . ' ' . '/usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/rules/dbBlockSplit/' . $rulefilename); + if (!file_exists('/usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/dbBlockSplit')) { + exec('mkdir /usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/dbBlockSplit'); + } + + exec('rm /usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/dbBlockSplit/*.rules'); + exec('cp /usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/rules/' . $rulefilename . ' ' . '/usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/dbBlockSplit/' . $rulefilename); //$getEnableSidArray = ''; - exec('perl /usr/local/bin/make_snortsam_map.pl /usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/rules/dbBlockSplit/', $getEnableSidArray); + exec('perl /usr/local/bin/make_snortsam_map.pl /usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/dbBlockSplit/', $getEnableSidArray); return getSidBlockJsonArray(getCurrentIpsRuleArray($getEnableSidArray)); diff --git a/config/snort-dev/snort_rulesets.php b/config/snort-dev/snort_rulesets.php index d006c481..3935d49a 100644 --- a/config/snort-dev/snort_rulesets.php +++ b/config/snort-dev/snort_rulesets.php @@ -210,6 +210,7 @@ jQuery(document).ready(function() {
  • If Settings
  • Categories
  • Rules
  • +
  • Ruleset Ips
  • Servers
  • Preprocessors
  • Barnyard2
  • @@ -244,6 +245,7 @@ jQuery(document).ready(function() {
  • Rules DB Edit
  • Categories
  • Rules
  • +
  • Ruleset Ips
  • @@ -272,7 +274,7 @@ jQuery(document).ready(function() {
    -
    +
    -- cgit v1.2.3