Exemplo n.º 1
0
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
require_once 'deploy_common.php';
//Checking perms
check_deploy_perms();
$db = new ossim_db(TRUE);
$conn = $db->connect();
$id = GET("location");
ossim_valid($id, OSS_HEX, 'illegal:' . _("Action"));
if (ossim_error()) {
    die(ossim_error());
}
$checks = Locations::get_location_checks($conn, $id);
$elems = array('0' => _('IDS'), '1' => _('Vulnerability Scans'), '2' => _('Passive Inventory'), '3' => _('Active Inventory'), '4' => _('Netflow Monitoring'));
?>
<!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 _("OSSIM Framework");
?>
 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	
	<?php 
//CSS Files
$_files = array();
Exemplo n.º 2
0
function modify_location_services($conn, $data)
{
    $id = $data['id'];
    $service = $data['service'];
    $value = $data['value'];
    ossim_valid($id, OSS_HEX, 'illegal:' . _("Network ID"));
    ossim_valid($service, OSS_ALPHA, 'illegal:' . _("Service "));
    ossim_valid($value, OSS_DIGIT, 'illegal:' . _("Value"));
    if (ossim_error()) {
        $info_error = "Error: " . ossim_get_error();
        ossim_clean_error();
        $return['error'] = true;
        $return['msg'] = $info_error;
        return $return;
    }
    $checks = Locations::get_location_checks($conn, $id);
    $checks[$service] = $value;
    Locations::save_location_checks($conn, $id, $checks);
    Util::memcacheFlush(false);
    $return['error'] = false;
    $return['data'] = _('Service Modified Successfully');
    return $return;
}
Exemplo n.º 3
0
function colorize_nets($conn, $id, $location)
{
    $color = 0;
    $ignored = 0;
    $class = '';
    $checks = Locations::get_location_checks($conn, $location);
    $types = array('ids', 'vulns', 'passive', 'active', 'netflow');
    foreach ($types as $t_pos => $t) {
        if (strlen($checks) == 5 && $checks[$t_pos] == 0) {
            $ignored++;
        } else {
            $options = array("type" => $t, "percent" => false, "network" => $id);
            $var = get_network_visibility($conn, $options);
            if (!$var) {
                $color++;
            }
        }
    }
    $nerror = count($types) - $ignored;
    switch ($color) {
        case 0:
            $class = 'l_success';
            break;
        case $nerror:
            $class = 'l_error';
            break;
        default:
            $class = 'l_warning';
    }
    if ($class == 'l_success') {
        $options = array("type" => 'asset_network', "network" => $id);
        $a_n = get_asset_visibility($conn, $options);
        $options = array("type" => 'asset_server', "network" => $id);
        $a_s = get_asset_visibility($conn, $options);
        $class = $a_n[0] + $a_s[0] < 200 ? 'l_warning' : $class;
    }
    return $class;
}