mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
#12253 added reports vulnerabilities
This commit is contained in:
parent
5104d706f6
commit
bb9cd81244
@ -1084,6 +1084,18 @@ switch ($action) {
|
|||||||
$period = $item['period'];
|
$period = $item['period'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
break;
|
||||||
|
|
||||||
case 'vuls_by_agent':
|
case 'vuls_by_agent':
|
||||||
$group = $item['id_group'];
|
$group = $item['id_group'];
|
||||||
$es = json_decode($item['external_source'], true);
|
$es = json_decode($item['external_source'], true);
|
||||||
@ -7865,6 +7877,18 @@ function chooseType() {
|
|||||||
$('#row_period').show();
|
$('#row_period').show();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$("#row_group").show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$("#row_group").show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$("#row_group").show();
|
||||||
|
break;
|
||||||
|
|
||||||
case 'vuls_by_agent':
|
case 'vuls_by_agent':
|
||||||
$("#row_group").show();
|
$("#row_group").show();
|
||||||
$("#row_custom_field_filter").show();
|
$("#row_custom_field_filter").show();
|
||||||
|
@ -2045,6 +2045,21 @@ switch ($action) {
|
|||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'vuls_by_agent':
|
case 'vuls_by_agent':
|
||||||
$values['id_group'] = get_parameter('combo_group');
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||||
@ -2987,6 +3002,21 @@ switch ($action) {
|
|||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'vuls_by_agent':
|
case 'vuls_by_agent':
|
||||||
$values['id_group'] = get_parameter('combo_group');
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||||
|
@ -1023,6 +1023,30 @@ function reporting_make_reporting_data(
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$report['contents'][] = reporting_vuls_severity_graph(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$report['contents'][] = reporting_vuls_attack_complexity_graph(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$report['contents'][] = reporting_vuls_by_packages_graph(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'vuls_by_agent':
|
case 'vuls_by_agent':
|
||||||
$report['contents'][] = reporting_vuls_by_agent(
|
$report['contents'][] = reporting_vuls_by_agent(
|
||||||
$report,
|
$report,
|
||||||
|
@ -508,6 +508,18 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
|
|||||||
reporting_evolution_graph($table, $item);
|
reporting_evolution_graph($table, $item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
reporting_html_vuls_severity_graph($table, $item);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
reporting_html_vuls_attack_complexity($table, $item);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
reporting_html_vuls_by_packages($table, $item);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'vuls_by_agent':
|
case 'vuls_by_agent':
|
||||||
reporting_html_vuls_by_agent($table, $item);
|
reporting_html_vuls_by_agent($table, $item);
|
||||||
break;
|
break;
|
||||||
@ -526,6 +538,78 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to print total vulnerabilities by packages in graph.
|
||||||
|
*
|
||||||
|
* @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_packages($table, $item, $pdf=0)
|
||||||
|
{
|
||||||
|
$table->rowclass[0] = '';
|
||||||
|
$table->colspan['chart']['cell'] = 3;
|
||||||
|
$table->cellstyle['chart']['cell'] = 'text-align: center;';
|
||||||
|
$table->data['chart']['cell'] = $item['chart'];
|
||||||
|
|
||||||
|
if ($pdf === 1) {
|
||||||
|
return html_print_table($table, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to print attack complexity in graph
|
||||||
|
*
|
||||||
|
* @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_attack_complexity($table, $item, $pdf=0)
|
||||||
|
{
|
||||||
|
$table->rowclass[0] = '';
|
||||||
|
$table->colspan['chart']['cell'] = 3;
|
||||||
|
$table->cellstyle['chart']['cell'] = 'text-align: center;';
|
||||||
|
$table->data['chart']['cell'] = html_print_div(
|
||||||
|
[
|
||||||
|
'content' => $item['chart'],
|
||||||
|
'style' => 'width: 450px; height: 300px; margin: 0 auto;',
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($pdf === 1) {
|
||||||
|
return html_print_table($table, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to print the severity vuls in graph.
|
||||||
|
*
|
||||||
|
* @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_severity_graph($table, $item, $pdf=0)
|
||||||
|
{
|
||||||
|
$table->rowclass[0] = '';
|
||||||
|
$table->colspan['chart']['cell'] = 3;
|
||||||
|
$table->cellstyle['chart']['cell'] = 'text-align: center;';
|
||||||
|
$table->data['chart']['cell'] = $item['chart'];
|
||||||
|
|
||||||
|
if ($pdf === 1) {
|
||||||
|
return html_print_table($table, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to print the all vulnerabilities by agent.
|
* Function to print the all vulnerabilities by agent.
|
||||||
*
|
*
|
||||||
|
@ -1004,6 +1004,21 @@ function reports_get_report_types($template=false, $not_editor=false)
|
|||||||
'name' => __('Evolution'),
|
'name' => __('Evolution'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$types['vuls_severity_graph'] = [
|
||||||
|
'optgroup' => __('Vulnerabilities'),
|
||||||
|
'name' => __('Severity graph bar'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$types['vuls_attack_complexity'] = [
|
||||||
|
'optgroup' => __('Vulnerabilities'),
|
||||||
|
'name' => __('Attack complexity graph donut'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$types['vuls_by_packages'] = [
|
||||||
|
'optgroup' => __('Vulnerabilities'),
|
||||||
|
'name' => __('By packages in graph pie'),
|
||||||
|
];
|
||||||
|
|
||||||
$types['vuls_by_agent'] = [
|
$types['vuls_by_agent'] = [
|
||||||
'optgroup' => __('Vulnerabilities'),
|
'optgroup' => __('Vulnerabilities'),
|
||||||
'name' => __('Detailed security report'),
|
'name' => __('Detailed security report'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user