mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 17:25:26 +02:00
#11807 new report list of checks agent
This commit is contained in:
parent
dd453507d2
commit
61839db7ff
@ -4,6 +4,8 @@ ALTER TABLE `treport_content` ADD COLUMN `cat_security_hardening` INT NOT NULL
|
|||||||
|
|
||||||
ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT 0;
|
ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
ALTER TABLE `treport_content` ADD COLUMN `status_of_check` TINYTEXT;
|
||||||
|
|
||||||
UPDATE `twelcome_tip`
|
UPDATE `twelcome_tip`
|
||||||
SET title = 'Scheduled downtimes',
|
SET title = 'Scheduled downtimes',
|
||||||
url = 'https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#scheduled_downtimes'
|
url = 'https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#scheduled_downtimes'
|
||||||
|
@ -1050,6 +1050,14 @@ switch ($action) {
|
|||||||
$ignore_skipped = $item['ignore_skipped'];
|
$ignore_skipped = $item['ignore_skipped'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'list_checks':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
$recursion = $item['recursion'];
|
||||||
|
$cat_selected = $item['cat_security_hardening'];
|
||||||
|
$status_of_check = $item['status_of_check'];
|
||||||
|
$idAgent = $item['id_agent'];
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// It's not possible.
|
// It's not possible.
|
||||||
break;
|
break;
|
||||||
@ -3751,6 +3759,28 @@ $class = 'databox filters';
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_status_check" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Status of check');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
'PASS' => __('Passed'),
|
||||||
|
'FAIL' => __('Failed'),
|
||||||
|
'INVALID' => __('Skipped'),
|
||||||
|
],
|
||||||
|
'status_of_check',
|
||||||
|
$status_of_check,
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($is_enterprise) {
|
if ($is_enterprise) {
|
||||||
?>
|
?>
|
||||||
@ -6625,6 +6655,7 @@ function chooseType() {
|
|||||||
$("#row_use_prefix_notation").hide();
|
$("#row_use_prefix_notation").hide();
|
||||||
$("#row_cat_security_hardening").hide();
|
$("#row_cat_security_hardening").hide();
|
||||||
$("#row_ignore_skipped").hide();
|
$("#row_ignore_skipped").hide();
|
||||||
|
$("#row_status_check").hide();
|
||||||
|
|
||||||
// SLA list default state.
|
// SLA list default state.
|
||||||
$("#sla_list").hide();
|
$("#sla_list").hide();
|
||||||
@ -7500,6 +7531,13 @@ function chooseType() {
|
|||||||
$("#row_cat_security_hardening").show();
|
$("#row_cat_security_hardening").show();
|
||||||
$("#row_ignore_skipped").show();
|
$("#row_ignore_skipped").show();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'list_checks':
|
||||||
|
$("#row_group").show();
|
||||||
|
$("#row_agent").show();
|
||||||
|
$("#row_cat_security_hardening").show();
|
||||||
|
$("#row_status_check").show();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -2015,6 +2015,13 @@ switch ($action) {
|
|||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'list_checks':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$values['cat_security_hardening'] = get_parameter('cat_security_hardening');
|
||||||
|
$values['status_of_check'] = get_parameter('status_of_check');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$values['period'] = get_parameter('period');
|
$values['period'] = get_parameter('period');
|
||||||
$values['top_n'] = get_parameter(
|
$values['top_n'] = get_parameter(
|
||||||
@ -2916,6 +2923,13 @@ switch ($action) {
|
|||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'list_checks':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$values['cat_security_hardening'] = get_parameter('cat_security_hardening');
|
||||||
|
$values['status_of_check'] = get_parameter('status_of_check');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$values['period'] = get_parameter('period');
|
$values['period'] = get_parameter('period');
|
||||||
$values['top_n'] = get_parameter(
|
$values['top_n'] = get_parameter(
|
||||||
|
@ -963,6 +963,13 @@ function reporting_make_reporting_data(
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'list_checks':
|
||||||
|
$report['contents'][] = reporting_list_checks(
|
||||||
|
$report,
|
||||||
|
$content
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Default.
|
// Default.
|
||||||
break;
|
break;
|
||||||
|
@ -479,6 +479,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||||||
case 'vul_by_cat':
|
case 'vul_by_cat':
|
||||||
reporting_vul_by_cat_graph($table, $item);
|
reporting_vul_by_cat_graph($table, $item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'list_checks':
|
||||||
|
reporting_html_list_checks($table, $item);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item['type'] == 'agent_module') {
|
if ($item['type'] == 'agent_module') {
|
||||||
@ -494,6 +498,34 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to print HTML checks filtered by agent and category.
|
||||||
|
*
|
||||||
|
* @param object $table Head table or false if it comes from pdf.
|
||||||
|
* @param array $item Items data.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function reporting_html_list_checks($table, $item)
|
||||||
|
{
|
||||||
|
$table->rowclass[0] = '';
|
||||||
|
$table->colspan[0][1] = 3;
|
||||||
|
$table->data[1][0] = '<b>'.__('Id').'</b>';
|
||||||
|
$table->data[1][1] = '<b>'.__('Title').'</b>';
|
||||||
|
$table->data[1][2] = '<b>'.__('Category').'</b>';
|
||||||
|
$table->data[1][3] = '<b>'.__('Status').'</b>';
|
||||||
|
|
||||||
|
$row = 2;
|
||||||
|
foreach ($item['data'] as $key => $check) {
|
||||||
|
$table->data[$row][0] = $check['id'];
|
||||||
|
$table->data[$row][1] = $check['title'];
|
||||||
|
$table->data[$row][2] = $check['category'];
|
||||||
|
$table->data[$row][3] = $check['status'];
|
||||||
|
$row++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to print HTML top checks failed by category
|
* Function to print HTML top checks failed by category
|
||||||
*
|
*
|
||||||
@ -504,7 +536,6 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||||||
*/
|
*/
|
||||||
function reporting_html_top_n_categories_checks($table, $item)
|
function reporting_html_top_n_categories_checks($table, $item)
|
||||||
{
|
{
|
||||||
global $config;
|
|
||||||
$table->rowclass[0] = '';
|
$table->rowclass[0] = '';
|
||||||
$table->data[1][0] = '<b>'.__('Id').'</b>';
|
$table->data[1][0] = '<b>'.__('Id').'</b>';
|
||||||
$table->data[1][1] = '<b>'.__('Category').'</b>';
|
$table->data[1][1] = '<b>'.__('Category').'</b>';
|
||||||
|
@ -983,6 +983,11 @@ function reports_get_report_types($template=false, $not_editor=false)
|
|||||||
'optgroup' => __('Security hardening'),
|
'optgroup' => __('Security hardening'),
|
||||||
'name' => __('Vulnerabilities by category'),
|
'name' => __('Vulnerabilities by category'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$types['list_checks'] = [
|
||||||
|
'optgroup' => __('Security hardening'),
|
||||||
|
'name' => __('List of checks'),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $types;
|
return $types;
|
||||||
|
@ -1674,6 +1674,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
|
|||||||
`use_prefix_notation` TINYINT UNSIGNED NOT NULL DEFAULT 1,
|
`use_prefix_notation` TINYINT UNSIGNED NOT NULL DEFAULT 1,
|
||||||
`cat_security_hardening` INT NOT NULL DEFAULT 0,
|
`cat_security_hardening` INT NOT NULL DEFAULT 0,
|
||||||
`ignore_skipped` INT NOT NULL DEFAULT 0,
|
`ignore_skipped` INT NOT NULL DEFAULT 0,
|
||||||
|
`status_of_check` TINYTEXT,
|
||||||
PRIMARY KEY(`id_rc`),
|
PRIMARY KEY(`id_rc`),
|
||||||
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
|
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
|
||||||
ON UPDATE CASCADE ON DELETE CASCADE
|
ON UPDATE CASCADE ON DELETE CASCADE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user