#11326 security hardening
This commit is contained in:
parent
676b7a9302
commit
0e2d1ee47f
|
@ -6198,6 +6198,57 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||
<?php
|
||||
break;
|
||||
|
||||
case 'datetime':
|
||||
$date = (empty($data['value']) === true) ? '' : date('Y-m-d', $data['value']);
|
||||
$time = (empty($data['value']) === true) ? '' : date('H:i:s', $data['value']);
|
||||
ui_require_css_file('datepicker');
|
||||
ui_include_time_picker();
|
||||
ui_require_jquery_file(
|
||||
'ui.datepicker-'.get_user_language(),
|
||||
'include/javascript/i18n/'
|
||||
);
|
||||
|
||||
$inputDate = html_print_input_text(
|
||||
$data['name'].'_date',
|
||||
$date,
|
||||
'',
|
||||
false,
|
||||
10,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'off'
|
||||
);
|
||||
|
||||
$inputTime = html_print_input_text(
|
||||
$data['name'].'_time',
|
||||
$time,
|
||||
'',
|
||||
false,
|
||||
10,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'off'
|
||||
);
|
||||
$output .= html_print_div(
|
||||
[
|
||||
'content' => sprintf(
|
||||
'<div class="datetime-adv-opt">%s<span>:</span>%s</div>',
|
||||
$inputDate,
|
||||
$inputTime
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Ignore.
|
||||
break;
|
||||
|
|
|
@ -486,6 +486,40 @@ function ring_graph(
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Radar graph RADAR.
|
||||
*
|
||||
* @param array $chart_data Data.
|
||||
* @param array $options Options.
|
||||
*
|
||||
* @return string Output html charts
|
||||
*/
|
||||
function radar_graph(
|
||||
$chart_data,
|
||||
$options
|
||||
) {
|
||||
$chart = get_build_setup_charts('RADAR', $options, $chart_data);
|
||||
return $chart->render(true, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Line graph LINE.
|
||||
*
|
||||
* @param array $chart_data Data.
|
||||
* @param array $options Options.
|
||||
*
|
||||
* @return string Output html charts
|
||||
*/
|
||||
function line_graph(
|
||||
$chart_data,
|
||||
$options
|
||||
) {
|
||||
$chart = get_build_setup_charts('LINE', $options, $chart_data);
|
||||
return $chart->render(true, true);
|
||||
}
|
||||
|
||||
|
||||
function get_build_setup_charts($type, $options, $data)
|
||||
{
|
||||
global $config;
|
||||
|
@ -505,6 +539,14 @@ function get_build_setup_charts($type, $options, $data)
|
|||
$chart = $factory->create($factory::BAR);
|
||||
break;
|
||||
|
||||
case 'RADAR':
|
||||
$chart = $factory->create($factory::RADAR);
|
||||
break;
|
||||
|
||||
case 'LINE':
|
||||
$chart = $factory->create($factory::LINE);
|
||||
break;
|
||||
|
||||
default:
|
||||
// code...
|
||||
break;
|
||||
|
@ -1102,12 +1144,48 @@ function get_build_setup_charts($type, $options, $data)
|
|||
}
|
||||
break;
|
||||
|
||||
case 'RADAR':
|
||||
$chart->labels()->exchangeArray($options['labels']);
|
||||
|
||||
foreach ($data as $key => $dataset) {
|
||||
$dataSet1 = $chart->createDataSet();
|
||||
$dataSet1->setLabel($dataset['label']);
|
||||
$dataSet1->setBackgroundColor($dataset['backgroundColor']);
|
||||
$dataSet1->setBorderColor($dataset['borderColor']);
|
||||
$dataSet1->setPointBackgroundColor($dataset['pointBackgroundColor']);
|
||||
$dataSet1->setPointBorderColor($dataset['pointBorderColor']);
|
||||
$dataSet1->setPointHoverBackgroundColor($dataset['pointHoverBackgroundColor']);
|
||||
$dataSet1->setPointHoverBorderColor($dataset['pointHoverBorderColor']);
|
||||
$dataSet1->data()->exchangeArray($dataset['data']);
|
||||
$chart->addDataSet($dataSet1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'LINE':
|
||||
$chart->labels()->exchangeArray($options['labels']);
|
||||
|
||||
foreach ($data as $key => $dataset) {
|
||||
$dataSet1 = $chart->createDataSet();
|
||||
$dataSet1->setLabel($dataset['label']);
|
||||
$dataSet1->setBackgroundColor($dataset['backgroundColor']);
|
||||
$dataSet1->setBorderColor($dataset['borderColor']);
|
||||
$dataSet1->setPointBackgroundColor($dataset['pointBackgroundColor']);
|
||||
$dataSet1->setPointBorderColor($dataset['pointBorderColor']);
|
||||
$dataSet1->setPointHoverBackgroundColor($dataset['pointHoverBackgroundColor']);
|
||||
$dataSet1->setPointHoverBorderColor($dataset['pointHoverBorderColor']);
|
||||
$dataSet1->data()->exchangeArray($dataset['data']);
|
||||
$chart->addDataSet($dataSet1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Not possible.
|
||||
break;
|
||||
}
|
||||
|
||||
$chart->addDataSet($setData);
|
||||
if ($type !== 'RADAR' && $type !== 'LINE') {
|
||||
$chart->addDataSet($setData);
|
||||
}
|
||||
|
||||
return $chart;
|
||||
}
|
||||
|
|
|
@ -1744,6 +1744,20 @@ $external_tools['text'] = html_print_menu_button(
|
|||
|
||||
$external_tools['active'] = ($tab === 'external_tools');
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
// External Tools tab.
|
||||
$security_hardening['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=security_hardening&id_agente='.$id_agente,
|
||||
'image' => 'images/external-tools@svg.svg',
|
||||
'title' => __('Security hardening'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$security_hardening['active'] = ($tab === 'security_hardening');
|
||||
}
|
||||
|
||||
$onheader = [
|
||||
'manage' => ($managetab ?? null),
|
||||
'main' => ($maintab ?? null),
|
||||
|
@ -1761,6 +1775,7 @@ $onheader = [
|
|||
'sap_view' => ($saptab ?? null),
|
||||
'ncm_view' => ($ncm_tab ?? null),
|
||||
'external_tools' => ($external_tools ?? null),
|
||||
'security_hardening' => ($security_hardening ?? null),
|
||||
'incident' => ($incidenttab ?? null),
|
||||
'omnishell' => ($omnishellTab ?? null),
|
||||
];
|
||||
|
@ -1941,6 +1956,10 @@ switch ($tab) {
|
|||
$tab_name = __('External Tools');
|
||||
break;
|
||||
|
||||
case 'security_hardening':
|
||||
$tab_name = __('Security hardening');
|
||||
break;
|
||||
|
||||
default:
|
||||
$tab_name = '';
|
||||
$help_header = '';
|
||||
|
@ -2086,6 +2105,10 @@ switch ($tab) {
|
|||
include 'external_tools.php';
|
||||
break;
|
||||
|
||||
case 'security_hardening':
|
||||
enterprise_include('operation/agentes/security_hardening.php');
|
||||
break;
|
||||
|
||||
case 'extension':
|
||||
$found = false;
|
||||
foreach ($config['extensions'] as $extension) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Copyright (c) 2007-2008 Ramon Novoa <rnovoa@artica.es>
|
||||
# Copyright (c) 2007-2023 Pandora FMS.
|
||||
# Copyright (c) 2007-2008 Artica Soluciones Tecnologicas S.L.
|
||||
#
|
||||
# tentacle_client.pl Tentacle Client. See https://pandorafms.com/docs/ for
|
||||
# protocol description.
|
||||
|
@ -1095,7 +1095,7 @@ Protocol description and more info at: L<< https://pandorafms.com/manual/en/docu
|
|||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright (c) 2005-2023 Pandora FMS
|
||||
Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L
|
||||
|
||||
=cut
|
||||
|
||||
|
|
Loading…
Reference in New Issue