当前位置: 首页>>代码示例>>PHP>>正文


PHP Av_sensor::get_list方法代码示例

本文整理汇总了PHP中Av_sensor::get_list方法的典型用法代码示例。如果您正苦于以下问题:PHP Av_sensor::get_list方法的具体用法?PHP Av_sensor::get_list怎么用?PHP Av_sensor::get_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Av_sensor的用法示例。


在下文中一共展示了Av_sensor::get_list方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _

    <th><?php 
echo _("Vuln Scanner");
?>
</th>
    <th><?php 
echo _("Nmap Scan");
?>
</th>
    <th><?php 
echo _("Load");
?>
</th>
</tr>
    <?php 
// get available sensors
$_list_data = Av_sensor::get_list($conn);
$all_sensors = $_list_data[0];
// remote nmap
$rscan = new Remote_scan('', '');
$rscan->available_scan();
$ids = array();
if (is_array($rscan->get_sensors()) && count(array_keys($rscan->get_sensors())) > 0) {
    $agents = $rscan->get_sensors();
    foreach ($agents as $asid => $agent) {
        $ids[] = $asid;
    }
}
$withnmapforced = 0;
if (valid_hex32($scan_server) && !$hosts_alive && $sensor_id != "") {
    $ids = array_merge(array($sensor_id), $ids);
    $withnmapforced = 1;
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:simulate.php

示例2: list

    ?>
</label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="center noborder">
                                        <input type="hidden" name="entities[]" id="entities" class='vfield' value="<?php 
    echo Session::get_default_ctx();
    ?>
"/>
                                        <input type="hidden" name="num_entities_check" id="num_entities_check" value=""/>
                                        <br>

                                        <select name="neighborsensor" class='vfield' id="neighborsensor" style="width:150px">
                                            <?php 
    list($s_list, $s_total) = Av_sensor::get_list($conn, array(), FALSE, TRUE);
    $empty = 1;
    foreach ($s_list as $s_id => $s_data) {
        if ($s_data['properties']['version'] != 'unknown') {
            echo "<option value='" . $s_id . "'>" . $s_data['name'] . "\n";
            $empty = 0;
        }
    }
    if ($empty) {
        echo "<option value='00000000000000000000000000000000'>" . _('Local sensor') . "\n";
    }
    ?>
                                        </select>
                                    </td>
                                    <td class="center noborder" style="padding-left:10px">
                                        <input type="hidden" class='vfield' style="width:120px" name="newcontext" value="<?php 
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:newsensorform.php

示例3: session_write_close

* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck('environment-menu', 'PolicyHosts');
session_write_close();
/****************************************************
 ********************* Tooltips *********************
 ****************************************************/
$t_location = '<div>' . _("You can type any location (address, country, city, ...)") . '</div>';
//Database connection
$db = new ossim_db();
$conn = $db->connect();
//Getting all sensors
$filters = array('order_by' => "priority DESC");
list($all_sensors, $s_total) = Av_sensor::get_list($conn, $filters, FALSE, TRUE);
//Common Context
$ctx = Asset_host::get_common_ctx($conn);
//Closing database connection
$db->close();
?>

<div id="bk_tg_container">

    <div id='tg_av_info'></div>

    <div class="legend">
        <?php 
echo _('Only filled values will be updated');
?>
    </div>
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:bk_tpl_tab_general.php

示例4: ossim_valid

            }
        }
        break;
}
ossim_valid($sid, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("Sid"));
if (ossim_error()) {
    die(_("Invalid Parameter Sid"));
}
if (isset($_POST['authorized_users'])) {
    foreach ($_POST['authorized_users'] as $user) {
        $users[] = Util::htmlentities(escape_sql(trim($user), $dbconn), ENT_QUOTES);
    }
}
$sIDs = array();
if (Vulnerabilities::scanner_type() == 'omp') {
    list($sensor_list, $total) = Av_sensor::get_list($dbconn);
    foreach ($sensor_list as $sensor_id => $sensor_data) {
        if (intval($sensor_data['properties']['has_vuln_scanner']) == 1) {
            $sIDs[] = array('name' => $sensor_data['name'], 'id' => $sensor_id);
        }
    }
}
?>
<!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 gettext("Vulnmeter");
?>
 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:settings.php

示例5: _

}
if ($flag_status == 1) {
    if ($flag_reconfig) {
        $status_message = _('Your new configuration will be applied once AlienVault Reconfig completes. This might take several minutes.');
    } else {
        $status_message = _('Configuration successfully updated');
    }
} elseif ($flag_status == 2) {
    $status_message = $error_string;
}
//Connect to db */
$db = new ossim_db();
$conn = $db->connect();
$product = Session::is_pro() ? "USM" : "OSSIM";
//Sensor List
$_list_data = Av_sensor::get_list($conn, array('order_by' => 'name ASC'));
$all_sensors = $_list_data[0];
$sensor_list = array('0' => 'First available sensor');
foreach ($all_sensors as $sensor_id => $sensor) {
    $sensor_list[$sensor['name']] = $sensor['name'] . ' [' . $sensor['ip'] . ']';
}
$default_entities['optgroup1'] = _('Users');
$users = Session::get_list($conn);
foreach ($users as $usr) {
    $default_entities[$usr->get_login()] = $usr->get_name();
}
if (Session::is_pro()) {
    //menu template list
    list($templates, $num_templates) = Session::get_templates($conn);
    if (count($templates) < 1) {
        $templates[0] = array('id' => '', 'name' => '- No templates found -');
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:index.php

示例6: sensor_list

function sensor_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}%' OR inet6_ntoa(ip) LIKE '%{$search}%'";
    }
    $filters['order_by'] = 'name ASC';
    try {
        list($sensors, $total) = Av_sensor::get_list($conn, $filters, TRUE, 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(14);
    }
    $list = array();
    //Going through the list to format the elements properly:
    foreach ($sensors as $id => $sensor) {
        $_chk = $selected[$id] != '' ? TRUE : FALSE;
        $_sensor = array('id' => $id, 'name' => $sensor['name'], 'extra' => $sensor['ip'], 'checked' => $_chk);
        $list[$id] = $_sensor;
    }
    $data['total'] = intval($total);
    $data['list'] = $list;
    $return['error'] = FALSE;
    $return['data'] = $data;
    return $return;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:35,代码来源:get_extra_filters.php

示例7: bin2hex

     }
     break;
 case 'get_sensor_ip':
     $result = Av_sensor::get_ip_by_id($dbconn, $asset);
     break;
 case 'get_system_uuid':
     $result = Util::get_encryption_key();
     break;
 case 'get_varhex':
     $result = bin2hex(inet_pton($asset));
     break;
 case 'insert_host':
     list($hostip, $ctx, $hostname, $aliases) = explode('|', base64_decode($asset));
     $hostid = key(Asset_host::get_id_by_ips($dbconn, $hostip, $ctx));
     if (!Asset_host::is_in_db($dbconn, $hostid)) {
         list($sensor_list, $total) = Av_sensor::get_list($dbconn, array('where' => "acl_sensors.entity_id=UNHEX('{$ctx}')"));
         $sensors = array_keys($sensor_list);
         try {
             $hostid = Util::uuid();
             Util::disable_perm_triggers($dbconn, TRUE);
             $host = new Asset_host($dbconn, $hostid);
             $host->set_name($hostname);
             $host->set_ctx($ctx);
             $host_ip = array();
             $ips[$hostip] = array('ip' => $hostip, 'mac' => NULL);
             $host->set_ips($ips);
             $host->set_sensors($sensors);
             $host->set_fqdns($aliases);
             $host->save_in_db($dbconn);
         } catch (Exception $e) {
             $result = 'Impossible to save the host';
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:util.php

示例8: tab_discovery


//.........这里部分代码省略.........
        if ($schedule_type == "NW") {
            $show .= "<br><script language=javascript>showLayer('idSched', 6);</script>";
        }
    }
    if (isset($editdata['job_TYPE'])) {
        $sjTYPE[$editdata['job_TYPE']] = "SELECTED";
    } else {
        $sjTYPE['M'] = "SELECTED";
    }
    if (isset($editdata['day_of_month'])) {
        $dayofmonth = $editdata['day_of_month'];
    }
    if (isset($editdata['day_of_week'])) {
        $day[$editdata['day_of_week']] = "SELECTED";
    }
    if ($dayofweek_selected != "") {
        $day[$dayofweek_selected] = "SELECTED";
    }
    if (!$uroles['nessus']) {
        $name = "sr-" . substr($username, 0, 6) . "-" . time();
        $name = $editdata['name'] == "" ? $name : $editdata['name'];
        $nameout = $name . "<input type=hidden style='width:210px' name='sname' value='{$name}'>";
    } else {
        $nameout = "<input type=text style='width:210px' name='sname' value='" . ($sname_selected != "" ? "{$sname_selected}" : "{$editdata['name']}") . "'>";
    }
    $discovery = "<input type=\"hidden\" name=\"save_scan\" value=\"1\">";
    $discovery .= "<input type=\"hidden\" name=\"cred_type\" value=\"N\">";
    $discovery .= "<table width=\"80%\" cellspacing=\"4\">";
    $discovery .= "<tr>";
    $discovery .= "<input type=\"hidden\" name=\"smethod\" value=\"{$smethod}\">";
    $discovery .= "<td width=\"25%\" class='job_option'>" . Util::strong(_("Job Name") . ":") . "</td>";
    $discovery .= "<td style=\"text-align:left;\">{$nameout}</td>";
    $discovery .= "</tr>";
    list($sensor_list, $total) = Av_sensor::get_list($dbconn);
    $discovery .= "<tr>";
    $discovery .= "<td class='job_option'>" . Util::strong(_("Select Server") . ":") . "</td>";
    $discovery .= "<td style='text-align:left;'><select id='SVRid' style='width:212px' name='SVRid'>";
    $discovery .= "<option value='Null'>" . _("First Available Server-Distributed") . "</option>";
    foreach ($sensor_list as $_sensor_id => $sensor_data) {
        if (intval($sensor_data['properties']['has_vuln_scanner']) == 1) {
            $discovery .= "<option value=\"{$_sensor_id}\" ";
            if ($editdata['email'] == $_sensor_id || $editdata['scan_ASSIGNED'] == $_sensor_id) {
                $discovery .= " SELECTED";
            }
            if ($SVRid_selected == $_sensor_id) {
                $discovery .= " SELECTED";
            }
            $discovery .= ">" . strtoupper($sensor_data['name']) . " [" . $sensor_data['ip'] . "] </option>";
        }
    }
    $discovery .= <<<EOT
      </select>
    </td>
  </tr>
  <tr>
EOT;
    $discovery .= "<td class='job_option'>" . Util::strong(_("Profile") . ":") . "</td>";
    $discovery .= "<td style='text-align:left;'><select name='sid'>";
    $query = "";
    if ($username == "admin" || Session::am_i_admin()) {
        $query = "SELECT distinct(t1.id), t1.name, t1.description \n                 FROM vuln_nessus_settings t1 WHERE deleted='0'\n                 ORDER BY t1.name";
    } else {
        if (Session::is_pro()) {
            $users_and_entities = Acl::get_entities_to_assign($dbconn);
            if (Acl::am_i_proadmin()) {
                $users = Acl::get_my_users($dbconn, Session::get_session_user());
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:67,代码来源:sched.php

示例9: POST

}
if (POST('action') == "close_alarm") {
    if (check_uniqueid($prev_unique_id, $param_unique_id)) {
        Alarm::close($conn, POST('alarm'));
    } else {
        die(ossim_error("Can't do this action for security reasons."));
    }
}
if (POST('action') == "delete_alarm") {
    if (check_uniqueid($prev_unique_id, $param_unique_id)) {
        Alarm::delete($conn, POST('alarm'));
    } else {
        die(ossim_error("Can't do this action for security reasons."));
    }
}
$sensors = Av_sensor::get_list($conn, array(), FALSE, TRUE);
//Autocompleted
$autocomplete_keys = array('hosts');
$hosts_str = Autocomplete::get_autocomplete($conn, $autocomplete_keys);
$db_groups = Alarm_groups::get_dbgroups($conn);
list($alarm_group, $count) = Alarm_groups::get_grouped_alarms($conn, $group_type, $show_options, $hide_closed, $date_from, $date_to, $src_ip, $dst_ip, $sensor_query, $query, $directive_id, $intent, $num_events, $num_events_op, $tag, "LIMIT {$inf}, {$rows}", true);
?>

<!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 _("Control Panel");
?>
 </title>
	<meta http-equiv="Pragma" content="no-cache"/>
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:alarm_group_console.php

示例10: get_assets

function get_assets($conn, $id, $type, $host_types)
{
    $filters = array('where' => 'sensor_properties.has_nagios = 1', 'order_by' => 'priority desc');
    list($nagios_list, $nagios_total) = Av_sensor::get_list($conn, $filters);
    $sensor = NULL;
    $sensors = array();
    $type = strtolower($type);
    $id = strtoupper($id);
    // in_assets first
    $in_assets = is_in_assets($conn, $id, $type);
    //Host, sensor or server
    if (in_array($type, $host_types)) {
        $table = $type;
        if ($type == 'host') {
            $what = 'host_id';
            $table = 'host_ip';
        } else {
            $what = 'id';
        }
        $query = "SELECT INET6_NTOA(ip) AS ip FROM {$table} WHERE {$what} = UNHEX(?) LIMIT 1";
        $params = array($id);
        $rs = $conn->Execute($query, $params);
        if ($rs) {
            $ips = $rs->fields['ip'];
        }
        // Related sensors
        if ($type == 'host') {
            $sensors = Asset_host_sensors::get_sensors_by_id($conn, $id);
        } elseif ($type == 'sensor') {
            $sensors[$id] = $ips;
        } else {
            $s_id = Av_sensor::get_id_by_ip($conn, Util::get_default_admin_ip());
            $sensors[$s_id] = Util::get_default_admin_ip();
        }
    } elseif ($type == 'net') {
        $query = "SELECT ips FROM net WHERE id = UNHEX(?)";
        $params = array($id);
        $rs = $conn->Execute($query, $params);
        if ($rs) {
            $ips = $rs->fields['ips'];
        }
        // Related sensors
        $sensors = Asset_net_sensors::get_sensors_by_id($conn, $id);
    } elseif ($type == 'net_group' || $type == 'netgroup') {
        $query = "SELECT hex(ngr.net_id) as net_id, n.ips FROM net_group_reference AS ngr, net AS n\n            WHERE ngr.net_group_id = UNHEX(?) AND ngr.net_id = n.id";
        $net_ids = array($id);
        $params = $net_ids;
        $rs = $conn->Execute($query, $params);
        if ($rs) {
            $ipng = array();
            if (!$rs->EOF) {
                $net_ids = array();
            }
            while (!$rs->EOF) {
                $ipng[] = $rs->fields['ips'];
                $net_ids[] = $rs->fields['net_id'];
                $rs->MoveNext();
            }
            $ips = count($ipng) > 0 ? implode(",", $ipng) : "'0.0.0.0/0'";
            if (count($ipng) == 0) {
                $in_assets = 0;
            }
        }
        // Related sensors
        foreach ($net_ids as $net_id) {
            $_sensors_aux = Asset_net_sensors::get_sensors_by_id($conn, $net_id);
            foreach ($_sensors_aux as $sensor_id => $sensor_data) {
                $sensors[$sensor_id] = $sensor_data['ip'];
            }
        }
    } elseif ($type == 'host_group' || $type == 'hostgroup') {
        $query = "SELECT hex(hg.host_id) as host_id, INET6_NTOA(hi.ip) AS ip FROM host_group_reference hg, host_ip hi\n            WHERE hi.host_id=hg.host_id AND hg.host_group_id = UNHEX(?)";
        $host_ids = array($id);
        $params = $host_ids;
        $rs = $conn->Execute($query, $params);
        if ($rs) {
            $iphg = array();
            if (!$rs->EOF) {
                $host_ids = array();
            }
            while (!$rs->EOF) {
                $iphg[] = "'" . $rs->fields['ip'] . "'";
                $host_ids[] = $rs->fields['host_id'];
                $rs->MoveNext();
            }
            $ips = count($iphg) > 0 ? implode(',', $iphg) : "'0.0.0.0'";
            if (count($iphg) == 0) {
                $in_assets = 0;
            }
        }
        // Related sensors
        foreach ($host_ids as $host_id) {
            $_sensors_aux = Asset_host_sensors::get_sensors_by_id($conn, $host_id);
            foreach ($_sensors_aux as $sensor_id => $sensor_data) {
                $sensors[$sensor_id] = $sensor_data['ip'];
            }
        }
    }
    //Getting first Nagios sensor (By priority)
    if ($nagios_total > 0) {
//.........这里部分代码省略.........
开发者ID:jackpf,项目名称:ossim-arc,代码行数:101,代码来源:riskmaps_functions.php

示例11: ossim_db

 ****************************************************/
$host_id = '';
$sensor = 'local';
$scan_type = 'fast';
$ttemplate = 'T3';
$scan_ports = '1-65535';
$autodetected = 1;
$rdns = 1;
//Database connection
$db = new ossim_db();
$conn = $db->connect();
/****************************************************
********************* Sensors ***********************
****************************************************/
$filters = array('where' => 'sensor_properties.version <> ""', 'order_by' => 'sensor.name, priority DESC');
$sensor_list = Av_sensor::get_list($conn, $filters);
$sensor_list = $sensor_list[0];
/****************************************************
******************** Search Box ********************
****************************************************/
$autocomplete_keys = array('hosts', 'nets');
$assets = Autocomplete::get_autocomplete($conn, $autocomplete_keys);
/****************************************************
******************** Clear Scan ********************
****************************************************/
//Results will be deleted when a custom scan is executed or when an user forces it
if (intval($_REQUEST['clearscan']) == 1 || $_REQUEST['action'] == 'custom_scan') {
    try {
        //Delete scan task from Redis
        $av_scan = Av_scan::get_object_from_file($scan_file);
        if (is_object($av_scan) && !empty($av_scan)) {
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:index.php

示例12: GET

*
*/
require_once 'av_init.php';
Session::logcheck("environment-menu", "MonitorsNetwork");
$interface = GET('interface');
$proto = GET('proto');
ossim_valid($interface, OSS_ALPHA, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _('Interface'));
ossim_valid($proto, OSS_ALPHA, OSS_NULLABLE, 'illegal:' . _('Protocol'));
if (ossim_error()) {
    die(ossim_error());
}
$db = new ossim_db();
$conn = $db->connect();
$filters = array('where' => 'sensor_properties.has_ntop = 1', 'order_by' => 'priority DESC');
$ntop_list = array();
list($aux_ntop_list, $_total) = Av_sensor::get_list($conn, $filters);
if ($_total > 0) {
    foreach ($aux_ntop_list as $s_id => $s) {
        try {
            $i_faces = Av_sensor::get_interfaces($s['ip']);
            if (is_array($i_faces) && !empty($i_faces)) {
                $ntop_list[$s_id] = $s;
                $ntop_list[$s_id]['i_faces'] = $i_faces;
            }
        } catch (Exception $e) {
        }
    }
    //Sensor by default
    if ($sensor == '') {
        $s_id = key($ntop_list);
        $sensor = $ntop_list[$s_id]['ip'];
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:menu.php

示例13: array

Util::disable_perm_triggers($conn, TRUE);
$save = 0;
$info_error = array();
if ($action == 'insert') {
    $data = array();
    foreach ($_POST as $key => $value) {
        if (preg_match("/^ip(.+)/", $key, $found)) {
            ossim_valid(POST("{$key}"), OSS_IP_ADDR, 'illegal:' . _('Ip'));
            $num = $found[1];
            if (POST("ctx{$num}") == '') {
                $ctx = Session::get_default_ctx();
            } else {
                $ctx = POST("ctx{$num}");
                ossim_valid($ctx, OSS_HEX, 'illegal:' . _('Ctx'));
            }
            list($sensor_list, $total) = Av_sensor::get_list($conn, array('where' => "sensor.id = acl_sensors.sensor_id AND acl_sensors.entity_id = UNHEX('{$ctx}')"));
            $sensors = array_keys($sensor_list);
            if (POST("name{$num}") == '') {
                $hostname = POST("{$key}");
            } else {
                $hostname = POST("name{$num}");
                ossim_valid($hostname, OSS_HOST_NAME, 'illegal:' . _('Hostname'));
            }
            $fqdns = '';
            if (POST("fqdn{$num}") != '') {
                $fqdns = POST("fqdn{$num}");
                ossim_valid($fqdns, OSS_FQDNS, OSS_NULLABLE, 'illegal:' . _('FQDN'));
            }
            $data[POST("{$key}")] = array('hostname' => $hostname, 'fqdns' => $fqdns);
            if (ossim_error()) {
                $info_error[] = ossim_get_error();
开发者ID:alienfault,项目名称:ossim,代码行数:31,代码来源:add_hosts.php

示例14: get_report_data

function get_report_data($id = NULL)
{
    $conf = $GLOBALS['CONF'];
    $conf = !$conf ? new Ossim_conf() : $conf;
    $y = strftime('%Y', time() - 24 * 60 * 60 * 30);
    $m = strftime('%m', time() - 24 * 60 * 60 * 30);
    $d = strftime('%d', time() - 24 * 60 * 60 * 30);
    $reports['asset_report'] = array('report_name' => _('Asset Details'), 'report_id' => 'asset_report', 'type' => 'external', 'link_id' => 'link_ar_asset', 'link' => '', 'parameters' => array(array('name' => _('Host Name/IP/Network'), 'id' => 'ar_asset', 'type' => 'asset', 'default_value' => '')), 'access' => Session::menu_perms('environment-menu', 'PolicyHosts') || Session::menu_perms('environment-menu', 'PolicyNetworks'), 'send_by_email' => 0);
    $status_values = array('All' => array('text' => _('All')), 'Open' => array('text' => _('Open')), 'Assigned' => array('text' => _('Assigned')), 'Studying' => array('text' => _('Studying')), 'Waiting' => array('text' => _('Waiting')), 'Testing' => array('text' => _('Testing')), 'Closed' => array('text' => _('Closed')));
    $types_values = array('ALL' => array('text' => _('ALL')), 'Expansion Virus' => array('text' => _('Expansion Virus')), 'Corporative Nets Attack' => array('text' => _('Corporative Nets Attack')), 'Policy Violation' => array('text' => _('Policy Violation')), 'Security Weakness' => array('text' => _('Security Weakness')), 'Net Performance' => array('text' => _('Net Performance')), 'Applications and Systems Failures' => array('text' => _('Applications and Systems Failures')), 'Anomalies' => array('text' => _('Anomalies')), 'Vulnerability' => array('text' => _('Vulnerability')));
    $priority_values = array('High' => _('High'), 'Medium' => _('Medium'), 'Low' => _('Low'));
    $reports['tickets_report'] = array('report_name' => _('Tickets Report'), 'report_id' => 'tickets_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'alarm' => array('id' => 'alarm', 'name' => _('Alarm'), 'report_file' => 'os_reports/Tickets/Alarm.php'), 'event' => array('id' => 'event', 'name' => _('Event'), 'report_file' => 'os_reports/Tickets/Event.php'), 'anomaly' => array('id' => 'anomaly', 'name' => _('Anomaly'), 'report_file' => 'os_reports/Tickets/Anomaly.php'), 'vulnerability' => array('id' => 'vulnerability', 'name' => _('Vulnerability'), 'report_file' => 'os_reports/Tickets/Vulnerability.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'tr_date_from', 'date_to_id' => 'tr_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d'))), array('name' => _('Status'), 'id' => 'tr_status', 'type' => 'select', 'values' => $status_values), array('name' => _('Type'), 'id' => 'tr_type', 'type' => 'select', 'values' => $types_values), array('name' => _('Priority'), 'id' => 'tr_priority', 'type' => 'checkbox', 'values' => $priority_values)), 'access' => Session::menu_perms('analysis-menu', 'IncidentsIncidents'), 'send_by_email' => 1);
    $reports['alarm_report'] = array('report_name' => _('Alarms Report'), 'report_id' => 'alarm_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'top_attacker_host' => array('id' => 'top_attacker_host', 'name' => _('Top 10 Attacker Host'), 'report_file' => 'os_reports/Alarms/AttackerHosts.php'), 'top_attacked_host' => array('id' => 'top_attacked_host', 'name' => _('Top 10 Attacked Host'), 'report_file' => 'os_reports/Alarms/AttackedHosts.php'), 'used_port' => array('id' => 'used_port', 'name' => _('Top 10 Used Ports'), 'report_file' => 'os_reports/Alarms/UsedPorts.php'), 'top_events' => array('id' => 'top_events', 'name' => _('Top 15 Alarms'), 'report_file' => 'os_reports/Alarms/TopAlarms.php'), 'events_by_risk' => array('id' => 'events_by_risk', 'name' => _('Top 15 Alarms by Risk'), 'report_file' => 'os_reports/Alarms/TopAlarmsByRisk.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'ar_date_from', 'date_to_id' => 'ar_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d')))), 'access' => Session::menu_perms('analysis-menu', 'ControlPanelAlarms'), 'send_by_email' => 1);
    $reports['bc_pci_report'] = array('report_name' => _('Business & Compliance ISO PCI Report'), 'report_id' => 'bc_pci_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'threat_overview' => array('id' => 'threat_overview', 'name' => _('Threat overview'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/ThreatOverview.php'), 'bri_risks' => array('id' => 'bri_risks', 'name' => _('Business real impact risks'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/BusinessPotentialImpactsRisks.php'), 'ciap_impact' => array('id' => 'ciap_impact', 'name' => _('C.I.A Potential impact'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/CIAPotentialImpactsRisks.php'), 'pci_dss' => array('id' => 'pci_dss', 'name' => _('PCI-DSS 2.0'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/PCI-DSS.php'), 'pci_dss3' => array('id' => 'pci_dss3', 'name' => _('PCI-DSS 3.0'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/PCI-DSS3.php'), 'trends' => array('id' => 'trends', 'name' => _('Trends'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/Trends.php'), 'iso27002_p_impact' => array('id' => 'iso27002_p_impact', 'name' => _('ISO27002 Potential impact'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/ISO27002PotentialImpact.php'), 'iso27001' => array('id' => 'iso27001', 'name' => _('ISO27001'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/ISO27001.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'bc_pci_date_from', 'date_to_id' => 'bc_pci_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d')))), 'access' => Session::menu_perms('report-menu', 'ReportsReportServer'), 'send_by_email' => 1);
    $reports['siem_report'] = array('report_name' => _('SIEM Events'), 'report_id' => 'siem_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'top_attacker_host' => array('id' => 'top_attacker_host', 'name' => _('Top 10 Attacker Host'), 'report_file' => 'os_reports/Siem/AttackerHosts.php'), 'top_attacked_host' => array('id' => 'top_attacked_host', 'name' => _('Top 10 Attacked Host'), 'report_file' => 'os_reports/Siem/AttackedHosts.php'), 'used_port' => array('id' => 'used_port', 'name' => _('Top 10 Used Ports'), 'report_file' => 'os_reports/Siem/UsedPorts.php'), 'top_events' => array('id' => 'top_events', 'name' => _('Top 15 Events'), 'report_file' => 'os_reports/Siem/TopEvents.php'), 'events_by_risk' => array('id' => 'events_by_risk', 'name' => _('Top 15 Events by Risk'), 'report_file' => 'os_reports/Siem/TopEventsByRisk.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'sr_date_from', 'date_to_id' => 'sr_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d')))), 'access' => Session::menu_perms('analysis-menu', 'EventsForensics'), 'send_by_email' => 1);
    $reports['vulnerabilities_report'] = array('report_name' => _('Vulnerabilities Report'), 'report_id' => 'vulnerabilities_report', 'type' => 'external', 'target' => '_blank', 'link_id' => 'link_vr', 'link' => Menu::get_menu_url('../vulnmeter/lr_respdf.php?ipl=all&scantype=M', 'environment', 'vulnerabilities', 'overview'), 'access' => Session::menu_perms('analysis-menu', 'EventsVulnerabilities'), 'send_by_email' => 0);
    $reports['th_vuln_db'] = array('report_name' => _('Threats & Vulnerabilities Database'), 'report_id' => 'th_vuln_db', 'type' => 'external', 'link_id' => 'link_tvd', 'link' => Menu::get_menu_url('../vulnmeter/threats-db.php', 'environment', 'vulnerabilities', 'threat_database'), 'access' => Session::menu_perms('analysis-menu', 'EventsVulnerabilities'), 'send_by_email' => 0);
    $reports['ticket_status'] = array('report_name' => _('Tickets Status'), 'report_id' => 'ticket_status', 'type' => 'external', 'link_id' => 'link_tr', 'link' => Menu::get_menu_url('../report/incidentreport.php', 'analysis', 'tickets', 'tickets'), 'access' => Session::menu_perms('analysis-menu', 'IncidentsIncidents'), 'send_by_email' => 0);
    $db = new ossim_db();
    $conn = $db->connect();
    $user = Session::get_session_user();
    $session_list = Session::get_list($conn, 'ORDER BY login');
    if (preg_match('/pro|demo/', $conf->get_conf('ossim_server_version')) && !Session::am_i_admin()) {
        $myusers = Acl::get_my_users($conn, Session::get_session_user());
        if (count($myusers) > 0) {
            $is_pro_admin = 1;
        }
    }
    // User Log lists
    if (Session::am_i_admin()) {
        $user_values[''] = array('text' => _('All'));
        if ($session_list) {
            foreach ($session_list as $session) {
                $login = $session->get_login();
                $user_values[$login] = $login == $user ? array('text' => $login, 'selected' => TRUE) : array('text' => $login);
            }
        }
    } elseif ($is_pro_admin) {
        foreach ($myusers as $myuser) {
            $user_values[$myuser['login']] = array('text' => $myuser['login']);
            $user_values[$user] = array('text' => $user, 'selected' => TRUE);
        }
    } else {
        $user_values[$user] = array('text' => $user);
    }
    $code_list = Log_config::get_list($conn, 'ORDER BY descr');
    $action_values[''] = array('text' => _('All'));
    if ($code_list) {
        foreach ($code_list as $code_log) {
            $code_aux = $code_log->get_code();
            $action_values[$code_aux] = array('text' => '[' . sprintf("%02d", $code_aux) . '] ' . _(preg_replace('|%.*?%|', " ", $code_log->get_descr())));
        }
    }
    $reports['user_activity'] = array('report_name' => _('User Activity Report'), 'report_id' => 'user_activity', 'type' => 'external', 'link_id' => 'link_ua', 'link' => Menu::get_menu_url('../userlog/user_action_log.php', 'settings', 'settings', 'user_activity'), 'parameters' => array(array('name' => _('User'), 'id' => 'ua_user', 'type' => 'select', 'values' => $user_values), array('name' => _('Action'), 'id' => 'ua_action', 'type' => 'select', 'values' => $action_values)), 'access' => Session::menu_perms('settings-menu', 'ToolsUserLog'), 'send_by_email' => 0);
    $reports['geographic_report'] = array('report_name' => _('Geographic Report'), 'report_id' => 'geographic_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'geographic_report' => array('id' => 'geographic_report', 'name' => _('Geographic Report'), 'report_file' => 'os_reports/Various/Geographic.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'gr_date_from', 'date_to_id' => 'gr_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d')))), 'access' => Session::menu_perms('analysis-menu', 'EventsForensics'), 'send_by_email' => 1);
    //Sensor list
    $sensor_values[''] = array('text' => ' -- ' . _('Sensors no found') . ' -- ');
    $filters = array('order_by' => 'name');
    $sensor_list = Av_sensor::get_basic_list($conn, $filters);
    $filters = array('order_by' => 'priority desc');
    list($sensor_list, $sensor_total) = Av_sensor::get_list($conn, $filters);
    if ($sensor_total > 0) {
        $sensor_values = array();
        foreach ($sensor_list as $s) {
            $properties = $s['properties'];
            if ($properties['has_nagios']) {
                $sensor_values[$s['ip']] = array('text' => $s['name']);
            }
        }
    }
    /* Nagios link */
    $nagios_link = $conf->get_conf('nagios_link');
    $scheme = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
    $path = !empty($nagios_link) ? $nagios_link : '/nagios3/';
    $port = !empty($_SERVER['SERVER_PORT']) ? ':' . $_SERVER['SERVER_PORT'] : "";
    $nagios = $port . $path;
    $section_values = array(urlencode($nagios . 'cgi-bin/trends.cgi') => array('text' => _('Trends')), urlencode($nagios . 'cgi-bin/avail.cgi') => array('text' => _('Availability')), urlencode($nagios . 'cgi-bin/histogram.cgi') => array('text' => _('Event Histogram')), urlencode($nagios . 'cgi-bin/history.cgi?host=all') => array('text' => _('Event History')), urlencode($nagios . 'cgi-bin/summary.cgi') => array('text' => _('Event Summary')), urlencode($nagios . 'cgi-bin/notifications.cgi') => array('text' => _('Notifications')), urlencode($nagios . 'cgi-bin/showlog.cgi') => array('text' => _('Performance Info')));
    $reports['availability_report'] = array('report_name' => _('Availability Report'), 'report_id' => 'availability_report', 'type' => 'external', 'link_id' => 'link_avr', 'click' => "nagios_link('avr_nagios_link', 'avr_sensor', 'avr_section');", 'parameters' => array(array('name' => _('Sensor'), 'id' => 'avr_sensor', 'type' => 'select', 'values' => $sensor_values), array('name' => 'Nagioslink', 'id' => 'avr_nagios_link', 'type' => 'hidden', 'default_value' => urlencode($scheme)), array('name' => _('Section'), 'id' => 'avr_section', 'type' => 'select', 'values' => $section_values)), 'access' => Session::menu_perms('environment-menu', 'MonitorsAvailability'), 'send_by_email' => 0);
    $db->close();
    if ($id == NULL) {
        ksort($reports);
        return $reports;
    } else {
        return !empty($reports[$id]) ? $reports[$id] : array();
    }
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:86,代码来源:os_report_common.php

示例15: ossim_db

*
*
* 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('environment-menu', 'MonitorsAvailability');
$db = new ossim_db();
$conn = $db->connect();
$conf = $GLOBALS['CONF'];
$nagios_default = parse_url($conf->get_conf('nagios_link'));
$filters = array('order_by' => 'priority desc');
list($sensor_list, $sensor_total) = Av_sensor::get_list($conn, $filters);
$scheme = isset($nagios_default['scheme']) ? $nagios_default['scheme'] : 'http';
$path = isset($nagios_default['path']) ? $nagios_default['path'] : '/nagios3/';
$path = str_replace('//', '/', $path);
$port = isset($nagios_default['port']) ? ':' . $nagios_default['port'] : '';
$flag_opts = TRUE;
$flag_login = FALSE;
if ($path[0] != '/') {
    $path = '/' . $path;
}
$sensors_nagios = array();
$ng_selected = -1;
//Retrieving the sensor list with nagios activated.
if (is_array($sensor_list)) {
    foreach ($sensor_list as $sid => $s) {
        $properties = $s['properties'];
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:menu.php


注:本文中的Av_sensor::get_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。