aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort-dev/snort_rulesets.php
diff options
context:
space:
mode:
authorrobiscool <robrob2626@yahoo.com>2009-10-02 21:43:05 -0700
committerrobiscool <robrob2626@yahoo.com>2009-10-02 21:43:45 -0700
commitac6c2a7a83a36ecc1fd979db48a042d5edf156df (patch)
treef54f54fe18d1fce07de139c45000663549dec238 /config/snort-dev/snort_rulesets.php
parentcb829a8ae1fd3267062710a0ddc93d5bf8a2592a (diff)
downloadpfsense-packages-ac6c2a7a83a36ecc1fd979db48a042d5edf156df.tar.gz
pfsense-packages-ac6c2a7a83a36ecc1fd979db48a042d5edf156df.tar.bz2
pfsense-packages-ac6c2a7a83a36ecc1fd979db48a042d5edf156df.zip
snort-dev, mirror snort satble with snort-dev
Diffstat (limited to 'config/snort-dev/snort_rulesets.php')
-rw-r--r--config/snort-dev/snort_rulesets.php66
1 files changed, 63 insertions, 3 deletions
diff --git a/config/snort-dev/snort_rulesets.php b/config/snort-dev/snort_rulesets.php
index 4f16eadd..8e5179d6 100644
--- a/config/snort-dev/snort_rulesets.php
+++ b/config/snort-dev/snort_rulesets.php
@@ -27,13 +27,73 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-if(!is_dir("/usr/local/etc/snort/rules"))
- Header("Location: snort_download_rules.php");
-
require("guiconfig.inc");
require_once("service-utils.inc");
require("/usr/local/pkg/snort.inc");
+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/rules/*.rules');
+if ($isrulesfolderempty == "") {
+
+include("head.inc");
+include("fbegin.inc");
+
+echo "<body link=\"#000000\" vlink=\"#000000\" alink=\"#000000\">";
+
+echo "<script src=\"/row_toggle.js\" type=\"text/javascript\"></script>\n
+<script src=\"/javascript/sorttable.js\" type=\"text/javascript\"></script>\n
+<table width=\"99%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n
+ <tr>\n
+ <td>\n";
+
+ $tab_array = array();
+ $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=snort.xml&id=0");
+ $tab_array[] = array(gettext("Update Rules"), false, "/snort_download_rules.php");
+ $tab_array[] = array(gettext("Categories"), true, "/snort_rulesets.php");
+ $tab_array[] = array(gettext("Rules"), false, "/snort_rules.php");
+ $tab_array[] = array(gettext("Servers"), false, "/pkg_edit.php?xml=snort_define_servers.xml&amp;id=0");
+ $tab_array[] = array(gettext("Blocked"), false, "/snort_blocked.php");
+ $tab_array[] = array(gettext("Whitelist"), false, "/pkg.php?xml=snort_whitelist.xml");
+ $tab_array[] = array(gettext("Threshold"), false, "/pkg.php?xml=snort_threshold.xml");
+ $tab_array[] = array(gettext("Alerts"), false, "/snort_alerts.php");
+ $tab_array[] = array(gettext("Advanced"), false, "/pkg_edit.php?xml=snort_advanced.xml&id=0");
+ display_top_tabs($tab_array);
+
+echo "</td>\n
+ </tr>\n
+ <tr>\n
+ <td>\n
+ <div id=\"mainarea\">\n
+ <table id=\"maintable\" class=\"tabcont\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n
+ <tr>\n
+ <td>\n
+# The rules directory is empty.\n
+ </td>\n
+ </tr>\n
+ </table>\n
+ </div>\n
+ </td>\n
+ </tr>\n
+</table>\n
+\n
+</form>\n
+\n
+<p>\n\n";
+
+echo "Please click on the Update Rules tab to install your selected rule sets.";
+include("fend.inc");
+
+echo "</body>";
+echo "</html>";
+
+exit(0);
+
+}
+
if($_POST) {
$enabled_items = "";
$isfirst = true;