+
+ |
+
+
+ |
+
+
+ |
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+ >
+ ', '', '', ''); ?>
+
+ ', '', '', ''); ?>
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+ /tmp/alerts_{$suricata_uuid}");
+ if (file_exists("/tmp/alerts_{$suricata_uuid}")) {
+ $tmpblocked = array_flip(suricata_get_blocked_ips());
+ $counter = 0;
+ /* 0 1 2 3 4 5 6 7 8 9 10 11 12 */
+ /* File format timestamp,action,sig_generator,sig_id,sig_rev,msg,classification,priority,proto,src,srcport,dst,dstport */
+ $fd = fopen("/tmp/alerts_{$suricata_uuid}", "r");
+ while (($fields = fgetcsv($fd, 1000, ',', '"')) !== FALSE) {
+ if(count($fields) < 12)
+ continue;
+
+ /* Time */
+ $alert_time = substr($fields[0], strpos($fields[0], '-')+1, -7);
+ /* Date */
+ $alert_date = trim(substr($fields[0], 0, strpos($fields[0], '-')));
+ /* Description */
+ $alert_descr = $fields[5];
+ $alert_descr_url = urlencode($fields[5]);
+ /* Priority */
+ $alert_priority = $fields[7];
+ /* Protocol */
+ $alert_proto = $fields[8];
+ /* IP SRC */
+ $alert_ip_src = $fields[9];
+ /* Add zero-width space as soft-break opportunity after each colon if we have an IPv6 address */
+ $alert_ip_src = str_replace(":", ":", $alert_ip_src);
+ /* Add Reverse DNS lookup icons */
+ $alert_ip_src .= " ";
+ $alert_ip_src .= " ";
+ $alert_ip_src .= "";
+ $alert_ip_src .= "";
+ /* Add icons for auto-adding to Suppress List if appropriate */
+ if (!suricata_is_alert_globally_suppressed($supplist, $fields[2], $fields[3]) &&
+ !isset($supplist[$fields[2]][$fields[3]]['by_src'][$fields[9]])) {
+ $alert_ip_src .= " ";
+ $alert_ip_src .= "";
+ }
+ elseif (isset($supplist[$fields[2]][$fields[3]]['by_src'][$fields[9]])) {
+ $alert_ip_src .= " ";
+ }
+ /* Add icon for auto-removing from Blocked Table if required */
+ if (isset($tmpblocked[$fields[9]])) {
+ $alert_ip_src .= " ";
+ $alert_ip_src .= "
+ ";
+ }
+ /* IP SRC Port */
+ $alert_src_p = $fields[10];
+ /* IP Destination */
+ $alert_ip_dst = $fields[11];
+ /* Add zero-width space as soft-break opportunity after each colon if we have an IPv6 address */
+ $alert_ip_dst = str_replace(":", ":", $alert_ip_dst);
+ /* Add Reverse DNS lookup icons */
+ $alert_ip_dst .= " ";
+ $alert_ip_dst .= " ";
+ $alert_ip_dst .= "";
+ $alert_ip_dst .= "";
+ /* Add icons for auto-adding to Suppress List if appropriate */
+ if (!suricata_is_alert_globally_suppressed($supplist, $fields[2], $fields[3]) &&
+ !isset($supplist[$fields[2]][$fields[3]]['by_dst'][$fields[1]])) {
+ $alert_ip_dst .= " ";
+ $alert_ip_dst .= "";
+ }
+ elseif (isset($supplist[$fields[2]][$fields[3]]['by_dst'][$fields[11]])) {
+ $alert_ip_dst .= " ";
+ }
+ /* Add icon for auto-removing from Blocked Table if required */
+ if (isset($tmpblocked[$fields[11]])) {
+ $alert_ip_dst .= " ";
+ $alert_ip_dst .= "
+ ";
+ }
+ /* IP DST Port */
+ $alert_dst_p = $fields[12];
+ /* SID */
+ $alert_sid_str = "{$fields[2]}:{$fields[3]}";
+ if (!suricata_is_alert_globally_suppressed($supplist, $fields[2], $fields[3])) {
+ $sidsupplink = "";
+ $sidsupplink .= "";
+ }
+ else {
+ $sidsupplink = "";
+ }
+ /* Add icon for toggling rule state */
+ if (isset($disablesid[$fields[2]][$fields[3]])) {
+ $sid_dsbl_link = "";
+ $sid_dsbl_link .= "";
+ }
+ else {
+ $sid_dsbl_link = "";
+ $sid_dsbl_link .= "";
+ }
+ /* DESCRIPTION */
+ $alert_class = $fields[6];
+
+ echo "
+ {$alert_date} {$alert_time} |
+ {$alert_priority} |
+ {$alert_proto} |
+ {$alert_class} |
+ {$alert_ip_src} |
+ {$alert_src_p} |
+ {$alert_ip_dst} |
+ {$alert_dst_p} |
+ {$alert_sid_str} {$sidsupplink} {$sid_dsbl_link} |
+ {$alert_descr} |
+ \n";
+
+ $counter++;
+ }
+ fclose($fd);
+ @unlink("/tmp/alerts_{$suricata_uuid}");
+ }
+}
+?>
+
+
+ |
+
+