Merge branch 'ent-11125-pandora-security-monitoring-vulnerability-scanner' into 'develop'
Add support for inventory vulnerability scans. See merge request artica/pandorafms!6487
This commit is contained in:
commit
7fdca7aa12
|
@ -271,7 +271,7 @@ module_plugin pandora_netusage
|
|||
module_plugin autodiscover --default
|
||||
|
||||
# Plugin for inventory on the agent.
|
||||
#module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
|
||||
#module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route vulnerabilities
|
||||
|
||||
# Log collection modules. This will collect log files for forensic analysis and store everything
|
||||
# This is for LOG monitoring. Different than log monitoring.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -922,6 +922,23 @@ $tableAdvancedAgent->data['safe_operation'][] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
$tableAdvancedAgent->data['vul_scan_enabled'][] = html_print_label_input_block(
|
||||
__('Vulnerability scanning'),
|
||||
html_print_select(
|
||||
[
|
||||
0 => __('Disabled'),
|
||||
1 => __('Enabled'),
|
||||
2 => __('Use global settings'),
|
||||
],
|
||||
'vul_scan_enabled',
|
||||
$vul_scan_enabled,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
ui_toggle(
|
||||
html_print_table($tableAdvancedAgent, true),
|
||||
'<span class="subsection_header_title">'.__('Advanced options').'</span>',
|
||||
|
|
|
@ -231,6 +231,7 @@ if ($create_agent) {
|
|||
$quiet = (int) get_parameter('quiet', 0);
|
||||
$cps = (int) get_parameter_switch('cps', -1);
|
||||
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
||||
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
||||
|
||||
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
|
||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||
|
@ -298,6 +299,7 @@ if ($create_agent) {
|
|||
'quiet' => $quiet,
|
||||
'cps' => $cps,
|
||||
'fixed_ip' => $fixed_ip,
|
||||
'vul_scan_enabled' => $vul_scan_enabled,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -610,6 +612,7 @@ if ($id_agente) {
|
|||
$agent_wizard['active'] = false;
|
||||
}
|
||||
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
|
||||
if ($has_remote_conf !== false) {
|
||||
$agent_name = agents_get_name($id_agente);
|
||||
|
@ -642,24 +645,26 @@ if ($id_agente) {
|
|||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'vulnerabilities' => $vulnerabilities,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
];
|
||||
} else {
|
||||
$onheader = [
|
||||
'view' => $viewtab,
|
||||
'separator' => '',
|
||||
'main' => $maintab,
|
||||
'module' => $moduletab,
|
||||
'ncm' => $ncm_tab,
|
||||
'alert' => $alerttab,
|
||||
'template' => $templatetab,
|
||||
'inventory' => $inventorytab,
|
||||
'pluginstab' => $pluginstab,
|
||||
'policy' => (enterprise_installed() === true) ? $policyTab : '',
|
||||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
'view' => $viewtab,
|
||||
'separator' => '',
|
||||
'main' => $maintab,
|
||||
'module' => $moduletab,
|
||||
'ncm' => $ncm_tab,
|
||||
'alert' => $alerttab,
|
||||
'template' => $templatetab,
|
||||
'inventory' => $inventorytab,
|
||||
'pluginstab' => $pluginstab,
|
||||
'policy' => (enterprise_installed() === true) ? $policyTab : '',
|
||||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'vulnerabilities' => $vulnerabilities,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -760,6 +765,11 @@ if ($id_agente) {
|
|||
$help_header = 'gis_tab';
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
$tab_name = __('Vulnerabilities');
|
||||
$help_header = 'vulnerabilities_tab';
|
||||
break;
|
||||
|
||||
case 'incident':
|
||||
$tab_name = __('Incidents');
|
||||
break;
|
||||
|
@ -1004,6 +1014,7 @@ if ($update_agent) {
|
|||
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
|
||||
$satellite_server = (int) get_parameter('satellite_server', 0);
|
||||
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
||||
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
||||
|
||||
if ($fields === false) {
|
||||
$fields = [];
|
||||
|
@ -1130,6 +1141,7 @@ if ($update_agent) {
|
|||
'safe_mode_module' => $safe_mode_module,
|
||||
'satellite_server' => $satellite_server,
|
||||
'fixed_ip' => $fixed_ip,
|
||||
'vul_scan_enabled' => $vul_scan_enabled,
|
||||
];
|
||||
|
||||
if ($config['metaconsole_agent_cache'] == 1) {
|
||||
|
@ -1287,6 +1299,7 @@ if ($id_agente) {
|
|||
$safe_mode = ($safe_mode_module) ? 1 : 0;
|
||||
$satellite_server = (int) $agent['satellite_server'];
|
||||
$fixed_ip = (int) $agent['fixed_ip'];
|
||||
$vul_scan_enabled = (int) $agent['vul_scan_enabled'];
|
||||
}
|
||||
|
||||
$update_module = (bool) get_parameter('update_module');
|
||||
|
@ -2425,6 +2438,10 @@ switch ($tab) {
|
|||
include 'agent_conf_gis.php';
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
include enterprise_include('godmode/agentes/vulnerabilities_editor.php');
|
||||
break;
|
||||
|
||||
case 'incident':
|
||||
include 'agent_incidents.php';
|
||||
break;
|
||||
|
|
|
@ -767,6 +767,7 @@ $table->data[$i][] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
|
||||
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
||||
|
||||
echo '<fieldset class="margin-bottom-10">';
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Vulnerability scanner@svg</title>
|
||||
<g id="Vulnerability-scanner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M1,15 C1.55228475,15 2,15.4477153 2,16 L2,18 L4,18 C4.55228475,18 5,18.4477153 5,19 C5,19.5522847 4.55228475,20 4,20 L1,20 C0.44771525,20 0,19.5522847 0,19 L2.22044605e-16,16 C2.22044605e-16,15.4477153 0.44771525,15 1,15 Z M19,15 C19.5522847,15 20,15.4477153 20,16 L20,19 C20,19.5522847 19.5522847,20 19,20 L16,20 C15.4477153,20 15,19.5522847 15,19 C15,18.4477153 15.4477153,18 16,18 L18,18 L18,16 C18,15.4477153 18.4477153,15 19,15 Z M10,3.054 L10.2249383,3.05813847 C13.4344251,3.17642824 16,5.81560306 16,9.054 L16,14.0937431 L13.104,16.031 L12.0698805,13.7307161 L14.2125487,13.4284958 C14.556044,13.3800462 14.7107272,12.9297411 14.4915053,12.6217094 L10.3337249,6.72755475 C10.2297804,6.58020088 10.0683722,6.50924823 9.91239579,6.53116927 C9.62831588,6.5712384 9.45479699,6.90055719 9.56613598,7.20888317 L10.9914706,11.1541491 L8.78753031,11.4650118 C8.51830424,11.5029857 8.34782116,11.7998997 8.42525378,12.0959539 L9.92,18.054 L4,14.0937431 L4,9.054 C4,5.81560306 6.56557489,3.17642824 9.77506174,3.05813847 L10,3.054 Z M4,0 C4.55228475,-1.01453063e-16 5,0.44771525 5,1 C5,1.55228475 4.55228475,2 4,2 L2,2 L2,4 C2,4.55228475 1.55228475,5 1,5 C0.44771525,5 2.22044605e-16,4.55228475 2.22044605e-16,4 L0,1 C0,0.44771525 0.44771525,1.01453063e-16 1,0 L4,0 Z M19,0 C19.5522847,1.01453063e-16 20,0.44771525 20,1 L20,4 C20,4.55228475 19.5522847,5 19,5 C18.4477153,5 18,4.55228475 18,4 L18,2 L16,2 C15.4477153,2 15,1.55228475 15,1 C15,0.44771525 15.4477153,-1.01453063e-16 16,0 Z" id="Scan" fill="#3F3F3F" transform="translate(10, 10) scale(1, -1) translate(-10, -10)"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -487,6 +487,10 @@ function config_update_config()
|
|||
$error_update[] = __('Legacy database HA');
|
||||
}
|
||||
|
||||
if (config_update_value('agent_vulnerabilities', get_parameter('agent_vulnerabilities'), true) === false) {
|
||||
$error_update[] = __('agent_vulnerabilities');
|
||||
}
|
||||
|
||||
if (config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'), true) === false) {
|
||||
$error_update[] = __('Ipam Ocuppied Manager Critical');
|
||||
}
|
||||
|
@ -2445,6 +2449,10 @@ function config_process_config()
|
|||
config_update_value('show_experimental_features', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['agent_vulnerabilities'])) {
|
||||
config_update_value('agent_vulnerabilities', 1);
|
||||
}
|
||||
|
||||
if (!isset($config['console_log_enabled'])) {
|
||||
config_update_value('console_log_enabled', 0);
|
||||
}
|
||||
|
|
|
@ -1025,6 +1025,7 @@ function get_build_setup_charts($type, $options, $data)
|
|||
$chart->setCircumference($options['circumference']);
|
||||
}
|
||||
|
||||
$stacked = false;
|
||||
if (isset($options['scales']) === true
|
||||
&& empty($options['scales']) === false
|
||||
&& is_array($options['scales']) === true
|
||||
|
@ -1088,6 +1089,13 @@ function get_build_setup_charts($type, $options, $data)
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($options['scales']['x']['stacked']) === true
|
||||
&& empty($options['scales']['x']['stacked']) === false
|
||||
) {
|
||||
$scales->getX()->setStacked($options['scales']['x']['stacked']);
|
||||
$stacked = true;
|
||||
}
|
||||
|
||||
if (isset($options['scales']['x']['ticks']) === true
|
||||
&& empty($options['scales']['x']['ticks']) === false
|
||||
&& is_array($options['scales']['x']['ticks']) === true
|
||||
|
@ -1137,6 +1145,13 @@ function get_build_setup_charts($type, $options, $data)
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($options['scales']['y']['stacked']) === true
|
||||
&& empty($options['scales']['y']['stacked']) === false
|
||||
) {
|
||||
$scales->getY()->setStacked($options['scales']['y']['stacked']);
|
||||
$stacked = true;
|
||||
}
|
||||
|
||||
if (isset($options['scales']['y']['ticks']) === true
|
||||
&& empty($options['scales']['y']['ticks']) === false
|
||||
&& is_array($options['scales']['y']['ticks']) === true
|
||||
|
@ -1253,11 +1268,37 @@ function get_build_setup_charts($type, $options, $data)
|
|||
break;
|
||||
|
||||
case 'BAR':
|
||||
$setData->setLabel('data')->setBackgroundColor($colors);
|
||||
$setData->setLabel('data')->setBorderColor($borders);
|
||||
$setData->setLabel('data')->setBorderWidth(2);
|
||||
|
||||
$setData->setLabel('data')->data()->exchangeArray(array_values($data));
|
||||
if (isset($options['multiple']) === true && empty($options['multiple']) === false) {
|
||||
$i = 0;
|
||||
foreach ($options['multiple'] as $key_label => $label) {
|
||||
$dataSet = $chart->createDataSet();
|
||||
$dataSet->setLabel($label);
|
||||
$dataSet->setBackgroundColor($colors[$i]);
|
||||
$dataSet->setBorderColor($borders[$i]);
|
||||
$dataSet->setBorderWidth(2);
|
||||
$dataSet->data()->exchangeArray(array_values($data[$key_label]));
|
||||
$chart->addDataSet($dataSet);
|
||||
$i++;
|
||||
}
|
||||
} else if ($chart->options()->getScales()->getX()->isStacked() === true) {
|
||||
$i = 0;
|
||||
foreach ($data as $key => $dataset) {
|
||||
$dataSet1 = $chart->createDataSet();
|
||||
$dataSet1->setBackgroundColor($colors[$i]);
|
||||
$dataSet1->setBorderColor($borders[$i]);
|
||||
$dataSet1->setLabel($dataset['label']);
|
||||
$dataSet1->setBorderWidth(2);
|
||||
$dataSet1->data()->exchangeArray($dataset['data']);
|
||||
$dataSet1->setStack($dataset['stack']);
|
||||
$chart->addDataSet($dataSet1);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$setData->setLabel('data')->setBackgroundColor($colors);
|
||||
$setData->setLabel('data')->setBorderColor($borders);
|
||||
$setData->setLabel('data')->setBorderWidth(2);
|
||||
$setData->setLabel('data')->data()->exchangeArray(array_values($data));
|
||||
}
|
||||
|
||||
// Para las horizontales.
|
||||
if (isset($options['axis']) === true
|
||||
|
@ -1272,6 +1313,7 @@ function get_build_setup_charts($type, $options, $data)
|
|||
foreach ($data as $key => $dataset) {
|
||||
$dataSet1 = $chart->createDataSet();
|
||||
$dataSet1->setBackgroundColor($dataset['backgroundColor']);
|
||||
$dataSet1->setLabel($dataset['label']);
|
||||
$dataSet1->setBorderColor($dataset['borderColor']);
|
||||
$dataSet1->setPointBackgroundColor($dataset['pointBackgroundColor']);
|
||||
$dataSet1->setPointBorderColor($dataset['pointBorderColor']);
|
||||
|
@ -1304,7 +1346,11 @@ function get_build_setup_charts($type, $options, $data)
|
|||
break;
|
||||
}
|
||||
|
||||
if ($type !== 'RADAR' && $type !== 'LINE') {
|
||||
if ($type !== 'RADAR'
|
||||
&& $type !== 'LINE'
|
||||
&& $stacked === false
|
||||
&& (isset($options['multiple']) === false || empty($options['multiple']) === true)
|
||||
) {
|
||||
$chart->addDataSet($setData);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,160 @@
|
|||
.details_table b {
|
||||
font-size: 12px;
|
||||
}
|
||||
.details_table {
|
||||
width: 99% !important;
|
||||
}
|
||||
|
||||
.dataTables_length {
|
||||
margin: 10px 0px 20px 20px;
|
||||
}
|
||||
|
||||
.custom-filter {
|
||||
width: 95%;
|
||||
margin: 21px auto;
|
||||
}
|
||||
|
||||
.custom-filter label {
|
||||
font-size: 13px !important;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dataTables_paginate.paging_simple_numbers {
|
||||
margin: 10px 20px 20px 0px;
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
|
||||
.row-graphs {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
max-width: 90%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.col-md-3 {
|
||||
width: 30%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-6 {
|
||||
width: 35%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-1 {
|
||||
width: 15%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-2 {
|
||||
width: 30%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-7 {
|
||||
width: 40%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-9 {
|
||||
width: 63%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.pdd_b_40px {
|
||||
padding-bottom: 40px !important;
|
||||
}
|
||||
#reach-metrics {
|
||||
margin-bottom: 45px;
|
||||
}
|
||||
|
||||
#reach-metrics .row-graphs {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
#score-bar {
|
||||
max-width: 85%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#bar {
|
||||
height: 100%;
|
||||
animation: load 2s;
|
||||
}
|
||||
.marks {
|
||||
color: #9f9f9f;
|
||||
}
|
||||
.title {
|
||||
font-size: 19px;
|
||||
font-weight: 600;
|
||||
color: #3f3f3f;
|
||||
}
|
||||
.score {
|
||||
font-weight: 700;
|
||||
font-size: 24px;
|
||||
color: #3f3f3f;
|
||||
}
|
||||
.message {
|
||||
color: #0000008c;
|
||||
}
|
||||
.status {
|
||||
font-size: 15px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.marks {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.labels-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0px 8px;
|
||||
}
|
||||
.date {
|
||||
font-weight: 400;
|
||||
color: #0000008c;
|
||||
margin-left: 13px;
|
||||
}
|
||||
.dt-buttons {
|
||||
display: flex;
|
||||
margin: 10px;
|
||||
margin-left: 0px;
|
||||
position: relative;
|
||||
}
|
||||
.dt-buttons button {
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
#content-bar {
|
||||
border: 1px solid #d7d7d7;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@media (max-width: 1500px) {
|
||||
.col-md-3 {
|
||||
width: 40%;
|
||||
}
|
||||
.col-md-1 {
|
||||
width: 20%;
|
||||
}
|
||||
.col-md-2 {
|
||||
width: 45%;
|
||||
}
|
||||
.col-md-6 {
|
||||
width: 88%;
|
||||
}
|
||||
.col-md-7 {
|
||||
width: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes load {
|
||||
from {
|
||||
width: 0%;
|
||||
}
|
||||
to {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
|
@ -45,6 +45,7 @@ ui_require_css_file('agent_view');
|
|||
|
||||
enterprise_include_once('operation/agentes/ver_agente.php');
|
||||
enterprise_include_once('include/functions_security_hardening.php');
|
||||
enterprise_include_once('include/functions_vulnerabilities.php');
|
||||
|
||||
check_login();
|
||||
if (is_ajax()) {
|
||||
|
@ -1858,7 +1859,6 @@ $external_tools['text'] = html_print_menu_button(
|
|||
$external_tools['active'] = ($tab === 'external_tools');
|
||||
|
||||
if (enterprise_installed() === true && security_hardening_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,
|
||||
|
@ -1871,6 +1871,26 @@ if (enterprise_installed() === true && security_hardening_installed() === true)
|
|||
$security_hardening['active'] = ($tab === 'security_hardening');
|
||||
}
|
||||
|
||||
if (function_exists('vulnerabilities_last_scan_agent') === true) {
|
||||
if (enterprise_installed() === true
|
||||
&& (int) $agent['vul_scan_enabled'] !== 0
|
||||
&& ((int) $agent['vul_scan_enabled'] === 1 || (int) $config['agent_vulnerabilities'] === 1)
|
||||
&& vulnerabilities_last_scan_agent($id_agente) !== 0
|
||||
) {
|
||||
$vulnerabilities['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=vulnerabilities&id_agente='.$id_agente,
|
||||
'image' => 'images/vulnerability_scan@svg.svg',
|
||||
'title' => __('Vulnerabilities'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$vulnerabilities['active'] = ($tab === 'vulnerabilities');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$onheader = [
|
||||
'manage' => ($managetab ?? null),
|
||||
'main' => ($maintab ?? null),
|
||||
|
@ -1889,6 +1909,7 @@ $onheader = [
|
|||
'ncm_view' => ($ncm_tab ?? null),
|
||||
'external_tools' => ($external_tools ?? null),
|
||||
'security_hardening' => ($security_hardening ?? null),
|
||||
'vulnerabilities' => ($vulnerabilities ?? null),
|
||||
'incident' => ($incidenttab ?? null),
|
||||
'omnishell' => ($omnishellTab ?? null),
|
||||
];
|
||||
|
@ -2073,6 +2094,10 @@ switch ($tab) {
|
|||
$tab_name = __('Security hardening');
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
$tab_name = __('Vulnerabilities');
|
||||
break;
|
||||
|
||||
default:
|
||||
$tab_name = '';
|
||||
$help_header = '';
|
||||
|
@ -2222,6 +2247,10 @@ switch ($tab) {
|
|||
enterprise_include('operation/agentes/security_hardening.php');
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
enterprise_include('operation/agentes/vulnerabilities.php');
|
||||
break;
|
||||
|
||||
case 'extension':
|
||||
$found = false;
|
||||
foreach ($config['extensions'] as $extension) {
|
||||
|
|
|
@ -91,6 +91,7 @@ CREATE TABLE IF NOT EXISTS `tagente` (
|
|||
`satellite_server` INT NOT NULL DEFAULT 0,
|
||||
`fixed_ip` TINYINT NOT NULL DEFAULT 0,
|
||||
`disabled_by_downtime` TINYINT NOT NULL DEFAULT 0,
|
||||
`vul_scan_enabled` TINYINT NOT NULL DEFAULT 2,
|
||||
PRIMARY KEY (`id_agente`),
|
||||
KEY `nombre` (`nombre`(255)),
|
||||
KEY `direccion` (`direccion`),
|
||||
|
@ -4519,4 +4520,14 @@ CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` (
|
|||
`graph_modules` TEXT NULL,
|
||||
`interval` INT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tgraph_analytics_filter`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `pandora_cve` (
|
||||
`cve_id` VARCHAR(20),
|
||||
`cvss_score` DECIMAL(5, 2),
|
||||
`cvss_vector` VARCHAR(255),
|
||||
PRIMARY KEY (`cve_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
File diff suppressed because it is too large
Load Diff
|
@ -87,6 +87,10 @@ class DataSet implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
|
|||
*/
|
||||
protected $axis;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
protected $stack;
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
@ -404,4 +408,28 @@ class DataSet implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of stack
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStack()
|
||||
{
|
||||
return $this->stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of stack
|
||||
*
|
||||
* @param string|null $stack
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setStack($stack)
|
||||
{
|
||||
$this->stack = $stack;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -206,6 +206,9 @@ sub pandora_get_sharedconfig ($$) {
|
|||
|
||||
# Server identifier
|
||||
$pa_config->{'server_unique_identifier'} = pandora_get_tconfig_token ($dbh, 'server_unique_identifier', '');
|
||||
|
||||
# Vulnerability scans
|
||||
$pa_config->{'agent_vulnerabilities'} = pandora_get_tconfig_token ($dbh, 'agent_vulnerabilities', 0);
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
|
|
|
@ -7942,7 +7942,7 @@ sub process_inventory_data ($$$$$$$) {
|
|||
################################################################################
|
||||
# Process inventory module data, creating the module if necessary.
|
||||
################################################################################
|
||||
sub process_inventory_module_data ($$$$$$$$) {
|
||||
sub process_inventory_module_data {
|
||||
my ($pa_config, $data, $server_id, $agent_name,
|
||||
$module_name, $interval, $timestamp, $dbh) = @_;
|
||||
|
||||
|
@ -8004,12 +8004,20 @@ sub process_inventory_module_data ($$$$$$$$) {
|
|||
'INSERT INTO tagente_datos_inventory (id_agent_module_inventory, data, timestamp, utimestamp)
|
||||
VALUES (?, ?, ?, ?)',
|
||||
$id_agent_module_inventory, safe_input($data), $timestamp, $utimestamp);
|
||||
|
||||
return;
|
||||
} else {
|
||||
process_inventory_module_diff($pa_config, safe_input($data),
|
||||
$inventory_module, $timestamp, $utimestamp, $dbh, $interval);
|
||||
}
|
||||
|
||||
# Vulnerability scan.
|
||||
if (($pa_config->{'agent_vulnerabilities'} == 0 && $agent->{'vul_scan_enabled'} == 1) ||
|
||||
($pa_config->{'agent_vulnerabilities'} == 1 && $agent->{'vul_scan_enabled'} == 1) ||
|
||||
($pa_config->{'agent_vulnerabilities'} == 1 && $agent->{'vul_scan_enabled'} == 2)) {
|
||||
my $vulnerability_data = enterprise_hook('process_inventory_vulnerabilities', [$pa_config, $data, $agent, $inventory_module, $dbh]);
|
||||
if (defined($vulnerability_data) && $vulnerability_data ne '') {
|
||||
process_inventory_module_data ($pa_config, $vulnerability_data, $server_id, $agent_name, 'Vulnerabilities', $interval, $timestamp, $dbh);
|
||||
}
|
||||
}
|
||||
|
||||
process_inventory_module_diff($pa_config, safe_input($data),
|
||||
$inventory_module, $timestamp, $utimestamp, $dbh, $interval);
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -433,16 +433,17 @@ sub exec_recon_app ($$$) {
|
|||
|
||||
# Configure macros.
|
||||
my %macros = (
|
||||
"__taskMD5__" => md5($task->{'id_rt'}),
|
||||
"__taskInterval__" => $task->{'interval_sweep'},
|
||||
"__taskGroup__" => get_group_name($dbh, $task->{'id_group'}),
|
||||
"__taskGroupID__" => $task->{'id_group'},
|
||||
"__temp__" => $pa_config->{'temporal'},
|
||||
"__incomingDir__" => $pa_config->{'incomingdir'},
|
||||
"__consoleAPIURL__" => $pa_config->{'console_api_url'},
|
||||
"__consoleAPIPass__" => $pa_config->{'console_api_pass'},
|
||||
"__consoleUser__" => $pa_config->{'console_user'},
|
||||
"__consolePass__" => $pa_config->{'console_pass'},
|
||||
"__taskMD5__" => md5($task->{'id_rt'}),
|
||||
"__taskInterval__" => $task->{'interval_sweep'},
|
||||
"__taskGroup__" => get_group_name($dbh, $task->{'id_group'}),
|
||||
"__taskGroupID__" => $task->{'id_group'},
|
||||
"__temp__" => $pa_config->{'temporal'},
|
||||
"__incomingDir__" => $pa_config->{'incomingdir'},
|
||||
"__consoleAPIURL__" => $pa_config->{'console_api_url'},
|
||||
"__consoleAPIPass__" => $pa_config->{'console_api_pass'},
|
||||
"__consoleUser__" => $pa_config->{'console_user'},
|
||||
"__consolePass__" => $pa_config->{'console_pass'},
|
||||
"__pandoraServerConf__" => $pa_config->{'pandora_path'},
|
||||
get_recon_app_macros($pa_config, $dbh, $task),
|
||||
get_recon_script_macros($pa_config, $dbh, $task)
|
||||
);
|
||||
|
@ -654,7 +655,11 @@ sub get_recon_macro_value($$$$) {
|
|||
}
|
||||
# Name of the group if it exists. Empty otherwise.
|
||||
elsif ($type eq 'agent_groups') {
|
||||
my $group_name = get_group_name($dbh, $value);
|
||||
my $group_name = '';
|
||||
if ($value > 0) {
|
||||
$group_name = get_group_name($dbh, $value);
|
||||
}
|
||||
|
||||
if (defined($group_name)) {
|
||||
$ret = $group_name;
|
||||
}
|
||||
|
@ -2227,6 +2232,7 @@ sub PandoraFMS::Recon::Base::connect_agents($$$$$;$) {
|
|||
# data = [
|
||||
# 'agent_data' => {},
|
||||
# 'module_data' => []
|
||||
# 'inventory_data' => []
|
||||
# ]
|
||||
################################################################################
|
||||
sub PandoraFMS::Recon::Base::create_agents($$) {
|
||||
|
@ -2240,7 +2246,8 @@ sub PandoraFMS::Recon::Base::create_agents($$) {
|
|||
|
||||
foreach my $information (@{$data}) {
|
||||
my $agent = $information->{'agent_data'};
|
||||
my $modules = $information->{'module_data'};
|
||||
my $modules = defined($information->{'module_data'}) ? $information->{'module_data'} : [];
|
||||
my $inventory = defined($information->{'inventory_data'}) ? $information->{'inventory_data'} : [];
|
||||
my $force_processing = 0;
|
||||
|
||||
# Search agent
|
||||
|
@ -2249,7 +2256,9 @@ sub PandoraFMS::Recon::Base::create_agents($$) {
|
|||
);
|
||||
|
||||
my $parent_id;
|
||||
if (defined($agent->{'parent_agent_name'})) {
|
||||
if (defined($agent->{'id_parent'})) {
|
||||
$parent_id = $agent->{'id_parent'};
|
||||
} elsif (defined($agent->{'parent_agent_name'})) {
|
||||
$parent_id = PandoraFMS::Core::locate_agent(
|
||||
$pa_config, $dbh, $agent->{'parent_agent_name'}
|
||||
);
|
||||
|
@ -2259,7 +2268,7 @@ sub PandoraFMS::Recon::Base::create_agents($$) {
|
|||
}
|
||||
|
||||
my $agent_id;
|
||||
my $os_id = get_os_id($dbh, $agent->{'os'});
|
||||
my $os_id = defined($agent->{'id_os'}) ? $agent->{'id_os'} : get_os_id($dbh, $agent->{'os'});
|
||||
|
||||
if ($os_id < 0) {
|
||||
$os_id = get_os_id($dbh, 'Other');
|
||||
|
@ -2322,8 +2331,20 @@ sub PandoraFMS::Recon::Base::create_agents($$) {
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Add inventory data.
|
||||
if (ref($inventory) eq "HASH") {
|
||||
PandoraFMS::Core::process_inventory_data (
|
||||
$pa_config,
|
||||
$inventory,
|
||||
0, # Does not seem to be used.
|
||||
$agent->{'agent_name'},
|
||||
$agent->{'interval'},
|
||||
strftime ("%Y/%m/%d %H:%M:%S", localtime()),
|
||||
$dbh
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
|
Loading…
Reference in New Issue