From c7526cc17efff74791562bfe0f01dfa21ebfed8d Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Fri, 7 Mar 2014 16:25:47 -0500 Subject: Change "Snort" back to "Suricata" from copy-paste mistake. --- config/suricata/suricata.inc | 34 ++++++++++++++++----------------- config/suricata/suricata_rules_edit.php | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'config') diff --git a/config/suricata/suricata.inc b/config/suricata/suricata.inc index 5c052cd2..2660fae6 100644 --- a/config/suricata/suricata.inc +++ b/config/suricata/suricata.inc @@ -712,10 +712,10 @@ function suricata_build_sid_msg_map($rules_path, $sid_file) { $sidMap = array(); $rule_files = array(); - /* First check if we were passed a directory, a single file */ - /* or an array of filenames to read. Set our $rule_files */ - /* variable accordingly. If we can't figure it out, return */ - /* and don't write a sid-msg.map file. */ + // First check if we were passed a directory, a single file + // or an array of filenames to read. Set our $rule_files + // variable accordingly. If we can't figure it out, return + // and don't write a sid-msg.map file. if (is_string($rules_path)) { if (is_dir($rules_path)) $rule_files = glob($rules_path . "*.rules"); @@ -727,14 +727,14 @@ function suricata_build_sid_msg_map($rules_path, $sid_file) { else return; - /* Read the rule files into an array, then iterate the list */ + // Read the rule files into an array, then iterate the list foreach ($rule_files as $file) { - /* Don't process files with "deleted" in the filename */ + // Don't process files with "deleted" in the filename if (stristr($file, "deleted")) continue; - /* Read the file into an array, skipping missing files. */ + // Read the file into an array, skipping missing files. if (!file_exists($file)) continue; @@ -742,24 +742,24 @@ function suricata_build_sid_msg_map($rules_path, $sid_file) { $record = ""; $b_Multiline = false; - /* Read and process each line from the rules in the current file */ + // Read and process each line from the rules in the current file foreach ($rules_array as $rule) { - /* Skip any non-rule lines unless we're in multiline mode. */ + // Skip any non-rule lines unless we're in multiline mode. if (!preg_match('/^\s*#*\s*(alert|drop|pass)/i', $rule) && !$b_Multiline) continue; - /* Test for a multi-line rule, and reassemble the */ - /* pieces back into a single line. */ + // Test for a multi-line rule, and reassemble the + // pieces back into a single line. if (preg_match('/\\\\s*[\n]$/m', $rule)) { $rule = substr($rule, 0, strrpos($rule, '\\')); $record .= $rule; $b_Multiline = true; continue; } - /* If the last segment of a multiline rule, then */ - /* append it onto the previous parts to form a */ - /* single-line rule for further processing below. */ + // If the last segment of a multiline rule, then + // append it onto the previous parts to form a + // single-line rule for further processing below. elseif (!preg_match('/\\\\s*[\n]$/m', $rule) && $b_Multiline) { $record .= $rule; $rule = $record; @@ -767,7 +767,7 @@ function suricata_build_sid_msg_map($rules_path, $sid_file) { $b_Multiline = false; $record = ""; - /* Parse the rule to find sid and any references. */ + // Parse the rule to find sid and any references. $gid = '1'; // default to 1 for regular rules $sid = ''; $rev = ''; @@ -800,10 +800,10 @@ function suricata_build_sid_msg_map($rules_path, $sid_file) { } } } - /* Sort the generated sid-msg map */ + // Sort the generated sid-msg map natcasesort($sidMap); - /* Now print the result to the supplied file */ + // Now print the result to the supplied file @file_put_contents($sid_file, "#v2\n# sid-msg.map file auto-generated by Snort.\n\n"); @file_put_contents($sid_file, array_values($sidMap), FILE_APPEND); } diff --git a/config/suricata/suricata_rules_edit.php b/config/suricata/suricata_rules_edit.php index c02d3eba..491bda61 100644 --- a/config/suricata/suricata_rules_edit.php +++ b/config/suricata/suricata_rules_edit.php @@ -70,7 +70,7 @@ if (substr($file, 0, 10) == "IPS Policy") { $wrap_flag = "soft"; } else { - $contents = "# Snort IPS Policy - " . ucfirst(trim(substr($file, strpos($file, "-")+1))) . "\n\n"; + $contents = "# Suricata IPS Policy - " . ucfirst(trim(substr($file, strpos($file, "-")+1))) . "\n\n"; foreach (array_keys($rules_map) as $k1) { foreach (array_keys($rules_map[$k1]) as $k2) { $contents .= "# Category: " . $rules_map[$k1][$k2]['category'] . " SID: {$k2}\n"; -- cgit v1.2.3