From 16117ee018a4c59bd82766ad91cff013b022dbd5 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Fri, 28 Feb 2014 20:29:41 -0500 Subject: Prevent deleting of Suppress Lists in active use. --- config/suricata/suricata_suppress.php | 141 ++++++++++++++++++++++------------ 1 file changed, 93 insertions(+), 48 deletions(-) diff --git a/config/suricata/suricata_suppress.php b/config/suricata/suricata_suppress.php index 58839dce..e97006dc 100644 --- a/config/suricata/suricata_suppress.php +++ b/config/suricata/suricata_suppress.php @@ -61,6 +61,28 @@ function suricata_suppresslist_used($supplist) { return false; } +function suricata_find_suppresslist_interface($supplist) { + + /****************************************************************/ + /* This function finds the first (if more than one) interface */ + /* configured to use the passed Suppress List and returns the */ + /* index of the interface in the ['rule'] config array. */ + /* */ + /* Returns: index of interface in ['rule'] config array or */ + /* FALSE if no interface found. */ + /****************************************************************/ + + global $config; + $suricataconf = $config['installedpackages']['suricata']['rule']; + if (empty($suricataconf)) + return false; + foreach ($suricataconf as $rule => $value) { + if ($value['suppresslistname'] == $supplist) + return $rule; + } + return false; +} + if ($_GET['act'] == "del") { if ($a_suppress[$_GET['id']]) { // make sure list is not being referenced by any Suricata-configured interface @@ -108,54 +130,74 @@ if ($input_errors) {
- - - - - - - - - - - - - - - - - - -
- -   - - - - - - +
">')">">
+ + + + + + + + + + "; + } + else + $icon = ""; + ?> + + + + + + + + + + +
+   +   + + + + + + + + + + + + +
">"/> + "/> + ')">"> 
+
+ + + + + +
 ">
+
-
- - - - - -
 ">
-
@@ -163,7 +205,10 @@ if ($input_errors) {



+ "take effect."); ?>

+ " . + gettext("You must first unassign the Suppress List on the Interface Edit tab."); ?> +

-- cgit v1.2.3