mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
#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
|
<?php
|
||||||
break;
|
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:
|
default:
|
||||||
// Ignore.
|
// Ignore.
|
||||||
break;
|
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)
|
function get_build_setup_charts($type, $options, $data)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
@ -505,6 +539,14 @@ function get_build_setup_charts($type, $options, $data)
|
|||||||
$chart = $factory->create($factory::BAR);
|
$chart = $factory->create($factory::BAR);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'RADAR':
|
||||||
|
$chart = $factory->create($factory::RADAR);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'LINE':
|
||||||
|
$chart = $factory->create($factory::LINE);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// code...
|
// code...
|
||||||
break;
|
break;
|
||||||
@ -1102,12 +1144,48 @@ function get_build_setup_charts($type, $options, $data)
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
// Not possible.
|
// Not possible.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$chart->addDataSet($setData);
|
if ($type !== 'RADAR' && $type !== 'LINE') {
|
||||||
|
$chart->addDataSet($setData);
|
||||||
|
}
|
||||||
|
|
||||||
return $chart;
|
return $chart;
|
||||||
}
|
}
|
||||||
|
@ -1744,6 +1744,20 @@ $external_tools['text'] = html_print_menu_button(
|
|||||||
|
|
||||||
$external_tools['active'] = ($tab === 'external_tools');
|
$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 = [
|
$onheader = [
|
||||||
'manage' => ($managetab ?? null),
|
'manage' => ($managetab ?? null),
|
||||||
'main' => ($maintab ?? null),
|
'main' => ($maintab ?? null),
|
||||||
@ -1761,6 +1775,7 @@ $onheader = [
|
|||||||
'sap_view' => ($saptab ?? null),
|
'sap_view' => ($saptab ?? null),
|
||||||
'ncm_view' => ($ncm_tab ?? null),
|
'ncm_view' => ($ncm_tab ?? null),
|
||||||
'external_tools' => ($external_tools ?? null),
|
'external_tools' => ($external_tools ?? null),
|
||||||
|
'security_hardening' => ($security_hardening ?? null),
|
||||||
'incident' => ($incidenttab ?? null),
|
'incident' => ($incidenttab ?? null),
|
||||||
'omnishell' => ($omnishellTab ?? null),
|
'omnishell' => ($omnishellTab ?? null),
|
||||||
];
|
];
|
||||||
@ -1941,6 +1956,10 @@ switch ($tab) {
|
|||||||
$tab_name = __('External Tools');
|
$tab_name = __('External Tools');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'security_hardening':
|
||||||
|
$tab_name = __('Security hardening');
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$tab_name = '';
|
$tab_name = '';
|
||||||
$help_header = '';
|
$help_header = '';
|
||||||
@ -2086,6 +2105,10 @@ switch ($tab) {
|
|||||||
include 'external_tools.php';
|
include 'external_tools.php';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'security_hardening':
|
||||||
|
enterprise_include('operation/agentes/security_hardening.php');
|
||||||
|
break;
|
||||||
|
|
||||||
case 'extension':
|
case 'extension':
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach ($config['extensions'] as $extension) {
|
foreach ($config['extensions'] as $extension) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007-2008 Ramon Novoa <rnovoa@artica.es>
|
# 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
|
# tentacle_client.pl Tentacle Client. See https://pandorafms.com/docs/ for
|
||||||
# protocol description.
|
# protocol description.
|
||||||
@ -1095,7 +1095,7 @@ Protocol description and more info at: L<< https://pandorafms.com/manual/en/docu
|
|||||||
|
|
||||||
=head1 COPYRIGHT
|
=head1 COPYRIGHT
|
||||||
|
|
||||||
Copyright (c) 2005-2023 Pandora FMS
|
Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user