#12251 added info in security in agent contact
This commit is contained in:
parent
dc714a5b9f
commit
e38246521d
|
@ -4845,6 +4845,46 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||
$data[1] = $time_elapsed;
|
||||
$table_contact->data[] = $data;
|
||||
|
||||
// SecurityMon line.
|
||||
$id_module_group = db_get_value('id_mg', 'tmodule_group', 'name', 'Security');
|
||||
$modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
[
|
||||
'id_agente' => $agent['id_agente'],
|
||||
'id_module_group' => $id_module_group,
|
||||
]
|
||||
);
|
||||
|
||||
if (is_array($modules) === true && count($modules) > 0) {
|
||||
$secmon_status = secmon_status($agent['id_agente']);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('SecurityMon').'</b>';
|
||||
$data[1] = ui_print_status_secmon_div($secmon_status, __('Total security modules: %s', count($modules)));
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
// Hardening line.
|
||||
$module_score = modules_get_agentmodule_id(io_safe_input('Hardening - Score'), $agent['id_agente']);
|
||||
$hardening = '';
|
||||
if (is_array($module_score) === true && key_exists('id_agente_modulo', $module_score) == true) {
|
||||
$raw_data_score = modules_get_raw_data($module_score['id_agente_modulo'], 0, time());
|
||||
$hardening = format_numeric($raw_data_score[0]['datos'], 2);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Hardening').'</b>';
|
||||
$data[1] = $hardening.' %';
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
// Vulnerabilities line.
|
||||
$vuls = get_vulnerabilities($agent['id_agente']);
|
||||
if (is_array($vuls) === true && count($vuls) > 0) {
|
||||
$score = get_score($vuls);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Vulnerability').'</b>';
|
||||
$data[1] = ui_print_status_vulnerability_div($score);
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
$agent_contact = html_print_div(
|
||||
[
|
||||
'class' => 'agent_details_header',
|
||||
|
|
|
@ -8252,18 +8252,21 @@ function ui_print_status_vulnerability_div(float $score)
|
|||
}
|
||||
|
||||
|
||||
function ui_print_status_secmon_div($status)
|
||||
function ui_print_status_secmon_div($status, $title=false)
|
||||
{
|
||||
$class = 'status_rounded_rectangles forced_title';
|
||||
if (($status) === 'normal') {
|
||||
return ui_print_div('group_view_ok '.$class, __('normal'));
|
||||
$title = ($title === false) ? __('normal') : $title;
|
||||
return ui_print_div('group_view_ok '.$class, $title);
|
||||
}
|
||||
|
||||
if (($status) === 'warning') {
|
||||
return ui_print_div('group_view_warn '.$class, __('warning'));
|
||||
$title = ($title === false) ? __('warning') : $title;
|
||||
return ui_print_div('group_view_warn '.$class, $title);
|
||||
}
|
||||
|
||||
if (($status) === 'critical') {
|
||||
return ui_print_div('group_view_crit '.$class, __('critical'));
|
||||
$title = ($title === false) ? __('critical') : $title;
|
||||
return ui_print_div('group_view_crit '.$class, $title);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue