diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 2789487761..af43ac70be 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.774-231130 +Version: 7.0NG.774-231207 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 3ead8c9748..d5c73049a1 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.774-231130" +pandora_version="7.0NG.774-231207" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f148c0491a..5b536bb64b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.774'; -use constant AGENT_BUILD => '231130'; +use constant AGENT_BUILD => '231207'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 7d8b52fac0..a3b2d8ec3d 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231130 +%define release 231207 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index d7acd083d4..3390a1408b 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231130 +%define release 231207 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index a2f6f7f37b..41db54797d 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231130 +%define release 231207 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 458f7a3b11..c7a34dfe60 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231130 +%define release 231207 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 602e20abbb..0dcd58b6b2 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231130 +%define release 231207 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index c470874b33..284c4a8eff 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.774" -PI_BUILD="231130" +PI_BUILD="231207" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b895417a9b..6c3def2e2b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231130} +{231207} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1c1fe1f556..e59fbc64d7 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.774 Build 231130") +#define PANDORA_VERSION ("7.0NG.774 Build 231207") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 61a0a56cd6..97dd2beb29 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.774(Build 231130))" + VALUE "ProductVersion", "(7.0NG.774(Build 231207))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a5181ad031..48095b1006 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.774-231130 +Version: 7.0NG.774-231207 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 532bd8b166..44d1fd3ef3 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.774-231130" +pandora_version="7.0NG.774-231207" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index 234ec4e997..03db82db4e 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -1720,3 +1720,4 @@ include/functions_integriaims.php include/ajax/integria_incidents.ajax.php enterprise/operation/log/log_source.php enterprise/include/class/LogSource.class.php +include/chart_generator.php \ No newline at end of file diff --git a/pandora_console/extras/mr/67.sql b/pandora_console/extras/mr/67.sql index b46c5eb194..214c28268a 100644 --- a/pandora_console/extras/mr/67.sql +++ b/pandora_console/extras/mr/67.sql @@ -1058,13 +1058,15 @@ UPDATE talert_actions SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_' WHERE id=11; -- Delete table tagent_access -DROP TABLE tagent_access; +DROP TABLE IF EXISTS tagent_access; ALTER TABLE `tevent_rule` DROP COLUMN `user_comment`; ALTER TABLE `tevent_rule` DROP COLUMN `operator_user_comment`; ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL; +ALTER TABLE `tevent_filter` +ADD COLUMN `regex` TEXT NULL AFTER `private_filter_user`; -- Update macros for plugin oracle UPDATE `tdiscovery_apps` SET `version` = '1.1' WHERE `short_name` = 'pandorafms.oracle'; @@ -1077,9 +1079,19 @@ INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, ` 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; +-- Update lts updates +UPDATE tconfig SET value='1' WHERE token='lts_updates'; + ALTER TABLE `tdashboard` ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`, ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`, ADD COLUMN `date_to` INT NOT NULL DEFAULT 0 AFTER `date_from`; +SELECT @generic_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_data"; +SELECT @generic_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_proc"; +SELECT @async_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_data"; +SELECT @async_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_proc"; +UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_data WHERE `tagente_modulo`.`id_tipo_modulo` = @async_data; +UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_proc WHERE `tagente_modulo`.`id_tipo_modulo` = @async_proc; + COMMIT; diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 557b855e09..26bae75929 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -600,43 +600,176 @@ html_print_div( 'content' => html_print_table($tableAgent, true).$CodeQRTable, ] ); -/* - TODO REVIEW - $table_satellite = ''; - if ($remote_agent === true) { - // Satellite server selector. - $satellite_servers = db_get_all_rows_filter( - 'tserver', - ['server_type' => SERVER_TYPE_ENTERPRISE_SATELLITE], - [ - 'id_server', - 'name', - ] - ); - $satellite_names = []; - if (empty($satellite_servers) === false) { - foreach ($satellite_servers as $s_server) { - $satellite_names[$s_server['id_server']] = $s_server['name']; +// Basic Options. +$tableBasicAgent = new stdClass(); +$tableBasicAgent->class = 'filter-table-adv'; +$tableBasicAgent->data = []; +$disabledBasic = false; +$tableClassDisabled = ''; +if ($new_agent === true || $remote_agent === false || $has_remote_conf === false) { + $disabledBasic = true; + $tableClassDisabled = ' basic-options-disabled'; +} + +if (enterprise_installed()) { + // Get all plugins (BASIC OPTIONS). + $agent_plugin = new PandoraFMS\Agent($id_agente); + $plugins = $agent_plugin->getPlugins(); + // Check if some plugin was enabled/disabled in conf. + foreach ($plugins as $key => $row) { + if (preg_match('/pandora_hardening/', $row['raw']) === 1) { + if ($row['disabled'] === 1) { + $security_hardening = 0; + } else { + $security_hardening = 1; + } } - $table_satellite = '

'.__('Satellite').'

'; - $table_satellite .= '
'; + if ($id_os === '1' || $id_os === '8') { + if (preg_match('/(module_plugin grep_log_module ).*/', $row['raw']) === 1) { + if ($row['disabled'] === 1) { + $enable_log_collector = 0; + } else { + $enable_log_collector = 1; + } + } - $table_satellite .= html_print_input( + if (preg_match('/(module_plugin inventory).*/', $row['raw']) === 1) { + if ($row['disabled'] === 1) { + $enable_inventory = 0; + } else { + $enable_inventory = 1; + } + } + } else { + if (preg_match('/.vbs/', $row['raw']) === 1 && preg_match('/nettraffic.vbs/', $row['raw']) === 0 && preg_match('/software_installed.vbs/', $row['raw']) === 0 && preg_match('/df.vbs/', $row['raw']) === 0 && preg_match('/win_cf.vbs/', $row['raw']) === 0) { + if ($row['disabled'] === 1) { + $enable_inventory = 0; + } else { + $enable_inventory = 1; + } + } + } + } + + if ($id_os === '9') { + $modules = $agent_plugin->getModules(); + foreach ($modules as $key => $row) { + if (preg_match('/PandoraAgent_log/', $row['raw']) === 1) { + if ($row['disabled'] === 1) { + $enable_log_collector = 0; + } else { + $enable_log_collector = 1; + } + } + } + } + + unset($agent_plugin, $plugins); + if (($new_agent === true && $config['current_package'] >= 774) || ($agent_version >= 774 && $new_agent === false)) { + if ($disabledBasic === true || $has_remote_conf === false) { + $message = __('Remote config disabled, please activate to enable agent basic options'); + $tableBasicAgent->data[] = ''.$message.''; + } + + $tableBasicAgent->data[] = html_print_label_input_block( + __('Enable security hardening monitoring'), + html_print_input( [ - 'type' => 'select', - 'fields' => $satellite_names, - 'name' => 'satellite_server', - 'selected' => $satellite_server, - 'nothing' => __('None'), - 'nothinf_value' => 0, - 'return' => true, + 'type' => 'switch', + 'id' => 'security_hardening', + 'name' => 'security_hardening', + 'value' => $security_hardening, + 'disabled' => $disabledBasic, ] - ).'
'; + ).html_print_input_hidden('options_package', '1', true) + ); + + $tableBasicAgent->data[] = html_print_label_input_block( + __('Enable log collection'), + html_print_input( + [ + 'type' => 'switch', + 'id' => 'enable_log_collector', + 'name' => 'enable_log_collector', + 'value' => $enable_log_collector, + 'disabled' => $disabledBasic, + ] + ) + ); } + + $tableBasicAgent->data[] = html_print_label_input_block( + __('Enable inventory'), + html_print_input( + [ + 'type' => 'switch', + 'id' => 'enable_inventory', + 'name' => 'enable_inventory', + 'value' => $enable_inventory, + 'disabled' => $disabledBasic, + ] + ).html_print_input_hidden('enable_basic_options', '1', true) + ); + + if ($config['ehorus_enabled'] === '1') { + $pandoraRC_Id = html_print_image( + 'images/alert_recovered@svg.svg', + true, + [ + 'class' => 'invert_filter main_menu_icon', + 'title' => __('Pandora RC connected with id ').$config['ehorus_custom_field'], + ] + ); + } else { + $pandoraRC_Id = html_print_image( + 'images/alerts.svg', + true, + [ + 'class' => 'invert_filter main_menu_icon', + 'title' => __('This agent do not have a Pandora RC agent installed, install one.'), + ] + ); } -*/ + + $tableBasicAgent->data[] = html_print_label_input_block( + __('Enable remote control'), + $pandoraRC_Id + ); + + $WarningPackage = ''; + if (($new_agent === true && $config['current_package'] < 774) || ($agent_version < 774 && $new_agent === false)) { + $WarningPackage = html_print_image( + 'images/alert-yellow@svg.svg', + true, + [ + 'title' => __('Only available for agents 774 or higher'), + 'alt' => __('Only available for agents 774 or higher'), + 'class' => 'main_menu_icon mrgn_lft_5px', + ] + ); + } +} else { + $tableBasicAgent->data[] = ''.__('Remote config is enabled only in the Enteprise version').''; + $tableBasicAgent->data[] .= html_print_input_hidden( + 'enable_basic_options', + '0', + true + ); +} + +ui_toggle( + html_print_table($tableBasicAgent, true), + ''.__('Basic options').$WarningPackage.'', + '', + 'basic_options', + true, + false, + 'white_box_content', + 'no-border white_table_graph'.$tableClassDisabled, + 'box-flat white_table_graph invisible' +); // Advanced options. $tableAdvancedAgent = new stdClass(); @@ -1256,7 +1389,8 @@ ui_require_jquery_file('bgiframe'); }); $("#checkbox-cascade_protection").change(function () { - var checked = $("#checkbox-cascade_protection").is(":checked"); if (checked) { + var checked = $("#checkbox-cascade_protection").is(":checked"); + if (checked) { $("#cascade_protection_module").removeAttr("disabled"); $("#text-id_parent").attr("required", "required"); } @@ -1266,7 +1400,7 @@ ui_require_jquery_file('bgiframe'); $("#text-id_parent").removeAttr("required"); } }); - + var safe_mode_checked = $("#checkbox-safe_mode").is(":checked"); if (safe_mode_checked) { $("#safe_mode_module").removeAttr("disabled"); @@ -1274,10 +1408,10 @@ ui_require_jquery_file('bgiframe'); else { $("#safe_mode_module").attr("disabled", 'disabled'); } - + $("#checkbox-safe_mode").change(function () { var safe_mode_checked = $("#checkbox-safe_mode").is(":checked"); - + if (safe_mode_checked) { $("#safe_mode_module").removeAttr("disabled"); } @@ -1311,5 +1445,17 @@ ui_require_jquery_file('bgiframe'); } }); + check_basic_options(); + $('#id_os').on('change', function(){ + check_basic_options(); + }) }); + + function check_basic_options(){ + if ($('#id_os').val() == 1 || $('#id_os').val() == 8 || $('#id_os').val() == 9) { + $('#basic_options').removeClass('invisible'); + } else { + $('#basic_options').addClass('invisible'); + } + } diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 09ca22062e..b4abfa1ad7 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -232,7 +232,7 @@ if ($create_agent) { $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); - + $agent_version = $config['current_package']; $secondary_groups = (array) get_parameter('secondary_groups_selected', ''); $fields = db_get_all_fields_in_table('tagent_custom_fields'); @@ -300,6 +300,7 @@ if ($create_agent) { 'cps' => $cps, 'fixed_ip' => $fixed_ip, 'vul_scan_enabled' => $vul_scan_enabled, + 'agent_version' => $agent_version, ] ); } else { @@ -1015,6 +1016,13 @@ if ($update_agent) { $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); + $security_vunerability = (int) get_parameter_switch('security_vunerability', 0); + $security_hardening = (int) get_parameter_switch('security_hardening', 0); + $security_monitoring = (int) get_parameter_switch('security_monitoring', 0); + $enable_log_collector = (int) get_parameter_switch('enable_log_collector', 0); + $enable_inventory = (int) get_parameter_switch('enable_inventory', 0); + $enable_basic_options = get_parameter('enable_basic_options'); + $options_package = get_parameter('options_package', '0'); if ($fields === false) { $fields = []; @@ -1243,6 +1251,81 @@ if ($update_agent) { ); } } + + if ($enable_basic_options === '1') { + // Get all plugins (BASIC OPTIONS). + $agent = new PandoraFMS\Agent($id_agente); + $plugins = $agent->getPlugins(); + foreach ($plugins as $key => $row) { + // Only check plugins when agent package is bigger than 774. + if ($options_package === '1') { + if (preg_match('/pandora_hardening/', $row['raw']) === 1) { + if ($security_hardening === 1) { + if ($row['disabled'] === 1) { + $agent->enablePlugins($row['raw']); + } + } else { + if ($row['disabled'] !== 1) { + $agent->disablePlugins($row['raw']); + } + } + } + + if (preg_match('/(module_plugin grep_log_module ).*/', $row['raw']) === 1) { + if ($enable_log_collector === 1) { + if ($row['disabled'] === 1) { + $agent->enablePlugins($row['raw']); + } + } else { + if ($row['disabled'] !== 1) { + $agent->disablePlugins($row['raw']); + } + } + } + } + + // Inventory switch enable when basic options are enabled. + if (preg_match('/(module_plugin inventory).*/', $row['raw']) === 1) { + if ($enable_inventory === 1) { + if ($row['disabled'] === 1) { + $agent->enablePlugins($row['raw']); + } + } else { + if ($row['disabled'] !== 1) { + $agent->disablePlugins($row['raw']); + } + } + } + + // Inventory switch enable when basic options are enabled. + if (preg_match('/.vbs/', $row['raw']) === 1 && preg_match('/nettraffic.vbs/', $row['raw']) === 0 && preg_match('/software_installed.vbs/', $row['raw']) === 0 && preg_match('/df.vbs/', $row['raw']) === 0 && preg_match('/win_cf.vbs/', $row['raw']) === 0) { + if ($enable_inventory === 1) { + if ($row['disabled'] === 1) { + $agent->enablePlugins($row['raw']); + } + } else { + if ($row['disabled'] !== 1) { + $agent->disablePlugins($row['raw']); + } + } + } + } + + $modules = $agent->getModules(); + foreach ($modules as $key => $row) { + if (preg_match('/PandoraAgent_log/', $row['raw']) === 1) { + if ($enable_log_collector === 1) { + if ($row['disabled'] === 1) { + $agent->enableModule($row['module_name'], $row); + } + } else { + if ($row['disabled'] !== 1) { + $agent->disableModule($row['module_name'], $row); + } + } + } + } + } } // Read agent data @@ -1300,6 +1383,19 @@ if ($id_agente) { $satellite_server = (int) $agent['satellite_server']; $fixed_ip = (int) $agent['fixed_ip']; $vul_scan_enabled = (int) $agent['vul_scan_enabled']; + if (strpos($agent['agent_version'], '(')) { + $agent_version = (int) explode('.', explode('(', $agent['agent_version'])[0])[2]; + } else { + if (strpos($agent['agent_version'], 'build') || strpos($agent['agent_version'], 'Build')) { + $agent_version = (int) explode('.', explode('build', $agent['agent_version'])[0])[2]; + } else { + if (strpos($agent['agent_version'], '.')) { + $agent_version = (int) explode('.', $agent['agent_version'])[2]; + } else { + $agent_version = $agent['agent_version']; + } + } + } } $update_module = (bool) get_parameter('update_module'); diff --git a/pandora_console/godmode/agentes/module_manager_editor_plugin.php b/pandora_console/godmode/agentes/module_manager_editor_plugin.php index 970a2c4d9f..9b5d98c27d 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_plugin.php +++ b/pandora_console/godmode/agentes/module_manager_editor_plugin.php @@ -171,7 +171,7 @@ foreach ($password_fields as $k => $p) { } $(document).ready(function () { - if ($("#id_plugin").val() === 0) { + if ($("#id_plugin").val() !== 0) { changePluginSelect(); } }); diff --git a/pandora_console/godmode/alerts/alert_view.php b/pandora_console/godmode/alerts/alert_view.php index 8d4d07e578..7809742221 100644 --- a/pandora_console/godmode/alerts/alert_view.php +++ b/pandora_console/godmode/alerts/alert_view.php @@ -256,7 +256,7 @@ $schedule = io_safe_output( $data[0] = ''; $data[0] .= html_print_input_hidden('schedule', $schedule, true); -$data[0] .= '
'; +$data[0] .= '
'; $data[1] = ''; $table_conditions->data[] = $data; diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index 524ab245fb..cc9ed5d5f0 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -243,10 +243,15 @@ switch ($action) { $map_default_altitude = get_parameter('map_default_altitude'); $map_group_id = get_parameter('map_group_id'); $map_levels_zoom = get_parameter('map_levels_zoom', 16); - $map_connection_list_temp = explode(',', get_parameter('map_connection_list')); + $map_connection_list_temp_string = implode(',', $map_connection_list_temp); + if (strlen($map_connection_list_temp_string) > 0) { + $where_map_connection = ' WHERE id_tmap_connection IN('.$map_connection_list_temp_string.')'; + } else { + $where_map_connection = ''; + } - $listConnectionTemp = db_get_all_rows_sql('SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection'); + $listConnectionTemp = db_get_all_rows_sql('SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection'.$where_map_connection); foreach ($map_connection_list_temp as $index => $value) { $cleanValue = trim($value); @@ -256,7 +261,6 @@ switch ($action) { } $map_connection_default = get_parameter('map_connection_default'); - $map_connection_list = []; foreach ($listConnectionTemp as $idMapConnection) { $default = 0; @@ -345,7 +349,7 @@ function deleteConnectionMap(idConnectionMap) { checked = $("#radiobtn0001", $("#map_connection_" + idConnectionMap)).attr('checked'); $("#map_connection_" + idConnectionMap).remove(); - + if (checked) { //Checked first, but not is index = 0 maybe. @@ -485,7 +489,7 @@ foreach ($listConnectionTemp as $connectionTemp) { $table->data[1][0] = __('Add Map connection').$iconError; $table->data[1][1] = " - - + '; - return null; + if ($echo_tag === true) { + $filename .= '?v='.$config['current_package']; + $tag_name = ''; + if ($return === false) { + echo $tag_name; + return null; + } else { + return $tag_name; + } } if (! isset($config['js'])) { diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 5286c91670..98f99aefe1 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -1004,6 +1004,13 @@ function get_build_setup_charts($type, $options, $data) } } + // Set display grid true or false. + if (isset($options['grid']) === true) { + $scales = $chart->options()->getScales(); + $scales->getX()->grid()->setDrawOnChartArea($options['grid']); + $scales->getY()->grid()->setDrawOnChartArea($options['grid']); + } + // Radius is null maximum possible. if (isset($options['radius']) === true && empty($options['radius']) === false diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php index 5bfd03d244..e4324afd45 100644 --- a/pandora_console/include/graphs/functions_d3.php +++ b/pandora_console/include/graphs/functions_d3.php @@ -11,14 +11,14 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -function include_javascript_d3($return=false) +function include_javascript_d3($return=false, $force=false) { global $config; static $is_include_javascript = false; $output = ''; - if (!$is_include_javascript) { + if (!$is_include_javascript || $force === true) { $is_include_javascript = true; $output .= '
".html_print_select($listConnection, 'map_connection_list', '', '', '', '0', true)." + ".html_print_select($listConnection, 'select-map_connection_list', '', '', '', '0', true)." ".html_print_image( diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 694a2a6ea3..bcfb6f99c9 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -163,7 +163,10 @@ switch ($activeTab) { $background_color = (string) get_parameter('background_color'); $width = (int) get_parameter('width'); $height = (int) get_parameter('height'); - $visualConsoleName = (string) io_safe_input(get_parameter('name')); + $visualConsoleName = (string) get_parameter('name'); + $visualConsoleName = str_replace('<', '', $visualConsoleName); + $visualConsoleName = str_replace('>', '', $visualConsoleName); + $visualConsoleName = (string) io_safe_input($visualConsoleName); $is_favourite = (int) get_parameter('is_favourite_sent'); $auto_adjust = (int) get_parameter('auto_adjust_sent'); diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 7aa0c5d66d..56596af445 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -405,19 +405,6 @@ $table->data[$i++][] = html_print_label_input_block( $table->data[$i][] = html_print_label_input_block( - __('Enable Sflow'), - html_print_checkbox_switch_extended( - 'activate_sflow', - 1, - $config['activate_sflow'], - $rbt_disabled, - '', - '', - true - ), -); - -$table->data[$i++][] = html_print_label_input_block( __('General network path'), html_print_input_text( 'general_network_path', diff --git a/pandora_console/godmode/setup/setup_netflow.php b/pandora_console/godmode/setup/setup_netflow.php index b939a01825..9e6f6ee180 100644 --- a/pandora_console/godmode/setup/setup_netflow.php +++ b/pandora_console/godmode/setup/setup_netflow.php @@ -83,6 +83,19 @@ $table->data[3][] = html_print_label_input_block( html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true) ); +$table->data[4][] = html_print_label_input_block( + __('Enable Sflow'), + html_print_checkbox_switch_extended( + 'activate_sflow', + 1, + $config['activate_sflow'], + $rbt_disabled, + '', + '', + true + ), +); + echo '
'; html_print_table($table); html_print_input_hidden('update_config', 1); diff --git a/pandora_console/godmode/um_client/index.php b/pandora_console/godmode/um_client/index.php index c79502626a..1a78e39b5f 100644 --- a/pandora_console/godmode/um_client/index.php +++ b/pandora_console/godmode/um_client/index.php @@ -61,7 +61,7 @@ $license = db_get_value( ); if (isset($config['lts_updates']) === false) { - $config['lts_updates'] = false; + $config['lts_updates'] = true; } if (empty($license) === true) { diff --git a/pandora_console/godmode/update_manager/modal_lts_update.php b/pandora_console/godmode/update_manager/modal_lts_update.php new file mode 100644 index 0000000000..fc744b3b57 --- /dev/null +++ b/pandora_console/godmode/update_manager/modal_lts_update.php @@ -0,0 +1,111 @@ + + + + + + \ No newline at end of file diff --git a/pandora_console/godmode/update_manager/update_manager.php b/pandora_console/godmode/update_manager/update_manager.php index e201bc14dd..3cb774c4d5 100644 --- a/pandora_console/godmode/update_manager/update_manager.php +++ b/pandora_console/godmode/update_manager/update_manager.php @@ -119,11 +119,13 @@ switch ($tab) { case 'setup': include $config['homedir'].'/godmode/update_manager/update_manager.setup.php'; + include $config['homedir'].'/godmode/update_manager/modal_lts_update.php'; break; case 'offline': $mode = \UpdateManager\UI\Manager::MODE_OFFLINE; include $config['homedir'].'/godmode/um_client/index.php'; + include $config['homedir'].'/godmode/update_manager/modal_lts_update.php'; break; case 'online': @@ -163,5 +165,6 @@ switch ($tab) { $mode = \UpdateManager\UI\Manager::MODE_ONLINE; include $config['homedir'].'/godmode/um_client/index.php'; + include $config['homedir'].'/godmode/update_manager/modal_lts_update.php'; break; } diff --git a/pandora_console/godmode/update_manager/update_manager.setup.php b/pandora_console/godmode/update_manager/update_manager.setup.php index ac5471f96a..6fb56aed15 100644 --- a/pandora_console/godmode/update_manager/update_manager.setup.php +++ b/pandora_console/godmode/update_manager/update_manager.setup.php @@ -63,6 +63,10 @@ if (users_is_admin()) { } } +if (isset($config['lts_updates']) === false) { + config_update_value('lts_updates', 1); +} + if (!$action_update_url_update_manager) { $url_update_manager = get_parameter( 'url_update_manager', diff --git a/pandora_console/images/desacoplar-ventana.svg b/pandora_console/images/desacoplar-ventana.svg new file mode 100644 index 0000000000..0b3cbca31d --- /dev/null +++ b/pandora_console/images/desacoplar-ventana.svg @@ -0,0 +1,14 @@ + + + Icons/Dark/20/desacoplar-ventana + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/minimizar.svg b/pandora_console/images/minimizar.svg new file mode 100644 index 0000000000..957268b4ea --- /dev/null +++ b/pandora_console/images/minimizar.svg @@ -0,0 +1,7 @@ + + + Icons/Dark/20/minimizar + + + + \ No newline at end of file diff --git a/pandora_console/include/ajax/alert_list.ajax.php b/pandora_console/include/ajax/alert_list.ajax.php index d742f952e8..fd00f2eaee 100644 --- a/pandora_console/include/ajax/alert_list.ajax.php +++ b/pandora_console/include/ajax/alert_list.ajax.php @@ -435,6 +435,7 @@ if ($get_agent_alerts_datatable === true) { } $idGroup = $filter_alert['ag_group']; + $search_sg = $filter_alert['search_sg']; $tag_filter = $filter_alert['tag']; $action_filter = $filter_alert['action']; @@ -658,10 +659,9 @@ if ($get_agent_alerts_datatable === true) { $id_groups = array_keys( users_get_groups($config['id_user'], 'AR', false) ); + $alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter, $search_sg); - $alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter); - - $countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter); + $countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter, $search_sg); } } else { if ($idAgent !== 0) { @@ -673,9 +673,9 @@ if ($get_agent_alerts_datatable === true) { users_get_groups($config['id_user'], $access, false) ); - $alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter, false); + $alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter, false, $search_sg); - $countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter, false); + $countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter, false, $search_sg); } } diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index efb3e0deb4..0aea4cf37f 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -314,6 +314,7 @@ if ($save_event_filter) { $values['severity'] = implode(',', get_parameter('severity', -1)); $values['status'] = get_parameter('status'); $values['search'] = get_parameter('search'); + $values['regex'] = get_parameter('regex'); $values['not_search'] = get_parameter('not_search'); $values['text_agent'] = get_parameter('text_agent'); $values['id_agent'] = get_parameter('id_agent'); @@ -382,6 +383,7 @@ if ($update_event_filter) { $values['severity'] = implode(',', get_parameter('severity', -1)); $values['status'] = get_parameter('status'); $values['search'] = get_parameter('search'); + $values['regex'] = get_parameter('regex'); $values['not_search'] = get_parameter('not_search'); $values['text_agent'] = get_parameter('text_agent'); $values['id_agent'] = get_parameter('id_agent'); @@ -641,6 +643,8 @@ function load_form_filter() { $("#status").val(val); if (i == 'search') $('#text-search').val(val); + if (i == 'regex') + $('#text-regex').val(val); if (i == 'not_search') $('#checkbox-not_search').val(val); if (i == 'text_agent') @@ -971,6 +975,7 @@ function save_new_filter() { "severity" : $("#severity").val(), "status" : $("#status").val(), "search" : $("#text-search").val(), + "regex" : $('#text-regex').val(), "not_search" : $("#checkbox-not_search").val(), "text_agent" : $("#text_id_agent").val(), "id_agent" : $('input:hidden[name=id_agent]').val(), @@ -1051,6 +1056,7 @@ function save_update_filter() { "severity" : $("#severity").val(), "status" : $("#status").val(), "search" : $("#text-search").val(), + "regex" : $('#text-regex').val(), "not_search" : $("#checkbox-not_search").val(), "text_agent" : $("#text_id_agent").val(), "id_agent" : $('input:hidden[name=id_agent]').val(), @@ -2645,6 +2651,8 @@ if ($get_events_fired) { $filter['date_to'] = date('Y-m-d', $end); $filter['time_from'] = date('H:i:s', $start); $filter['time_to'] = date('H:i:s', $end); + $filter['severity'] = explode(',', $filter['severity']); + $data = events_get_all( ['te.*'], $filter diff --git a/pandora_console/include/chart_generator.php b/pandora_console/include/chart_generator.php deleted file mode 100644 index 529684569d..0000000000 --- a/pandora_console/include/chart_generator.php +++ /dev/null @@ -1,324 +0,0 @@ - 'api_password'] - ) - ); - - - if ($apiPassword === $data_decoded['apipass']) { - $bypassLogin = true; - } -} - -if (!isset($config[$slicebar])) { - $config[$slicebar] = $slicebar_value; -} - -// Try to initialize session using existing php session id. -$user = new PandoraFMS\User(['phpsessionid' => $session_id]); - -if (check_login(false) === false && $bypassLogin !== true) { - // Error handler. - ?> - - - - - Access denied - - - - - - - - - -

Access is not granted

-
'.html_print_input_text('map_connection_name_'.$mapConnection['id_conection'], $mapConnectionRowDB['conection_name'], '', 20, 40, true, true).' '.$radioButton.''.html_print_image('images/delete.svg', true, ['alt' => '', 'class' => 'invert_filter']).''.html_print_image('images/delete.svg', true, ['alt' => '', 'class' => 'invert_filter main_menu_icon']).'