diff options
author | robiscool <robrob2626@yahoo.com> | 2011-07-30 14:14:02 -0700 |
---|---|---|
committer | robiscool <robrob2626@yahoo.com> | 2011-07-30 14:14:02 -0700 |
commit | 42ca7a370212d1173809fb164019e1d27efa8f4f (patch) | |
tree | f82969d11a490679ccf7488ff5f1b14db3989797 /config | |
parent | ddac412c976f6f5ffc54a9fbbc247c91df80c4df (diff) | |
download | pfsense-packages-42ca7a370212d1173809fb164019e1d27efa8f4f.tar.gz pfsense-packages-42ca7a370212d1173809fb164019e1d27efa8f4f.tar.bz2 pfsense-packages-42ca7a370212d1173809fb164019e1d27efa8f4f.zip |
snort-dev, update db clean up code add snort_rulesets_ips tab
Diffstat (limited to 'config')
-rw-r--r-- | config/snort-dev/snort_interfaces_rules_edit.php | 6 | ||||
-rw-r--r-- | config/snort-dev/snort_json_post.php | 19 | ||||
-rw-r--r-- | config/snort-dev/snort_new.inc | 198 | ||||
-rw-r--r-- | config/snort-dev/snort_rulesets_ips.php | 387 |
4 files changed, 513 insertions, 97 deletions
diff --git a/config/snort-dev/snort_interfaces_rules_edit.php b/config/snort-dev/snort_interfaces_rules_edit.php index 8106ba06..8c1e7b5f 100644 --- a/config/snort-dev/snort_interfaces_rules_edit.php +++ b/config/snort-dev/snort_interfaces_rules_edit.php @@ -185,9 +185,9 @@ jQuery(document).ready(function() { <div class="newtabmenu" style="margin: 1px 0px; width: 775px;"><!-- Tabbed bar code--> <ul class="newtabmenu"> <li class="newtabmenu_active"><a href="/snort/snort_interfaces_rules_edit.php?rdbuuid=<?=$rdbuuid;?>"><span>Rules DB Edit</span></a></li> - <li><a href="/snort/snort_rulesets.php?rdbuuid=<?=$rdbuuid;?>"><span>Categories</span></a></li> - <li><a href="/snort/snort_rules.php?rdbuuid=<?=$rdbuuid;?>"><span>Rules</span></a></li> - <li><a href="/snort/snort_rulesets_ips.php?rdbuuid=<?=$rdbuuid;?>"><span>Ruleset Ips</span></a></li> + <li class="hide_newtabmenu"><a href="/snort/snort_rulesets.php?rdbuuid=<?=$rdbuuid;?>"><span>Categories</span></a></li> + <li class="hide_newtabmenu"><a href="/snort/snort_rules.php?rdbuuid=<?=$rdbuuid;?>"><span>Rules</span></a></li> + <li class="hide_newtabmenu"><a href="/snort/snort_rulesets_ips.php?rdbuuid=<?=$rdbuuid;?>"><span>Ruleset Ips</span></a></li> </ul> </div> </td> diff --git a/config/snort-dev/snort_json_post.php b/config/snort-dev/snort_json_post.php index 721ee0cc..11b055c1 100644 --- a/config/snort-dev/snort_json_post.php +++ b/config/snort-dev/snort_json_post.php @@ -103,7 +103,7 @@ if ($_POST['snortSidRuleEdit'] == 1) { // row from db by uuid if ($_POST['snortSaveRuleSets'] == 1) { - if ($_POST['ifaceTab'] == 'snort_rulesets') { + if ($_POST['ifaceTab'] == 'snort_rulesets' || $_POST['ifaceTab'] == 'snort_rulesets_ips') { function snortSaveRuleSetsRulesetsFunc() { @@ -111,8 +111,13 @@ if ($_POST['snortSaveRuleSets'] == 1) { unset($_POST['snortSaveRuleSets']); unset($_POST['ifaceTab']); - snortJsonReturnCode(snortSql_updateRuleSetList()); - build_snort_settings($_POST['uuid']); + // save to database + snortJsonReturnCode(snortSql_updateRuleSetList()); + + // only build if uuid is valid + if (!empty($_POST['uuid'])) { + build_snort_settings($_POST['uuid']); + } } snortSaveRuleSetsRulesetsFunc(); } @@ -151,8 +156,14 @@ if ($_POST['RMlistDelRow'] == 1) { // rm ruledb and files if ($_POST['RMlistTable'] == 'Snortrules') { - $snortRuleDir = "/usr/local/etc/snort/snortDBrules/DB/{$_POST['RMlistUuid']}"; + // remove db tables vals + snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSets', 'rdbuuid', $_POST['RMlistUuid']); + snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleGenIps', 'rdbuuid', $_POST['RMlistUuid']); + snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSetsIps', 'rdbuuid', $_POST['RMlistUuid']); + snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSigs', 'rdbuuid', $_POST['RMlistUuid']); + // remove dir + $snortRuleDir = "/usr/local/etc/snort/snortDBrules/DB/{$_POST['RMlistUuid']}"; exec('/bin/rm -r ' . $snortRuleDir); } diff --git a/config/snort-dev/snort_new.inc b/config/snort-dev/snort_new.inc index 0f6a505f..510185b4 100644 --- a/config/snort-dev/snort_new.inc +++ b/config/snort-dev/snort_new.inc @@ -400,83 +400,115 @@ function snortSql_updateRuleSigList() function snortSql_updateRuleSetList() { - $dbname = $_POST['dbName']; - $table = $_POST['dbTable']; - $ruleSetfilenames = $_POST['filenamcheckbox']; - $rdbuuid = $_POST['rdbuuid']; + function createUpdateRulesetTable() + { + + $addDate = date(U); - $addDate = date(U); - - // dont let user pick the DB path - $db = sqlite_open("/usr/local/pkg/snort/{$dbname}"); - - if (empty($ruleSetfilenames)) { - $ruleSetfilenames = array(); - } + // dont let user pick the DB path + $db = sqlite_open("/usr/local/pkg/snort/{$_POST['dbName']}"); + + if (empty($_POST['filenamcheckbox'])) { + $ruleSetfilenames = array(); + } + + // foreach selected rulesets do this + if (!empty($_POST['filenamcheckbox'])) { + foreach ($_POST['filenamcheckbox'] as $ruleSetfilename) + { + + $resultid = sqlite_query($db, + "SELECT id, enable FROM {$_POST['dbTable']} WHERE rulesetname = '{$ruleSetfilename}' and rdbuuid = '{$_POST['rdbuuid']}'; + "); + + $chktable = sqlite_fetch_all($resultid, SQLITE_ASSOC); + + if (empty($chktable)) { + + $rulesetUuid = genAlphaNumMixFast(11, 14); + + $query_ck = sqlite_query($db, // @ supress warnings usonly in production + "INSERT INTO {$_POST['dbTable']} (date, uuid, rdbuuid, rulesetname, enable) VALUES ('{$addDate}', '{$rulesetUuid}', '{$_POST['rdbuuid']}', '{$ruleSetfilename}', 'on'); + "); + + }else{ + if ($chktable[0]['enable'] == 'off') { + $query_ck = sqlite_query($db, // @ supress warnings usonly in production + "UPDATE {$_POST['dbTable']} SET enable = 'on' WHERE id = '{$chktable[0]['id']}'; + "); + } + } + } + } // end foreach if + + + // clean database of old names and turn rulesets off + $listDir = snortScanDirFilter("/usr/local/etc/snort/snortDBrules/DB/{$_POST['rdbuuid']}/rules/", '\.rules'); + + $resultAllRulesetname = sqlite_query($db, + "SELECT rulesetname FROM {$_POST['dbTable']} WHERE rdbuuid = '{$_POST['rdbuuid']}'; + "); + + $chktable2 = sqlite_fetch_all($resultAllRulesetname, SQLITE_ASSOC); + + + if (!empty($chktable2)) { + foreach ($chktable2 as $value) + { + + if(!in_array($value['rulesetname'], $listDir)) { + $deleteMissingRuleset = sqlite_query($db, // @ supress warnings use only in production + "DELETE FROM {$_POST['dbTable']} WHERE rulesetname = '{$value['rulesetname']}' and rdbuuid = '{$_POST['rdbuuid']}'; + "); + } + + if(!in_array($value['rulesetname'], $_POST['filenamcheckbox'])) { + $ruleSetisOff = sqlite_query($db, // @ supress warnings usonly in production + "UPDATE {$_POST['dbTable']} SET enable = 'off' WHERE rulesetname = '{$value['rulesetname']}' and rdbuuid = '{$_POST['rdbuuid']}'; + "); + } + } + } + sqlite_close($db); + } // END createUpdateRulesetTable func + createUpdateRulesetTable(); + + // save gen setting only if on ips tab + if ($_POST['dbTable'] === 'SnortruleSetsIps') { - // foreach selected rulesets do this - if (!empty($ruleSetfilenames)) { - foreach ($ruleSetfilenames as $ruleSetfilename) - { + function createUpdateRulesetGenTable() + { + $table = 'SnortruleGenIps'; + $rulesetUuid = genAlphaNumMixFast(11, 14); + $addDate = date(U); + // dont let user pick the DB path + $db = sqlite_open("/usr/local/pkg/snort/{$_POST['dbName']}"); + $resultid = sqlite_query($db, - "SELECT id, enable FROM {$table} WHERE rulesetname = '{$ruleSetfilename}' and rdbuuid = '{$rdbuuid}'; + "SELECT id FROM {$table} WHERE rdbuuid = '{$_POST['rdbuuid']}'; "); - $chktable = sqlite_fetch_all($resultid, SQLITE_ASSOC); - - if (empty($chktable)) { - - $rulesetUuid = genAlphaNumMixFast(11, 14); + $chktable = sqlite_fetch_all($resultid, SQLITE_ASSOC); + + if (!empty($chktable)) { $query_ck = sqlite_query($db, // @ supress warnings usonly in production - "INSERT INTO {$table} (date, uuid, rdbuuid, rulesetname, enable) VALUES ('{$addDate}', '{$rulesetUuid}', '{$rdbuuid}', '{$ruleSetfilename}', 'on'); + "UPDATE {$table} SET who = '{$_POST['snortsam']['db']['gensettings']['who']}', timeamount = '{$_POST['snortsam']['db']['gensettings']['timeamount']}', timetype = '{$_POST['snortsam']['db']['gensettings']['timetype']}' WHERE rdbuuid = '{$_POST['rdbuuid']}'; "); - - }else{ - if ($chktable[0]['enable'] == 'off') { - $query_ck = sqlite_query($db, // @ supress warnings usonly in production - "UPDATE {$table} SET enable = 'on' WHERE id = '{$chktable[0]['id']}'; - "); - } + + }else{ + + $query_ck = sqlite_query($db, // @ supress warnings usonly in production + "INSERT INTO {$table} (date, uuid, rdbuuid, who, timeamount, timetype) VALUES ('{$addDate}', '{$rulesetUuid}', '{$_POST['rdbuuid']}', '{$_POST['snortsam']['db']['gensettings']['who']}', '{$_POST['snortsam']['db']['gensettings']['timeamount']}', '{$_POST['snortsam']['db']['gensettings']['timetype']}'); + "); } - } - } // end foreach if - - // clean database of old names and turn rulesets off - $listDir = snortScanDirFilter("/usr/local/etc/snort/snortDBrules/DB/{$rdbuuid}/rules/", '\.rules'); - - $resultAllRulesetname = sqlite_query($db, - "SELECT rulesetname FROM {$table} WHERE rdbuuid = '{$rdbuuid}'; - "); - - $chktable2 = sqlite_fetch_all($resultAllRulesetname, SQLITE_ASSOC); - - - if (!empty($chktable2)) - { - foreach ($chktable2 as $value) - { - - if(!in_array($value['rulesetname'], $listDir)) - { - $deleteMissingRuleset = sqlite_query($db, // @ supress warnings use only in production - "DELETE FROM {$table} WHERE rulesetname = '{$value['rulesetname']}' and rdbuuid = '{$rdbuuid}'; - "); - } - - if(!in_array($value['rulesetname'], $ruleSetfilenames)) - { - $ruleSetisOff = sqlite_query($db, // @ supress warnings usonly in production - "UPDATE {$table} SET enable = 'off' WHERE rulesetname = '{$value['rulesetname']}' and rdbuuid = '{$rdbuuid}'; - "); - } - } - } - - sqlite_close($db); - + sqlite_close($db); + } // END createUpdateRulesetGenTable + createUpdateRulesetGenTable(); + + } return true; } // END Save ruleSets settings @@ -859,32 +891,18 @@ function snortSql_updatelistDelete($databse, $table, $type, $uuid_filename) $mydb = sqlite_open("$db"); - if ($type == 'uuid') - { + if (!empty($type)) { + $query = sqlite_query($mydb, // @ supress warnings usonly in production - "DELETE FROM {$table} WHERE uuid = '{$uuid_filename}'; - "); - } - - if ($type == 'filename') - { - $query = sqlite_query($mydb, // @ supress warnings use only in production - "DELETE FROM {$table} WHERE filename = '{$uuid_filename}'; - "); - } - - if ($type == 'ifaceuuid') - { - $query = sqlite_query($mydb, // @ supress warnings use only in production - "DELETE FROM {$table} WHERE ifaceuuid = '{$uuid_filename}'; - "); - } + "DELETE FROM {$table} WHERE {$type} = '{$uuid_filename}'; + "); - if (sqlite_changes($mydb) < 1) - { - sqlite_close($mydb); - return 'Error in query'; - } + if (sqlite_changes($mydb) < 1) { + sqlite_close($mydb); + return 'Error in query'; + } + + } sqlite_close($mydb); return true; diff --git a/config/snort-dev/snort_rulesets_ips.php b/config/snort-dev/snort_rulesets_ips.php new file mode 100644 index 00000000..b5c18523 --- /dev/null +++ b/config/snort-dev/snort_rulesets_ips.php @@ -0,0 +1,387 @@ +<?php +/* $Id$ */ +/* + + part of pfSense + All rights reserved. + + Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. + All rights reserved. + + Pfsense Old snort GUI + Copyright (C) 2006 Scott Ullrich. + + Pfsense snort GUI + Copyright (C) 2008-2012 Robert Zelaya. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the pfSense nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +require_once("guiconfig.inc"); +require_once("/usr/local/pkg/snort/snort_new.inc"); +require_once("/usr/local/pkg/snort/snort_gui.inc"); + +if (isset($_GET['uuid']) && isset($_GET['rdbuuid'])) { + echo 'Error: more than one uuid'; + exit(0); +} + +// set page vars +if (isset($_GET['uuid'])) { + $uuid = $_GET['uuid']; +} + +if (isset($_GET['rdbuuid'])) { + $rdbuuid = $_GET['rdbuuid']; +}else{ + $ruledbname_pre1 = snortSql_fetchAllSettings('snortDB', 'SnortIfaces', 'uuid', $uuid); + $rdbuuid = $ruledbname_pre1['ruledbname']; +} + +//$a_list = snortSql_fetchAllSettings('snortDBrules', 'SnortIfaces', 'uuid', $uuid); + + // list rules in the default dir + $filterDirList = array(); + $filterDirList = snortScanDirFilter('/usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/rules', '\.rules'); + + // list rules in db that are on in a array + $listOnRules = array(); + $listOnRules = snortSql_fetchAllSettings('snortDBrules', 'SnortRuleSetsIps', 'rdbuuid', $rdbuuid); + + // list rules in db that are on in a array + $listGenRules = array(); + $listGenRules = snortSql_fetchAllSettings('snortDBrules', 'SnortruleGenIps', 'rdbuuid', $rdbuuid); + + if (!empty($listOnRules)) { + foreach ( $listOnRules as $val2 ) + { + if ($val2['enable'] == 'on') { + $rulesetOn[] = $val2['rulesetname']; + } + } + unset($listOnRules); + } + + $pgtitle = "Services: Snort: Ruleset Ips"; + include("/usr/local/pkg/snort/snort_head.inc"); + +?> + + + + +<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> + +<script type="text/javascript"> + +//prepare the form when the DOM is ready +jQuery(document).ready(function() { + + <?php + /* + * NOTE: I could have used a php loop to build the table but off loading to client is faster + * use jQuery jason parse, make sure its in one line + */ + if (!empty($filterDirList)) + { + $countDirList = count($filterDirList); + + echo "\n"; + + echo 'var snortObjlist = jQuery.parseJSON(\' { "ruleSets": [ '; + $i = 0; + foreach ($filterDirList as $val3) + { + + $i++; + + // if list ruleset is in the db ON mark it checked + $rulesetOnChecked = 'off'; + if(!empty($rulesetOn)) + { + if (in_array($val3, $rulesetOn)) + { + $rulesetOnChecked = 'on'; + } + } + + if ( $i !== $countDirList ) + { + echo '{"rule": ' . '"' . $val3 . '", ' . '"enable": ' . '"' . $rulesetOnChecked . '"' . '}, '; + }else{ + echo '{"rule": "' . $val3 . '", ' . '"enable": ' . '"' . $rulesetOnChecked . '"' . '} '; + } + } + + echo ' ]}\');' . "\n"; + } + + + + ?> + + // loop through object, dont use .each in jQuery as its slow + if(snortObjlist.ruleSets.length > 0) + { + for (var i = 0; i < snortObjlist.ruleSets.length; i++) + { + + if (isEven(i) === true) + { + var rowIsEvenOdd = 'even_ruleset'; + }else{ + var rowIsEvenOdd = 'odd_ruleset'; + } + + if (snortObjlist.ruleSets[i].enable === 'on') + { + var rulesetChecked = 'checked'; + }else{ + var rulesetChecked = ''; + } + + jQuery('.rulesetloopblock').append( + "\n" + '<tr>' + "\n" + + '<td class="' + rowIsEvenOdd + '" align="center" valign="top" width="9%">' + "\n" + + ' <input class="domecheck" name="filenamcheckbox[]" value="' + snortObjlist.ruleSets[i].rule + '" type="checkbox" ' + rulesetChecked + ' >' + "\n" + + '</td>' + "\n" + + '<td class="' + rowIsEvenOdd + '">' + "\n" + + ' <a href="/snort/snort_rules_ips.php?rulefilename=' + snortObjlist.ruleSets[i].rule + '<?php if(isset($uuid)){echo "&uuid=$uuid";}else{echo "&rdbuuid=$rdbuuid";}?>' + '">' + snortObjlist.ruleSets[i].rule + '</a>' + "\n" + + '</td>' + "\n" + + '</tr>' + "\n\n" + ); + }; + } + + +}); // end of document ready + +</script> + +<!-- loading msg --> +<div id="loadingWaiting"> + <div class="snortModal" style="top: 200px; left: 700px;"> + <div class="snortModalTop"> + <!-- <div class="snortModalTopClose"><a href="javascript:hideLoading('#loadingWaiting');"><img src="/snort/images/close_9x9.gif" border="0" height="9" width="9"></a></div> --> + </div> + <div class="snortModalTitle"> + <p><img src="./images/loading.gif" /><br><br>Please Wait...</p> + </div> + <div> + <p class="loadingWaitingMessage"></p> + </div> + </div> +</div> + +<?php include("fbegin.inc"); ?> + +<div class="body2"><!-- hack to fix the hardcoed fbegin link in header --> +<div id="header-left2"><a href="../index.php" id="status-link2"><img src="./images/transparent.gif" border="0" alt="transgif" ></img></a></div> + +<table width="100%" border="0" cellpadding="0" cellspacing="0"> + <?php + if (!empty($uuid)) { + echo ' + <tr> + <td> + <div class="newtabmenu" style="margin: 1px 0px; width: 775px;"><!-- Tabbed bar code--> + <ul class="newtabmenu"> + <li><a href="/snort/snort_interfaces.php"><span>Snort Interfaces</span></a></li> + <li><a href="/snort/snort_interfaces_edit.php?uuid=' . $uuid . '"><span>If Settings</span></a></li> + <li><a href="/snort/snort_rulesets.php?uuid=' . $uuid . '"><span>Categories</span></a></li> + <li><a href="/snort/snort_rules.php?uuid=' . $uuid . '"><span>Rules</span></a></li> + <li class="newtabmenu_active"><a href="/snort/snort_rulesets_ips.php?uuid=' . $uuid . '"><span>Ruleset Ips</span></a></li> + <li><a href="/snort/snort_define_servers.php?uuid=' . $uuid . '"><span>Servers</span></a></li> + <li><a href="/snort/snort_preprocessors.php?uuid=' . $uuid . '"><span>Preprocessors</span></a></li> + <li><a href="/snort/snort_barnyard.php?uuid=' . $uuid . '"><span>Barnyard2</span></a></li> + </ul> + </div> + </td> + </tr> + '; + }else{ + echo ' + <tr> + <td> + <div class="newtabmenu" style="margin: 1px 0px; width: 775px;"><!-- Tabbed bar code--> + <ul class="newtabmenu"> + <li><a href="/snort/snort_interfaces.php"><span>Snort Interfaces</span></a></li> + <li><a href="/snort/snort_interfaces_global.php"><span>Global Settings</span></a></li> + <li><a href="/snort/snort_download_updates.php"><span>Updates</span></a></li> + <li class="newtabmenu_active"><a href="/snort/snort_interfaces_rules.php"><span>RulesDB</span></a></li> + <li><a href="/snort/snort_alerts.php"><span>Alerts</span></a></li> + <li><a href="/snort/snort_blocked.php"><span>Blocked</span></a></li> + <li><a href="/snort/snort_interfaces_whitelist.php"><span>Whitelists</span></a></li> + <li><a href="/snort/snort_interfaces_suppress.php"><span>Suppress</span></a></li> + <li><a href="/snort/snort_help_info.php"><span>Help</span></a></li> + </ul> + </div> + </td> + </tr> + <tr> + <td> + <div class="newtabmenu" style="margin: 1px 0px; width: 775px;"><!-- Tabbed bar code--> + <ul class="newtabmenu"> + <li><a href="/snort/snort_interfaces_rules_edit.php?rdbuuid=' . $rdbuuid . '"><span>Rules DB Edit</span></a></li> + <li><a href="/snort/snort_rulesets.php?rdbuuid=' . $rdbuuid . '"><span>Categories</span></a></li> + <li><a href="/snort/snort_rules.php?rdbuuid=' . $rdbuuid . '"><span>Rules</span></a></li> + <li class="newtabmenu_active"><a href="/snort/snort_rulesets_ips.php?rdbuuid=' . $rdbuuid . '"><span>Ruleset Ips</span></a></li> + </ul> + </div> + </td> + </tr> + '; + } + ?> + <tr> + <td id="tdbggrey"> + <table width="100%" border="0" cellpadding="10px" cellspacing="0"> + <tr> + <td class="tabnavtbl"> + <table width="100%" border="0" cellpadding="6" cellspacing="0" > + <!-- START MAIN AREA --> + + <table width="100%" border="0" cellpadding="0" cellspacing="0" > + <tr> + <td> + </td> + <td> + <input id="select_all" type="button" class="formbtn" value="Select All" > + <input id="deselect_all" type="button" class="formbtn" value="Deselect All" > + </td> + </tr> + </table> + + <div id="checkboxdo" style="width:100%; margin-left: auto ; margin-right: auto ; padding-top: 10px; padding-bottom: 0px;"> + <form id="iform" action="" > + <input type="hidden" name="snortSaveRuleSets" value="1" /> <!-- what to do, save --> + <input type="hidden" name="dbName" value="snortDBrules" /> <!-- what db--> + <input type="hidden" name="dbTable" value="SnortruleSetsIps" /> <!-- what db table--> + <input type="hidden" name="ifaceTab" value="snort_rulesets_ips" /> <!-- what interface tab --> + <input type="hidden" name="rdbuuid" value="<?=$rdbuuid;?>" /> <!-- what interface to save for --> + <input type="hidden" name="uuid" value="<?=$uuid;?>" /> <!-- create snort.conf --> + + <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-bottom: 10px;"> + <tr> + <td colspan="2" valign="top" class="listtopic">General Settings</td> + </tr> + </table> + + <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-bottom: 10px;"> + <tr> + <td> + <table width="100%" border="0" cellpadding="0" cellspacing="0" > + <tr class="hidemetr" id="ipstable_gensettings" valign="top"> + <td class="vncell2" id="infotext_ips"><font color="#000000">Default settings for all block rules</font></td> + <td class="odd_ruleset2"> + <select class="formfld2" id="who_gensettings" name="snortsam[db][gensettings][who]"> + <?php + $whoList = array('src' => 'SRC', 'dst' => 'DST', 'both' => 'BOTH'); + snortDropDownList($whoList, $listGenRules[0]['who']); + ?> + </select> + </td> + <td class="odd_ruleset2"> + <?php + if (!empty($listGenRules[0]['timeamount'])) { + $timeamount = $listGenRules[0]['timeamount']; + }else{ + $timeamount = '15'; + } + ?> + <input class="formfld2" id="timeamount_gensettings" name="snortsam[db][gensettings][timeamount]" size="7" value="<?=$timeamount; ?>" type="text"> + </td> + <td class="odd_ruleset2"> + <select class="formfld2" id="timetype_gensettings" name="snortsam[db][gensettings][timetype]"> + <?php + $timeTypeList = array('minutes' => 'MINUTES', 'seconds' => 'SECONDS', 'hours' => 'HOURS', 'days' => 'DAYS', 'weeks' => 'WEEKS', 'months' => 'MONTHS', 'always' => 'ALWAYS'); + snortDropDownList($timeTypeList, $listGenRules[0]['timetype']); + ?> + </select> + </td> + </tr> + </table> + </td> + </tr> + </table> + + + <table width="100%" border="0" cellpadding="0" cellspacing="0"> + + <tr > + <td width="5%" class="listtopic">Enabled</td> + <td class="listtopic">Select The Rulesets To Eable IPS On</td> + </tr> + <table class="rulesetbkg" width="100%"> + + <tbody class="rulesetloopblock" > + <!-- javscript loop table build here --> + </tbody> + + </table> + <table class="vncell1" width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td class="listtopic" >Check the rulesets that you would like Snort to load at startup.</td> + </tr> + </table> + <tr> + <td> + <input name="Submit" type="submit" class="formbtn" value="Save"> + <input id="cancel" type="button" class="formbtn" value="Cancel"> + </td> + </tr> + <tr> + <td width="78%"> + <span class="vexpl"><span class="red"><strong>Note:</strong></span> + Please save your settings before you click start.</span> + </td> + </tr> + + </table> + </form> + </div> + + <!-- STOP MAIN AREA --> + </table> + </td> + </tr> + </table> + </td> + </tr> +</table> +</div> + +<!-- footer do not touch below --> +<?php +include("fend.inc"); +echo $snort_custom_rnd_box; +?> + + +</body> +</html> + |