mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'develop' into ent-8365-ncm-fase-3
This commit is contained in:
commit
837f1ff73c
@ -90,7 +90,7 @@ function dbmgr_extension_main()
|
||||
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
__('Database interface'),
|
||||
__('DB interface'),
|
||||
'images/gm_db.png',
|
||||
false,
|
||||
'',
|
||||
|
@ -1053,4 +1053,17 @@ DROP TABLE tagent_access;
|
||||
|
||||
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
|
||||
|
||||
-- Update macros for plugin oracle
|
||||
|
||||
UPDATE `tdiscovery_apps` SET `version` = '1.1' WHERE `short_name` = 'pandorafms.oracle';
|
||||
|
||||
SET @id_app := (SELECT `id_app` FROM `tdiscovery_apps` WHERE `short_name` = 'pandorafms.oracle');
|
||||
|
||||
UPDATE `tdiscovery_apps_tasks_macros` SET `value` = 'agents_group_id=__taskGroupID__ interval=__taskInterval__ user=_dbuser_ password=_dbpass_ thick_mode=_thickMode_ client_path=_clientPath_ threads=_threads_ modules_prefix=_prefixModuleName_ execute_custom_queries=_executeCustomQueries_ analyze_connections=_checkConnections_ engine_uptime=_checkUptime_ query_stats=_queryStats_ cache_stats=_checkCache_ fragmentation_ratio=_checkFragmentation_ check_tablescpaces=_checkTablespaces_' WHERE `macro` = '_tempfileConf_' AND `id_task` IN (SELECT `id_rt` FROM `trecon_task` WHERE `id_app` = @id_app);
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_thickMode_', 'custom', 0, 0 FROM `trecon_task` WHERE `id_app` = @id_app;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_clientPath_', 'custom', '', 0 FROM `trecon_task` WHERE `id_app` = @id_app;
|
||||
UPDATE `trecon_task` SET `setup_complete` = 1 WHERE `id_app` = @id_app;
|
||||
|
||||
|
||||
COMMIT;
|
||||
|
@ -922,22 +922,25 @@ $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
|
||||
)
|
||||
);
|
||||
if (enterprise_installed() === true) {
|
||||
$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),
|
||||
|
@ -1092,6 +1092,50 @@ switch ($action) {
|
||||
$period = $item['period'];
|
||||
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':
|
||||
$group = $item['id_group'];
|
||||
$es = json_decode($item['external_source'], true);
|
||||
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
|
||||
$security_hardening_score = $es['security_hardening_score'];
|
||||
$vulnerabilities_status = $es['vulnerabilities_status'];
|
||||
$secmon_status = $es['secmon_status'];
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
$idAgent = $item['id_agent'];
|
||||
$es = json_decode($item['external_source'], true);
|
||||
$vul_package = $es['vul_package'];
|
||||
$vul_severity = $es['vul_severity'];
|
||||
$vul_ac = $es['vul_ac'];
|
||||
$vul_pr = $es['vul_pr'];
|
||||
$vul_ui = $es['vul_ui'];
|
||||
$vul_av = (empty($es['vul_av']) === true) ? 'all' : $es['vul_av'];
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
$group = $item['id_group'];
|
||||
$recursion = $item['recursion'];
|
||||
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
$group = $item['id_group'];
|
||||
$recursion = $item['recursion'];
|
||||
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
|
||||
break;
|
||||
|
||||
default:
|
||||
// It's not possible.
|
||||
break;
|
||||
@ -4036,6 +4080,217 @@ if (is_metaconsole() === true) {
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_secmon_status" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Secmon status');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'critical' => __('Critical'),
|
||||
'warning' => __('Warning'),
|
||||
],
|
||||
'secmon_status',
|
||||
$secmon_status,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_security_hardening_score" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Security hardening score');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'90' => __('< 90%'),
|
||||
'80' => __('< 80%'),
|
||||
'70' => __('< 70%'),
|
||||
'60' => __('< 60%'),
|
||||
'50' => __('< 50%'),
|
||||
'40' => __('< 40%'),
|
||||
'30' => __('< 30%'),
|
||||
'20' => __('< 20%'),
|
||||
'10' => __('< 10%'),
|
||||
],
|
||||
'security_hardening_score',
|
||||
(empty($security_hardening_score) === false) ? $security_hardening_score : 'all',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_status" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Vulnerabilities status');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'crit' => __('Critical'),
|
||||
'warn' => __('Warning'),
|
||||
],
|
||||
'vulnerabilities_status',
|
||||
$vulnerabilities_status,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_packages" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Package').ui_print_help_tip(__('Select a agent for load his packages.'), true);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
],
|
||||
'vul_package',
|
||||
$vul_package,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_severity" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Severity');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'high' => __('High'),
|
||||
'low' => __('Low'),
|
||||
'none' => __('None'),
|
||||
],
|
||||
'vul_severity',
|
||||
$vul_severity,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_ac" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Attack Complexity');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'H' => __('High'),
|
||||
'L' => __('Low'),
|
||||
],
|
||||
'vul_ac',
|
||||
$vul_ac,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_pr" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Privileges Required');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'H' => __('High'),
|
||||
'L' => __('Low'),
|
||||
'N' => __('None'),
|
||||
],
|
||||
'vul_pr',
|
||||
$vul_pr,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_ui" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('User Interaction');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'R' => __('Required'),
|
||||
'N' => __('None'),
|
||||
],
|
||||
'vul_ui',
|
||||
$vul_ui,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_av" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Attack vector');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'A' => __('Adjacent Network'),
|
||||
'L' => __('Local'),
|
||||
'N' => __('Network'),
|
||||
'P' => __('Physical'),
|
||||
],
|
||||
'vul_av',
|
||||
(empty($vul_av) === true) ? 'all' : $vul_av,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<tr id="row_status_check" class="datos">
|
||||
@ -5763,6 +6018,27 @@ $(document).ready (function () {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'vuls_info_agent':
|
||||
if ($("#hidden-id_agent").val() == 0) {
|
||||
dialog_message('#message_no_agent');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
if ($("#text-max_items").val() == '') {
|
||||
dialog_message('#message_no_max_item');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
if ($("#text-max_items").val() == '') {
|
||||
dialog_message('#message_no_max_item');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -5917,7 +6193,24 @@ $(document).ready (function () {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
if ($("#hidden-id_agent").val() == 0) {
|
||||
dialog_message('#message_no_agent');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'top_n_agents_vuls':
|
||||
if ($("#text-max_items").val() == '') {
|
||||
dialog_message('#message_no_max_item');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'top_n_vuls_count':
|
||||
if ($("#text-max_items").val() == '') {
|
||||
dialog_message('#message_no_max_item');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -6974,6 +7267,15 @@ function chooseType() {
|
||||
$("#row_cat_security_hardening").hide();
|
||||
$("#row_ignore_skipped").hide();
|
||||
$("#row_status_check").hide();
|
||||
$("#row_secmon_status").hide();
|
||||
$("#row_security_hardening_score").hide();
|
||||
$("#row_vulnerabilities_status").hide();
|
||||
$("#row_vulnerabilities_packages").hide();
|
||||
$("#row_vulnerabilities_severity").hide();
|
||||
$("#row_vulnerabilities_ac").hide();
|
||||
$("#row_vulnerabilities_pr").hide();
|
||||
$("#row_vulnerabilities_ui").hide();
|
||||
$("#row_vulnerabilities_av").hide();
|
||||
|
||||
// SLA list default state.
|
||||
$("#sla_list").hide();
|
||||
@ -7884,6 +8186,50 @@ function chooseType() {
|
||||
$("#row_group").show();
|
||||
$('#row_period').show();
|
||||
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':
|
||||
$("#row_group").show();
|
||||
$("#row_custom_field_filter").show();
|
||||
$("#row_secmon_status").show();
|
||||
$("#row_security_hardening_score").show();
|
||||
$("#row_vulnerabilities_status").show();
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
$("#row_agent").show();
|
||||
$("#row_vulnerabilities_packages").show();
|
||||
$("#row_vulnerabilities_severity").show();
|
||||
$("#row_vulnerabilities_ac").show();
|
||||
$("#row_vulnerabilities_pr").show();
|
||||
$("#row_vulnerabilities_ui").show();
|
||||
$("#row_vulnerabilities_av").show();
|
||||
updatePackages();
|
||||
$('#row_agent input[type=text]').change(function(e) {
|
||||
updatePackages();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
$("#row_group").show();
|
||||
$("#row_max_items").show();
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
$("#row_group").show();
|
||||
$("#row_max_items").show();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
@ -8126,6 +8472,46 @@ function control_period_range() {
|
||||
}, 800);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function updateSelect(element, fields, selected) {
|
||||
if (typeof fields === "object") {
|
||||
$(element).find("select").empty();
|
||||
$(element).find(".select2-container .select2-selection__rendered").empty();
|
||||
Object.keys(fields).forEach(function(key) {
|
||||
if (key === selected) {
|
||||
$(element).find(".select2-container .select2-selection__rendered").append(`${fields[key]}`);
|
||||
$(element).find("select").append(`<option value="${key}" selected>${fields[key]}</option>`);
|
||||
} else {
|
||||
$(element).find("select").append(`<option value="${key}">${fields[key]}</option>`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updatePackages() {
|
||||
let id_agent = $('#hidden-id_agent').val();
|
||||
let server_id = $('#hidden-server_id').val();
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "<?php echo ui_get_full_url('ajax.php'); ?>",
|
||||
data: {
|
||||
page: "<?php echo ENTERPRISE_DIR.'/include/ajax/vulnerabilities.ajax'; ?>",
|
||||
action: "updatePackages",
|
||||
id_agent: id_agent,
|
||||
server_id: server_id,
|
||||
},
|
||||
success: function(data) {
|
||||
const json = JSON.parse(data);
|
||||
if (json.success) {
|
||||
updateSelect("#row_vulnerabilities_packages", json.data, '<?php echo $vul_package; ?>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('[id^=period], #combo_graph_options, #combo_sla_sort_options').next().css('z-index', 0);
|
||||
|
||||
|
@ -180,8 +180,8 @@ if ($report_id_user == $config['id_user']
|
||||
$options['div_class'] = '';
|
||||
}
|
||||
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Write Access Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'RW',
|
||||
@ -216,7 +216,7 @@ if ($enterpriseEnable) {
|
||||
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
$table->data[4][0] = html_print_label_input_block(
|
||||
__('Generate cover page in PDF render'),
|
||||
html_print_checkbox_switch(
|
||||
'cover_page_render',
|
||||
@ -226,7 +226,7 @@ if (enterprise_installed() === true) {
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[3][1] = html_print_label_input_block(
|
||||
$table->data[4][1] = html_print_label_input_block(
|
||||
__('Generate index in PDF render'),
|
||||
html_print_checkbox_switch(
|
||||
'index_render',
|
||||
|
@ -2060,6 +2060,56 @@ switch ($action) {
|
||||
$good_format = true;
|
||||
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':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['secmon_status'] = get_parameter('secmon_status');
|
||||
$es['security_hardening_score'] = get_parameter('security_hardening_score');
|
||||
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
$values['id_agent'] = get_parameter('id_agent');
|
||||
$es['server_id'] = get_parameter('server_id');
|
||||
$es['vul_package'] = get_parameter('vul_package');
|
||||
$es['vul_severity'] = get_parameter('vul_severity');
|
||||
$es['vul_ac'] = get_parameter('vul_ac');
|
||||
$es['vul_pr'] = get_parameter('vul_pr');
|
||||
$es['vul_ui'] = get_parameter('vul_ui');
|
||||
$es['vul_av'] = get_parameter('vul_av');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['top_n_value'] = get_parameter('max_items');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['top_n_value'] = get_parameter('max_items');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$values['period'] = get_parameter('period');
|
||||
$values['top_n'] = get_parameter(
|
||||
@ -3014,6 +3064,56 @@ switch ($action) {
|
||||
$good_format = true;
|
||||
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':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['secmon_status'] = get_parameter('secmon_status');
|
||||
$es['security_hardening_score'] = get_parameter('security_hardening_score');
|
||||
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
$values['id_agent'] = get_parameter('id_agent');
|
||||
$es['server_id'] = get_parameter('server_id');
|
||||
$es['vul_package'] = get_parameter('vul_package');
|
||||
$es['vul_severity'] = get_parameter('vul_severity');
|
||||
$es['vul_ac'] = get_parameter('vul_ac');
|
||||
$es['vul_pr'] = get_parameter('vul_pr');
|
||||
$es['vul_ui'] = get_parameter('vul_ui');
|
||||
$es['vul_av'] = get_parameter('vul_av');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['top_n_value'] = get_parameter('max_items');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['top_n_value'] = get_parameter('max_items');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$values['period'] = get_parameter('period');
|
||||
$values['top_n'] = get_parameter(
|
||||
|
@ -276,7 +276,7 @@ foreach ($servers as $server) {
|
||||
$data[9] .= '</a>';
|
||||
|
||||
if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) {
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">';
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=advanced_editor').'">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/agents@svg.svg',
|
||||
true,
|
||||
|
@ -54,8 +54,12 @@ if (isset($_POST['create'])) {
|
||||
if (! $result) {
|
||||
ui_print_error_message(__('There was a problem creating link'));
|
||||
} else {
|
||||
ui_print_success_message(__('Successfully created'));
|
||||
$id_link = $result;
|
||||
ui_print_result_message(
|
||||
$id_link,
|
||||
__('Successfully created'),
|
||||
__('Could not be created')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,8 +115,8 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
|
||||
$link = '';
|
||||
}
|
||||
|
||||
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
|
||||
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">';
|
||||
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
|
||||
if ($creation_mode == 1) {
|
||||
echo "<input type='hidden' name='create' value='1'>";
|
||||
} else {
|
||||
@ -179,10 +183,10 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
|
||||
)
|
||||
);
|
||||
|
||||
echo '</form></td></tr></table>';
|
||||
echo '</td></tr></table></form>';
|
||||
} else {
|
||||
// Main list view for Links editor
|
||||
$rows = db_get_all_rows_in_table('tlink', 'name');
|
||||
// Main list view for Links editor.
|
||||
$rows = db_get_all_fields_in_table('tlink', '', '', 'name');
|
||||
if ($rows === false) {
|
||||
$rows = [];
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ $buttons['general'] = [
|
||||
'images/setup.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('General'),
|
||||
'title' => __('General setup'),
|
||||
'class' => 'invert_filter',
|
||||
|
||||
]
|
||||
@ -265,7 +265,7 @@ if (enterprise_installed()) {
|
||||
switch ($section) {
|
||||
case 'general':
|
||||
$buttons['general']['active'] = true;
|
||||
$subpage = __('General');
|
||||
$subpage = __('General setup');
|
||||
$help_header = 'setup_general_tab';
|
||||
break;
|
||||
|
||||
@ -377,7 +377,7 @@ switch ($section) {
|
||||
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$subpage,
|
||||
__('Setup').' » '.$subpage,
|
||||
'',
|
||||
false,
|
||||
$help_header,
|
||||
@ -388,6 +388,10 @@ ui_print_standard_header(
|
||||
'link' => '',
|
||||
'label' => __('Setup'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => $subpage,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -672,8 +672,11 @@ if ($update_user) {
|
||||
$values['email'] = (string) get_parameter('email');
|
||||
$values['phone'] = (string) get_parameter('phone');
|
||||
$values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments'))));
|
||||
$values['allowed_ip_active'] = ((int) get_parameter('allowed_ip_active', -1) === 0);
|
||||
$values['allowed_ip_list'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('allowed_ip_list'))));
|
||||
if (users_is_admin($config['id_user']) === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$values['allowed_ip_active'] = ((int) get_parameter('allowed_ip_active', -1) === 0);
|
||||
$values['allowed_ip_list'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('allowed_ip_list'))));
|
||||
}
|
||||
|
||||
$values['is_admin'] = (get_parameter('is_admin', 0) === 0) ? 0 : 1;
|
||||
$values['language'] = (string) get_parameter('language');
|
||||
$values['timezone'] = (string) get_parameter('timezone');
|
||||
|
@ -859,50 +859,56 @@ $userManagementTable->data['fields_addSettings'][0] = html_print_textarea(
|
||||
''
|
||||
);
|
||||
|
||||
$userManagementTable->data['captions_addSettings'][1] = __('Login allowed IP list');
|
||||
$userManagementTable->data['fields_addSettings'][1] = html_print_div(
|
||||
[
|
||||
'class' => 'edit_user_allowed_ip',
|
||||
'content' => html_print_textarea(
|
||||
'allowed_ip_list',
|
||||
5,
|
||||
65,
|
||||
($user_info['allowed_ip_list'] ?? ''),
|
||||
(((bool) $view_mode === true) ? 'readonly="readonly"' : ''),
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
if (users_is_admin($config['id_user']) === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$allowAllIpsContent = [];
|
||||
$allowAllIpsContent[] = '<span>'.__('Enable IP allowlist').'</span>';
|
||||
$allowAllIpsContent[] = html_print_div(
|
||||
[
|
||||
'content' => html_print_checkbox_switch(
|
||||
'allowed_ip_active',
|
||||
0,
|
||||
($user_info['allowed_ip_active'] ?? 0),
|
||||
true,
|
||||
false,
|
||||
'handleIpAllowlist(this)'
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$userManagementTable->data['fields_addSettings'][1] .= ui_print_input_placeholder(
|
||||
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'),
|
||||
true
|
||||
);
|
||||
$userManagementTable->data['captions_addSettings'][1] = html_print_div(
|
||||
[
|
||||
'class' => 'margin-top-10',
|
||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||
'content' => implode('', $allowAllIpsContent),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$allowAllIpsContent = [];
|
||||
$allowAllIpsContent[] = '<span>'.__('Allow all IPs').'</span>';
|
||||
$allowAllIpsContent[] = html_print_div(
|
||||
[
|
||||
'content' => html_print_checkbox_switch(
|
||||
'allowed_ip_active',
|
||||
0,
|
||||
($user_info['allowed_ip_active'] ?? 0),
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
||||
[
|
||||
'class' => 'margin-top-10',
|
||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||
'content' => implode('', $allowAllIpsContent),
|
||||
],
|
||||
true
|
||||
);
|
||||
$userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
||||
[
|
||||
'class' => 'edit_user_allowed_ip '.(((int) $user_info['allowed_ip_active'] === 1) ? '' : 'invisible'),
|
||||
'content' => html_print_textarea(
|
||||
'allowed_ip_list',
|
||||
5,
|
||||
65,
|
||||
($user_info['allowed_ip_list'] ?? ''),
|
||||
(((bool) $view_mode === true) ? 'readonly="readonly"' : ''),
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$userManagementTable->data['fields_addSettings'][1] .= ui_print_input_placeholder(
|
||||
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'),
|
||||
true,
|
||||
[
|
||||
'id' => 'info_allowed_ip',
|
||||
'class' => ((int) $user_info['allowed_ip_active'] === 1) ? 'input_sub_placeholder' : 'input_sub_placeholder invisible',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if ($config['ITSM_enabled'] && $config['ITSM_user_level_conf']) {
|
||||
// Pandora ITSM user remote login.
|
||||
@ -1040,4 +1046,14 @@ $(document).ready(function () {
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
function handleIpAllowlist(e){
|
||||
if(e.checked === true) {
|
||||
$('.edit_user_allowed_ip').show();
|
||||
$('#info_allowed_ip').show();
|
||||
} else {
|
||||
$('.edit_user_allowed_ip').hide();
|
||||
$('#info_allowed_ip').hide();
|
||||
}
|
||||
}
|
||||
</script>
|
@ -372,7 +372,7 @@ class WelcomeWindow extends Wizard
|
||||
$flag_um = true;
|
||||
}
|
||||
|
||||
if (empty($config['welcome_mail_configured']) === false) {
|
||||
if (empty($config['email_username']) === false && empty($config['email_password']) === false) {
|
||||
$btn_configure_mail_class = '';
|
||||
$li_configure_mail_class = 'row_green';
|
||||
$flag_cm = true;
|
||||
@ -1135,7 +1135,7 @@ class WelcomeWindow extends Wizard
|
||||
}
|
||||
|
||||
function configureEmail() {
|
||||
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general#table3'); ?>';
|
||||
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general#table4'); ?>';
|
||||
}
|
||||
|
||||
function serversUp() {
|
||||
|
@ -1745,20 +1745,37 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
||||
}
|
||||
}
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __('Agents'),
|
||||
'label_class' => 'font-title-font',
|
||||
'type' => 'select_from_sql',
|
||||
'sql' => 'SELECT `id_agente`,`alias` FROM tagente',
|
||||
'name' => 'filtered-module-agents-'.$uniqId,
|
||||
'selected' => explode(',', $data['mAgents']),
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'style' => 'min-width: 200px;max-width:200px;',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
]
|
||||
);
|
||||
if (is_metaconsole() === true) {
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __('Agents'),
|
||||
'label_class' => 'font-title-font',
|
||||
'type' => 'select',
|
||||
'fields' => $agents,
|
||||
'name' => 'filtered-module-agents-'.$uniqId,
|
||||
'selected' => explode(',', $data['mAgents']),
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'style' => 'min-width: 200px;max-width:200px;',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __('Agents'),
|
||||
'label_class' => 'font-title-font',
|
||||
'type' => 'select_from_sql',
|
||||
'sql' => 'SELECT `id_agente`,`alias` FROM tagente',
|
||||
'name' => 'filtered-module-agents-'.$uniqId,
|
||||
'selected' => explode(',', $data['mAgents']),
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'style' => 'min-width: 200px;max-width:200px;',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$commonModules = 0;
|
||||
if (empty($data['mShowCommonModules']) === false) {
|
||||
|
@ -1032,6 +1032,62 @@ function reporting_make_reporting_data(
|
||||
);
|
||||
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':
|
||||
$report['contents'][] = reporting_vuls_by_agent(
|
||||
$report,
|
||||
$content,
|
||||
$type
|
||||
);
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
$report['contents'][] = reporting_vuls_info_agent(
|
||||
$report,
|
||||
$content,
|
||||
$type
|
||||
);
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
$report['contents'][] = reporting_top_n_agents_vuls(
|
||||
$report,
|
||||
$content,
|
||||
$type
|
||||
);
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
$report['contents'][] = reporting_top_n_vuls_count(
|
||||
$report,
|
||||
$content,
|
||||
$type
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
|
@ -511,6 +511,34 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
|
||||
case 'evolution':
|
||||
reporting_evolution_graph($table, $item);
|
||||
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':
|
||||
reporting_html_vuls_by_agent($table, $item);
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
reporting_html_vuls_info_agent($table, $item);
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
reporting_html_top_n_agents_vuls($table, $item);
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
reporting_html_top_n_vuls_count($table, $item);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($item['type'] == 'agent_module') {
|
||||
@ -526,6 +554,300 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to print top vulnerabiries more common.
|
||||
*
|
||||
* @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_top_n_vuls_count($table, $item, $pdf=0)
|
||||
{
|
||||
global $config;
|
||||
$table->width = '99%';
|
||||
$table->styleTable = 'border: 0px;';
|
||||
$table->colspan[2][0] = 3;
|
||||
$table1 = new stdClass();
|
||||
$table1->headstyle = [];
|
||||
$table1->width = '99%';
|
||||
$table1->class = 'info_table';
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->rowclass[0] = '';
|
||||
$table1->head[0] = __('Vulnerability');
|
||||
$table1->head[2] = __('Total');
|
||||
|
||||
$row = 2;
|
||||
foreach ($item['data'] as $key => $vul) {
|
||||
$table1->data[$row][0] = $vul['cve_id'];
|
||||
$table1->data[$row][2] = $vul['count'];
|
||||
$row++;
|
||||
}
|
||||
|
||||
if ($pdf === 1) {
|
||||
$table1->title = $item['title'];
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->titlestyle = 'text-align:left;';
|
||||
}
|
||||
|
||||
$table->data[2][0] = html_print_table($table1, true);
|
||||
if ($pdf === 1) {
|
||||
return html_print_table($table, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to print top agents with worst score.
|
||||
*
|
||||
* @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_top_n_agents_vuls($table, $item, $pdf=0)
|
||||
{
|
||||
global $config;
|
||||
$table->width = '99%';
|
||||
$table->styleTable = 'border: 0px;';
|
||||
$table->colspan[2][0] = 3;
|
||||
$table1 = new stdClass();
|
||||
$table1->headstyle = [];
|
||||
$table1->width = '99%';
|
||||
$table1->class = 'info_table';
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->rowclass[0] = '';
|
||||
$table1->head[0] = __('Agent');
|
||||
$table1->head[2] = __('Risk');
|
||||
|
||||
$row = 2;
|
||||
foreach ($item['data'] as $key => $agent) {
|
||||
$table1->data[$row][0] = $agent['alias'];
|
||||
$table1->data[$row][2] = $agent['score'];
|
||||
$row++;
|
||||
}
|
||||
|
||||
if ($pdf === 1) {
|
||||
$table1->title = $item['title'];
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->titlestyle = 'text-align:left;';
|
||||
}
|
||||
|
||||
$table->data[2][0] = html_print_table($table1, true);
|
||||
if ($pdf === 1) {
|
||||
return html_print_table($table, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to print vulnerabilities of agent.
|
||||
*
|
||||
* @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_info_agent($table, $item, $pdf=0)
|
||||
{
|
||||
$table->width = '99%';
|
||||
$table->styleTable = 'border: 0px;';
|
||||
$table->colspan[2][0] = 3;
|
||||
$table1 = new stdClass();
|
||||
$table1->headstyle[0] = 'text-align: left';
|
||||
$table1->headstyle[1] = 'text-align: left';
|
||||
$table1->headstyle[2] = 'text-align: left';
|
||||
$table1->width = '99%';
|
||||
$table1->class = 'info_table';
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->rowclass[0] = '';
|
||||
$table1->head[0] = __('Name');
|
||||
$table1->head[1] = __('CVE');
|
||||
$table1->head[2] = __('Version');
|
||||
$table1->head[3] = __('Score');
|
||||
$table1->head[4] = __('Detection time');
|
||||
$table1->head[5] = __('Severity');
|
||||
$table1->head[6] = __('Version');
|
||||
$table1->head[7] = __('Attack Vector');
|
||||
$table1->head[8] = __('Attack Complexity');
|
||||
$table1->head[9] = __('Privileges Required');
|
||||
$table1->head[10] = __('User Interaction');
|
||||
$table1->head[11] = __('Scope');
|
||||
$table1->head[12] = __('Confidentiality');
|
||||
$table1->head[13] = __('Integrity');
|
||||
$table1->head[14] = __('Availability');
|
||||
|
||||
$row = 1;
|
||||
foreach ($item['data'] as $key => $vul) {
|
||||
$table1->data[$row][0] = (key_exists('name', $vul) === true) ? $vul['name'] : '';
|
||||
$table1->data[$row][1] = (key_exists('cve', $vul) === true) ? $vul['cve'] : '';
|
||||
$table1->data[$row][2] = (key_exists('version', $vul) === true) ? $vul['version'] : '';
|
||||
$table1->data[$row][3] = (key_exists('score', $vul) === true) ? $vul['score'] : '';
|
||||
$table1->data[$row][4] = (key_exists('detection_time', $vul) === true) ? $vul['detection_time'] : '';
|
||||
$table1->data[$row][5] = (key_exists('severity', $vul) === true) ? $vul['severity'] : '';
|
||||
$table1->data[$row][6] = (key_exists('CVSS', $vul) === true) ? $vul['CVSS'] : '';
|
||||
$table1->data[$row][7] = (key_exists('AV', $vul) === true) ? $vul['AV'] : '';
|
||||
$table1->data[$row][8] = (key_exists('AC', $vul) === true) ? $vul['AC'] : '';
|
||||
$table1->data[$row][9] = (key_exists('PR', $vul) === true) ? $vul['PR'] : '';
|
||||
$table1->data[$row][10] = (key_exists('UI', $vul) === true) ? $vul['UI'] : '';
|
||||
$table1->data[$row][11] = (key_exists('S', $vul) === true) ? $vul['S'] : '';
|
||||
$table1->data[$row][12] = (key_exists('C', $vul) === true) ? $vul['C'] : '';
|
||||
$table1->data[$row][13] = (key_exists('I', $vul) === true) ? $vul['I'] : '';
|
||||
$table1->data[$row][14] = (key_exists('A', $vul) === true) ? $vul['A'] : '';
|
||||
|
||||
$row++;
|
||||
}
|
||||
|
||||
$table->data[2][0] = html_print_table($table1, true);
|
||||
|
||||
if ($pdf === 1) {
|
||||
$table1->title = $item['title'];
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->titlestyle = 'text-align:left;';
|
||||
return html_print_table($table1, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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_agent($table, $item, $pdf=0)
|
||||
{
|
||||
$table->width = '99%';
|
||||
$table->styleTable = 'border: 0px;';
|
||||
$table->colspan[2][0] = 3;
|
||||
$table1 = new stdClass();
|
||||
$table1->headstyle[0] = 'text-align: left';
|
||||
$table1->headstyle[1] = 'text-align: left';
|
||||
$table1->headstyle[2] = 'text-align: left';
|
||||
$table1->width = '99%';
|
||||
$table1->class = 'info_table';
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->rowclass[0] = '';
|
||||
$table1->head[0] = __('Agent');
|
||||
$table1->head[1] = __('OS');
|
||||
$table1->head[2] = __('OS Version');
|
||||
$table1->head[3] = __('Group');
|
||||
$table1->head[4] = __('Ip');
|
||||
$table1->head[5] = __('Status');
|
||||
$table1->head[6] = __('SecMon');
|
||||
$table1->head[7] = __('Hardening');
|
||||
$table1->head[8] = __('Vulnerability');
|
||||
$table1->head[9] = __('Last contact');
|
||||
$table1->head[10] = __('L.S. Change');
|
||||
|
||||
$row = 1;
|
||||
foreach ($item['data'] as $key => $vul) {
|
||||
$table1->data[$row][0] = $vul['alias'];
|
||||
$table1->data[$row][2] = $vul['name'];
|
||||
$table1->data[$row][3] = $vul['os_version'];
|
||||
$table1->data[$row][4] = $vul['nombre_gr'];
|
||||
$table1->data[$row][5] = $vul['direccion'];
|
||||
$table1->data[$row][6] = $vul['status'];
|
||||
$table1->data[$row][7] = $vul['secmon'];
|
||||
$table1->data[$row][8] = $vul['hardening'];
|
||||
$table1->data[$row][9] = $vul['vulnerabilities'];
|
||||
$table1->data[$row][10] = $vul['ultimo_contacto'];
|
||||
$table1->data[$row][11] = $vul['last_status_c'];
|
||||
$row++;
|
||||
}
|
||||
|
||||
if ($pdf === 1) {
|
||||
$table1->title = $item['title'];
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->titlestyle = 'text-align:left;';
|
||||
}
|
||||
|
||||
$table->data[2][0] = html_print_table($table1, true);
|
||||
|
||||
if ($pdf === 1) {
|
||||
return html_print_table($table1, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to print the security hardening evolution.
|
||||
*
|
||||
|
@ -1008,6 +1008,41 @@ function reports_get_report_types($template=false, $not_editor=false)
|
||||
'optgroup' => __('Security hardening'),
|
||||
'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'] = [
|
||||
'optgroup' => __('Vulnerabilities'),
|
||||
'name' => __('Detailed security report'),
|
||||
];
|
||||
|
||||
$types['vuls_info_agent'] = [
|
||||
'optgroup' => __('Vulnerabilities'),
|
||||
'name' => __('Vulnerabilities of agent'),
|
||||
];
|
||||
|
||||
$types['top_n_agents_vuls'] = [
|
||||
'optgroup' => __('Vulnerabilities'),
|
||||
'name' => __('Top-N agents with more risk'),
|
||||
];
|
||||
|
||||
$types['top_n_vuls_count'] = [
|
||||
'optgroup' => __('Vulnerabilities'),
|
||||
'name' => __('Top-N common vulnerabilities'),
|
||||
];
|
||||
}
|
||||
|
||||
return $types;
|
||||
|
@ -310,8 +310,6 @@ function initialiceLayout(data) {
|
||||
}
|
||||
|
||||
function duplicateWidget(original_cellId, original_widgetId) {
|
||||
let duplicate_cellId = insertCellLayoutForDuplicate();
|
||||
|
||||
$.ajax({
|
||||
method: "post",
|
||||
url: data.url,
|
||||
@ -320,16 +318,14 @@ function initialiceLayout(data) {
|
||||
method: "duplicateWidget",
|
||||
dashboardId: data.dashboardId,
|
||||
widgetId: original_widgetId,
|
||||
cellId: original_cellId,
|
||||
duplicateCellId: duplicate_cellId
|
||||
cellId: original_cellId
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(success) {
|
||||
console.log(success);
|
||||
success: function(data) {
|
||||
addCell(data.cellId, 0, 0, 4, 4, true, 0, 2000, 0, 2000, 0, true);
|
||||
},
|
||||
error: function(error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
error: function(xhr, textStatus, errorMessage) {
|
||||
console.log("ERROR" + errorMessage + textStatus + xhr);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -428,8 +424,8 @@ function initialiceLayout(data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function insertCellLayoutForDuplicate() {
|
||||
/*
|
||||
function insertCellLayoutForDuplicate(original_cell_id) {
|
||||
let duplicateCellId = 0;
|
||||
$.ajax({
|
||||
async: false,
|
||||
@ -441,7 +437,8 @@ function initialiceLayout(data) {
|
||||
dashboardId: data.dashboardId,
|
||||
auth_class: data.auth.class,
|
||||
auth_hash: data.auth.hash,
|
||||
id_user: data.auth.user
|
||||
id_user: data.auth.user,
|
||||
copy: original_cell_id
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
@ -449,7 +446,7 @@ function initialiceLayout(data) {
|
||||
// width and height = 4
|
||||
// position auto = true.
|
||||
if (data.cellId !== 0) {
|
||||
addCell(data.cellId, 0, 0, 4, 4, true, 0, 2000, 0, 2000, 0, true);
|
||||
addCell(data.cellId, 0, 0, 4, 4, true, 0, 2000, 0, 2000, 0, true, original_cell_id);
|
||||
duplicateCellId = data.cellId;
|
||||
}
|
||||
},
|
||||
@ -458,7 +455,7 @@ function initialiceLayout(data) {
|
||||
}
|
||||
});
|
||||
return duplicateCellId;
|
||||
}
|
||||
}*/
|
||||
|
||||
function configurationWidget(cellId, widgetId, size) {
|
||||
load_modal({
|
||||
|
@ -609,10 +609,25 @@ class Manager implements PublicLogin
|
||||
/**
|
||||
* Duplicate widget.
|
||||
*
|
||||
* @return integer
|
||||
* @return void
|
||||
*/
|
||||
public function duplicateWidget():int
|
||||
public function duplicateWidget():void
|
||||
{
|
||||
global $config;
|
||||
|
||||
$return = false;
|
||||
|
||||
$position = [
|
||||
'x' => 0,
|
||||
'y' => 0,
|
||||
'width' => 4,
|
||||
'height' => 4,
|
||||
];
|
||||
|
||||
$cellClass = new Cell($position, $this->dashboardId);
|
||||
$dataCell = $cellClass->get();
|
||||
|
||||
// $result = ['cellId' => $dataCell['id']];
|
||||
$original_widget = [];
|
||||
|
||||
$original_cellId = $this->cellId;
|
||||
@ -632,12 +647,23 @@ class Manager implements PublicLogin
|
||||
'options' => $options_json,
|
||||
'id_widget' => $original_widget['id_widget'],
|
||||
];
|
||||
|
||||
$res = \db_process_sql_update(
|
||||
'twidget_dashboard',
|
||||
$values,
|
||||
['id' => $this->duplicateCellId]
|
||||
['id' => $dataCell['id']]
|
||||
);
|
||||
return $res;
|
||||
|
||||
if ($res === 1) {
|
||||
$return = [
|
||||
'cellId' => $dataCell['id'],
|
||||
'widgetId' => $original_widget['id_widget'],
|
||||
];
|
||||
|
||||
$json_return = json_encode($return);
|
||||
}
|
||||
|
||||
echo $json_return;
|
||||
|
||||
}
|
||||
|
||||
|
@ -328,7 +328,7 @@ class SingleGraphWidget extends Widget
|
||||
|
||||
// Autocomplete module.
|
||||
$inputs[] = [
|
||||
'label' => __('Module'),
|
||||
'label' => __('Module').ui_print_help_tip(__('Warning, this requires to have data for a mid-term (days/weeks) of the source data, if not, projection will not be reliable.'), true),
|
||||
'arguments' => [
|
||||
'type' => 'autocomplete_module',
|
||||
'name' => 'moduleId',
|
||||
|
@ -1471,6 +1471,10 @@ ul.datatable_filter:has(li > div.action-buttons) {
|
||||
background-color: #222 !important;
|
||||
}
|
||||
|
||||
ul.datatable_filter {
|
||||
background-color: #222 !important;
|
||||
}
|
||||
|
||||
span.ui-dialog-title {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
@ -1194,7 +1194,7 @@ INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALU
|
||||
INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (2, 'Discovery.Cloud', 'Discovery Cloud script to monitor Cloud technologies (AWS.EC2, AWS.S3, AWS.RDS, RDS,ȊWS.EKS)', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}');
|
||||
|
||||
-- IPAM is 3.
|
||||
INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (4, 'IPMI Recon','Specific Pandora FMS Intel DCM Discovery (c) Artica ST 2011 <info@artica.es>

Usage: ./ipmi-recon.pl <task_id> <group_id> <custom_field1> <custom_field2> <custom_field3> <custom_field4>

* custom_field1 = Network i.e.: 192.168.100.0/24
* custom_field2 = Username
* custom_field3 = Password
* custom_field4 = Additional parameters i.e.: -D LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.: 192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional parameters\",\"help\":\"Optional additional parameters such as -D LAN_2_0 to use IPMI ver 2.0 instead of 1.5.  These options will also be passed to the IPMI plugin when the current values are read.\",\"value\":\"\",\"hide\":\"\"}}');
|
||||
INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (4, 'IPMI Recon','Specific Pandora FMS Intel DCM Discovery (c) Artica ST 2011 <info@pandorafms.com>

Usage: ./ipmi-recon.pl <task_id> <group_id> <custom_field1> <custom_field2> <custom_field3> <custom_field4>

* custom_field1 = Network i.e.: 192.168.100.0/24
* custom_field2 = Username
* custom_field3 = Password
* custom_field4 = Additional parameters i.e.: -D LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.: 192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional parameters\",\"help\":\"Optional additional parameters such as -D LAN_2_0 to use IPMI ver 2.0 instead of 1.5.  These options will also be passed to the IPMI plugin when the current values are read.\",\"value\":\"\",\"hide\":\"\"}}');
|
||||
|
||||
INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (3, 'IPAM Recon', 'This script is used to automatically detect network hosts availability and name, used as Recon Custom Script in the recon task. Parameters used are:\n\n* custom_field1 = network. i.e.: 192.168.100.0/24\n* custom_field2 = associated IPAM network id. i.e.: 4. Please do not change this value, it is assigned automatically in IPAM management.\n\nSee documentation for more information.', '/usr/share/pandora_server/util/recon_scripts/IPAMrecon.pl', '{"1":{"macro":"_field1_","desc":"Network","help":"i.e.: 192.168.100.0/24","value":"","hide":""}}');
|
||||
|
||||
@ -1214,7 +1214,7 @@ INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`
|
||||
|
||||
INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0,0,'',0),(2,'Department',0,0,'',0),(3,'Additional ID',0,0,'',0),(4,'eHorusID',0,0,'',0);
|
||||
|
||||
INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es','','',''),(2,'critical','Critical modules','','','',''),(3,'dmz','DMZ Network Zone','','','',''),(4,'performance','Performance anda capacity modules','','','',''),(5,'configuration','','','','','');
|
||||
INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://pandorafms.com','','',''),(2,'critical','Critical modules','','','',''),(3,'dmz','DMZ Network Zone','','','',''),(4,'performance','Performance anda capacity modules','','','',''),(5,'configuration','','','','','');
|
||||
|
||||
INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'',0,90,0),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'',0,90,0),(5,'Restart agent','Restart the agent with using UDP protocol.

To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'',0,90,0),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,'',0,90,0),(7,'Create ticket in Pandora ITSM from event','Create a ticket in Pandora ITSM from an event','index.php?sec=manageTickets&sec2=operation/ITSM/itsm&operation=edit&from_event=_event_id_','url',0,0,0,1,'',0,90,1);
|
||||
|
||||
@ -2911,7 +2911,7 @@ SET @short_name = 'pandorafms.oracle';
|
||||
SET @name = 'Oracle';
|
||||
SET @section = 'app';
|
||||
SET @description = 'Monitor Oracle databases';
|
||||
SET @version = '1.0';
|
||||
SET @version = '1.1';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
|
@ -34,9 +34,8 @@ if ($redraw === false) {
|
||||
|
||||
$output .= '<div class="header-widget">';
|
||||
$output .= '<div>';
|
||||
|
||||
if ((int) $cellData['id_widget'] !== 0) {
|
||||
$options = json_decode($cellData['options'], true);
|
||||
$options = json_decode($cellData['options'], true);
|
||||
if ($cellData['id_widget'] !== '0') {
|
||||
$output .= $options['title'];
|
||||
} else {
|
||||
$output .= __('New widget');
|
||||
@ -44,10 +43,15 @@ if ((int) $cellData['id_widget'] !== 0) {
|
||||
|
||||
$output .= '</div>';
|
||||
$output .= '<div class="header-options">';
|
||||
|
||||
if ($manageDashboards !== 0 || $writeDashboards !== 0) {
|
||||
if ((int) $cellData['id_widget'] !== 0) {
|
||||
$output .= '<a id="copy-widget-'.$cellData['id'].'" class="">';
|
||||
$count_options = count(json_decode($cellData['options'], true));
|
||||
$invisible = '';
|
||||
if ($count_options <= 2 && $options['copy'] == 0) {
|
||||
$invisible = 'invisible';
|
||||
}
|
||||
|
||||
$output .= '<a id="copy-widget-'.$cellData['id'].'" class="'.$invisible.'" >';
|
||||
$output .= html_print_image(
|
||||
'images/copy.svg',
|
||||
true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user