+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+ " title=" "/>
+ " title=""/>
+ " onclick="return confirm('')" title=""/>
+ |
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+ $rulem) {
+ foreach ($rulem as $k2 => $v) {
+ $sid = suricata_get_sid($v['rule']);
+ $gid = suricata_get_gid($v['rule']);
+
+ if (isset($disablesid[$gid][$sid])) {
+ $textss = "";
+ $textse = "";
+ $iconb = "icon_reject_d.gif";
+ $disable_cnt++;
+ $title = gettext("Disabled by user. Click to toggle to default state");
+ }
+ elseif (($v['disabled'] == 1) && (!isset($enablesid[$gid][$sid]))) {
+ $textss = "";
+ $textse = "";
+ $iconb = "icon_block_d.gif";
+ $disable_cnt++;
+ $title = gettext("Disabled by default. Click to toggle to enabled state");
+ }
+ elseif (isset($enablesid[$gid][$sid])) {
+ $textss = $textse = "";
+ $iconb = "icon_reject.gif";
+ $enable_cnt++;
+ $title = gettext("Enabled by user. Click to toggle to default state");
+ }
+ else {
+ $textss = $textse = "";
+ $iconb = "icon_block.gif";
+ $enable_cnt++;
+ $title = gettext("Enabled by default. Click to toggle to disabled state");
+ }
+
+ // Pick off the first section of the rule (prior to the start of the MSG field),
+ // and then use a REGX split to isolate the remaining fields into an array.
+ $tmp = substr($v['rule'], 0, strpos($v['rule'], "("));
+ $tmp = trim(preg_replace('/^\s*#+\s*/', '', $tmp));
+ $rule_content = preg_split('/[\s]+/', $tmp);
+
+ // Create custom tags for the fields we truncate so we can
+ // have a "title" attribute for tooltips to show the full string.
+ $srcspan = add_title_attribute($textss, $rule_content[2]);
+ $srcprtspan = add_title_attribute($textss, $rule_content[3]);
+ $dstspan = add_title_attribute($textss, $rule_content[5]);
+ $dstprtspan = add_title_attribute($textss, $rule_content[6]);
+ $protocol = $rule_content[1]; //protocol field
+ $source = truncate($rule_content[2], 14); //source field
+ $source_port = truncate($rule_content[3], 10); //source port field
+ $destination = truncate($rule_content[5], 14); //destination field
+ $destination_port = truncate($rule_content[6], 10); //destination port field
+ $message = suricata_get_msg($v['rule']);
+ $sid_tooltip = gettext("View the raw text for this rule");
+
+ echo "{$textss}
+
+ {$textse}
+ |
+
+ {$textss}{$gid}{$textse}
+ |
+
+ {$textss}{$sid}{$textse}
+ |
+
+ {$textss}{$v['action']}{$textse}
+ |
+
+ {$textss}{$protocol}{$textse}
+ |
+
+ {$srcspan}{$source}
+ |
+
+ {$srcprtspan}{$source_port}
+ |
+
+ {$dstspan}{$destination}
+ |
+
+ {$dstprtspan}{$destination_port}
+ |
+
+ {$textss}{$message}{$textse}
+ |
+ ";
+ $counter++;
+ }
+ }
+ unset($rulem, $v); ?>
+
+
+ |
+
+
+
+
+
+ |
+
+ " .
+ gettext("Total Rules: {$counter}") . " " .
+ gettext("Enabled: {$enable_cnt}") . " " .
+ gettext("Disabled: {$disable_cnt}"); ?> |
+
+
+ |
+ |
+
+
+ |
+ |
+
+
+ |
+ |
+
+
+ |
+ |
+
+
+ |
+
+
+