Exemplo n.º 1
0
function GetOssimHostGroups()
{
    $db = new ossim_db();
    $conn = $db->connect();
    $pg = array();
    try {
        list($groups, $t) = Asset_group::get_list($conn, '', array("order_by" => "name"), TRUE);
    } catch (Exception $e) {
        return $pg;
    }
    foreach ($groups as $group_id => $hg) {
        $pg[$group_id] = $hg->get_name();
    }
    $db->close($conn);
    return $pg;
}
        $order = 'g.name';
}
// Order direction
$torder = $torder == 1 ? 'ASC' : 'DESC';
// Limit
$maxrows = $maxrows > 50 ? 50 : $maxrows;
// Search where
if ($search != "") {
    $search = escape_sql($search, $conn);
    $filters['where'] = " g.name LIKE '%{$search}%' OR g.owner LIKE '%{$search}%'";
}
$filters['order_by'] = $order . ' ' . $torder;
$filters['limit'] = $from . ', ' . $maxrows;
try {
    // Get Groups
    list($groups, $total) = Asset_group::get_list($conn, '', $filters, TRUE);
    $detail = "<img class='detail_img' src='" . AV_PIXMAPS_DIR . "/show_details.png'/>";
    $results = array();
    foreach ($groups as $group) {
        // Alarms
        $alarms = $group->has_alarms($conn);
        $alarms_icon = $alarms ? "<img src='" . AV_PIXMAPS_DIR . "/assets_tick_gray.png'/>" : '-';
        // Vulns
        $vulns = $group->get_vulnerability_number($conn, $group->get_id());
        $vulns_icon = $vulns > 0 ? "<img src='" . AV_PIXMAPS_DIR . "/assets_tick_gray.png'/>" : '-';
        // Events
        $events = $group->has_events($conn);
        $events_icon = $events ? "<img src='" . AV_PIXMAPS_DIR . "/assets_tick_gray.png'/>" : '-';
        // COLUMNS
        $_res = array();
        $_res['DT_RowId'] = $group->get_id();
Exemplo n.º 3
0
function group_list($conn, $page, $search)
{
    $filters = array();
    $filters['limit'] = get_query_limits($page);
    if ($search != '') {
        $search = utf8_decode($search);
        $search = escape_sql($search, $conn);
        $filters['where'] = " name LIKE '%{$search}%'";
    }
    $filters['order_by'] = 'name ASC';
    try {
        list($groups, $total) = Asset_group::get_list($conn, '', $filters, TRUE);
    } catch (Exception $e) {
        $return['error'] = TRUE;
        $return['msg'] = $e->getMessage();
        return $return;
    }
    //If we have at least one element...
    if ($total > 0) {
        //Getting the nets already selected in the filter.
        $selected = get_selected_values(18);
    }
    $list = array();
    //Going through the list to format the elements properly:
    foreach ($groups as $id => $group) {
        $_chk = $selected[$id] != '' ? TRUE : FALSE;
        $_grp = array('id' => $id, 'name' => $group->get_name(), 'checked' => $_chk);
        $list[$id] = $_grp;
    }
    $data['total'] = intval($total);
    $data['list'] = $list;
    $return['error'] = FALSE;
    $return['data'] = $data;
    return $return;
}
Exemplo n.º 4
0
// Limit
$maxrows = $maxrows > 50 ? 50 : $maxrows;
//Session ID
$session = session_id();
//list params
$filters = array();
$tables = '';
$filters['order_by'] = $order . ' ' . $torder;
$filters['limit'] = $from . ', ' . $maxrows;
if (!$all_list) {
    $tables = ', user_host_filter hf';
    $filters['where'] = "hf.asset_id=g.id AND hf.session_id='{$session}'";
}
try {
    // Get Groups
    list($groups, $total) = Asset_group::get_list($conn, $tables, $filters);
    $results = array();
    foreach ($groups as $group) {
        // Alarms
        $alarms = $group->has_alarms($conn);
        $alarms_icon = $alarms ? "<img src='" . AV_PIXMAPS_DIR . "/assets_tick_gray.png'/>" : '-';
        // Vulns
        list($vulns_list, $vulns) = $group->get_vulnerabilities($conn);
        $vulns_icon = $vulns > 0 ? "<img src='" . AV_PIXMAPS_DIR . "/assets_tick_gray.png'/>" : '-';
        // Events
        $events = $group->has_events($conn);
        $events_icon = $events ? "<img src='" . AV_PIXMAPS_DIR . "/assets_tick_gray.png'/>" : '-';
        // COLUMNS
        $_res = array();
        $_res['DT_RowId'] = $group->get_id();
        $_res[] = '';
Exemplo n.º 5
0
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck("analysis-menu", "ControlPanelAlarms");
$db = new ossim_db(TRUE);
$conn = $db->connect();
$mssp = Session::show_entities();
list($count_tags, $tags) = Tag::get_tags_by_type($conn, 'alarm');
$intents = Alarm::get_intents($conn);
$sensors = Av_sensor::get_list($conn, array(), FALSE, TRUE);
$_groups_data = Asset_group::get_list($conn);
$asset_groups = $_groups_data[0];
//Autocomplete
$autocomplete_keys = array('hosts');
$hosts_str = Autocomplete::get_autocomplete($conn, $autocomplete_keys);
$db->close();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title> <?php 
echo _('AlienVault ' . (Session::is_pro() ? 'USM' : 'OSSIM'));
?>
 </title>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>