if (empty($limit) || $limit <= 0 || $limit > 10) { $limit = 10; } if (empty($type)) { $type = "event"; } $security_report = new Security_report(); $shared = new DBA_shared(GET('shared')); $SS_TopEvents = $shared->get("SS_TopEvents{$runorder}"); $SA_TopAlarms = $shared->get("SA_TopAlarms{$runorder}"); if ($type == "event" && is_array($SS_TopEvents) && count($SS_TopEvents) > 0) { $list = $SS_TopEvents; } elseif ($type == "alarm" && is_array($SA_TopAlarms) && count($SA_TopAlarms) > 0) { $list = $SA_TopAlarms; } else { $list = $security_report->Events($limit, $type, $date_from, $date_to); } $data_pie = array(); $legend = $data = array(); foreach ($list as $key => $l) { if ($key >= 10) { // ponemos un límite de resultados para la gráfica break; } $data_pie[$l[1]] = Security_report::Truncate($l[0], 60); $legend[] = Util::signaturefilter(Security_report::Truncate($l[0], 60)); $data[] = $l[1]; } $total = array_sum($data); $labels = array(); $tlabels = array();
} elseif ($screen == "alarms" && Session::menu_perms("analysis-menu", "ReportsAlarmReport")) { // Alarms report $report_type = "alarm"; $security_report = new Security_report(); $interval = 60 * 60 * 24 * $range; # 1 month $date_from = GET('date_from') != "" ? GET('date_from') : strftime("%Y-%m-%d", time() - $interval); $date_to = GET('date_to') != "" ? GET('date_to') : strftime("%Y-%m-%d", time()); // Attacked host $list1 = $security_report->AttackHost("ip_dst", $NUM_HOSTS, $report_type, $date_from, $date_to); // Attacker host $list2 = $security_report->AttackHost("ip_src", $NUM_HOSTS, $report_type, $date_from, $date_to); // Ports $list3 = $security_report->Ports($NUM_HOSTS, $report_type, $date_from, $date_to); // Events $list4 = $security_report->Events($NUM_HOSTS, $report_type, $date_from, $date_to); ?> <table cellpadding='0' cellspacing='0' border='0' align="center" width='100%'> <tr> <td class="canvas"> <table cellpadding='0' cellspacing='0' border='0' width='100%'> <tr> <td height="3" colspan="11" bgcolor="#A1A1A1"></td> </tr> <tr> <td width="12" valign="top"></td> <td style="padding:5px 10px 3px 0px"> <table cellpadding='0' cellspacing='0' border='0' width='100%'> <tr> <td align="center">