mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
#12250 new report detail security
This commit is contained in:
parent
7ec2871c3e
commit
2db0d05a37
@ -1084,6 +1084,15 @@ switch ($action) {
|
||||
$period = $item['period'];
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
$group = $item['id_group'];
|
||||
$es = json_decode($item['external_source'], true);
|
||||
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
|
||||
$security_hardening_score = $es['security_hardening_score'];
|
||||
$vulnerabilities_status = $es['vulnerabilities_status'];
|
||||
$secmon_status = $es['secmon_status'];
|
||||
break;
|
||||
|
||||
default:
|
||||
// It's not possible.
|
||||
break;
|
||||
@ -3913,6 +3922,76 @@ if (is_metaconsole() === true) {
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_secmon_status" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Secmon status');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('ALL'),
|
||||
'critical' => __('CRITICAL'),
|
||||
'warning' => __('WARNING'),
|
||||
],
|
||||
'secmon_status',
|
||||
$secmon_status,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_security_hardening_score" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Security hardening score');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('ALL'),
|
||||
'90' => __('< 90%'),
|
||||
'80' => __('< 80%'),
|
||||
'70' => __('< 70%'),
|
||||
'60' => __('< 60%'),
|
||||
'50' => __('< 50%'),
|
||||
'40' => __('< 40%'),
|
||||
'30' => __('< 30%'),
|
||||
'20' => __('< 20%'),
|
||||
'10' => __('< 10%'),
|
||||
],
|
||||
'security_hardening_score',
|
||||
(empty($security_hardening_score) === false) ? $security_hardening_score : 'all',
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_status" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Vulnerabilities status');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('ALL'),
|
||||
'crit' => __('CRITICAL'),
|
||||
'warn' => __('WARNING'),
|
||||
],
|
||||
'vulnerabilities_status',
|
||||
$vulnerabilities_status,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr id="row_status_check" class="datos">
|
||||
@ -6850,6 +6929,9 @@ function chooseType() {
|
||||
$("#row_cat_security_hardening").hide();
|
||||
$("#row_ignore_skipped").hide();
|
||||
$("#row_status_check").hide();
|
||||
$("#row_secmon_status").hide();
|
||||
$("#row_security_hardening_score").hide();
|
||||
$("#row_vulnerabilities_status").hide();
|
||||
|
||||
// SLA list default state.
|
||||
$("#sla_list").hide();
|
||||
@ -7749,6 +7831,14 @@ function chooseType() {
|
||||
$("#row_group").show();
|
||||
$('#row_period').show();
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
$("#row_group").show();
|
||||
$("#row_custom_field_filter").show();
|
||||
$("#row_secmon_status").show();
|
||||
$("#row_security_hardening_score").show();
|
||||
$("#row_vulnerabilities_status").show();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
|
@ -2045,6 +2045,16 @@ switch ($action) {
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['secmon_status'] = get_parameter('secmon_status');
|
||||
$es['security_hardening_score'] = get_parameter('security_hardening_score');
|
||||
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$values['period'] = get_parameter('period');
|
||||
$values['top_n'] = get_parameter(
|
||||
@ -2977,6 +2987,16 @@ switch ($action) {
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['secmon_status'] = get_parameter('secmon_status');
|
||||
$es['security_hardening_score'] = get_parameter('security_hardening_score');
|
||||
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$values['period'] = get_parameter('period');
|
||||
$values['top_n'] = get_parameter(
|
||||
|
@ -1023,6 +1023,14 @@ function reporting_make_reporting_data(
|
||||
);
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
$report['contents'][] = reporting_vuls_by_agent(
|
||||
$report,
|
||||
$content,
|
||||
$type
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
|
@ -507,6 +507,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
|
||||
case 'evolution':
|
||||
reporting_evolution_graph($table, $item);
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
reporting_html_vuls_by_agent($table, $item);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($item['type'] == 'agent_module') {
|
||||
@ -522,6 +526,70 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to print the all vulnerabilities by agent.
|
||||
*
|
||||
* @param object $table Head table or false if it comes from pdf.
|
||||
* @param array $item Items data.
|
||||
* @param integer $pdf Flag for return table.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function reporting_html_vuls_by_agent($table, $item, $pdf=0)
|
||||
{
|
||||
$table->width = '99%';
|
||||
$table->styleTable = 'border: 0px;';
|
||||
$table->colspan[2][0] = 3;
|
||||
$table1 = new stdClass();
|
||||
$table1->headstyle[0] = 'text-align: left';
|
||||
$table1->headstyle[1] = 'text-align: left';
|
||||
$table1->headstyle[2] = 'text-align: left';
|
||||
$table1->width = '99%';
|
||||
$table1->class = 'info_table';
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->rowclass[0] = '';
|
||||
$table1->head[0] = __('Agent');
|
||||
$table1->head[1] = __('OS');
|
||||
$table1->head[2] = __('OS Version');
|
||||
$table1->head[3] = __('Group');
|
||||
$table1->head[4] = __('Ip');
|
||||
$table1->head[5] = __('Status');
|
||||
$table1->head[6] = __('SecMon');
|
||||
$table1->head[7] = __('Hardening');
|
||||
$table1->head[8] = __('Vulnerability');
|
||||
$table1->head[9] = __('Last contact');
|
||||
$table1->head[10] = __('L.S. Change');
|
||||
|
||||
$row = 1;
|
||||
foreach ($item['data'] as $key => $vul) {
|
||||
$table1->data[$row][0] = $vul['alias'];
|
||||
$table1->data[$row][2] = $vul['name'];
|
||||
$table1->data[$row][3] = $vul['os_version'];
|
||||
$table1->data[$row][4] = $vul['nombre_gr'];
|
||||
$table1->data[$row][5] = $vul['direccion'];
|
||||
$table1->data[$row][6] = $vul['status'];
|
||||
$table1->data[$row][7] = $vul['secmon'];
|
||||
$table1->data[$row][8] = $vul['hardening'];
|
||||
$table1->data[$row][9] = $vul['vulnerabilities'];
|
||||
$table1->data[$row][10] = $vul['ultimo_contacto'];
|
||||
$table1->data[$row][11] = $vul['last_status_c'];
|
||||
$row++;
|
||||
}
|
||||
|
||||
if ($pdf === 1) {
|
||||
$table1->title = $item['title'];
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->titlestyle = 'text-align:left;';
|
||||
}
|
||||
|
||||
$table->data[2][0] = html_print_table($table1, true);
|
||||
|
||||
if ($pdf === 1) {
|
||||
return html_print_table($table1, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to print the security hardening evolution.
|
||||
*
|
||||
|
@ -1003,6 +1003,11 @@ function reports_get_report_types($template=false, $not_editor=false)
|
||||
'optgroup' => __('Security hardening'),
|
||||
'name' => __('Evolution'),
|
||||
];
|
||||
|
||||
$types['vuls_by_agent'] = [
|
||||
'optgroup' => __('Vulnerabilities'),
|
||||
'name' => __('Detailed security report'),
|
||||
];
|
||||
}
|
||||
|
||||
return $types;
|
||||
|
Loading…
x
Reference in New Issue
Block a user