diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index a49cc294bf..6433324056 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -528,23 +528,6 @@ ServerTokens Prod EO_CONFIG_F -# Add ws proxy options to apache. -cat >> /etc/httpd/conf.modules.d/00-proxy.conf << 'EO_HTTPD_MOD' -LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so - -EO_HTTPD_MOD - -cat >> /etc/httpd/conf.d/wstunnel.conf << 'EO_HTTPD_WSTUNNEL' -ProxyRequests Off - - Require all granted - - -ProxyPass /ws ws://127.0.0.1:8080 -ProxyPassReverse /ws ws://127.0.0.1:8080 - -EO_HTTPD_WSTUNNEL - # Temporal quitar htaccess sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/images/.htaccess sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess @@ -691,16 +674,6 @@ EO_LRA chmod 0644 /etc/logrotate.d/pandora_server chmod 0644 /etc/logrotate.d/pandora_agent -# Add websocket engine start script. -mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ -chmod +x /etc/init.d/pandora_websocket_engine - -# Start Websocket engine -/etc/init.d/pandora_websocket_engine start &>> $LOGFILE - -# Configure websocket to be started at start. -systemctl enable pandora_websocket_engine &>> $LOGFILE - # Enable pandora ha service systemctl enable pandora_server --now &>> $LOGFILE execute_cmd "systemctl start pandora_server" "Starting Pandora FMS Server" diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index 72ee496fa0..e6af38ecde 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -394,8 +394,8 @@ console_dependencies=" \ mod_ssl \ libzstd \ openldap-clients \ - https://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \ - https://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \ + https://firefly.pandorafms.com/centos8/chromium-122.0.6261.128-1.el8.x86_64.rpm \ + https://firefly.pandorafms.com/centos8/chromium-common-122.0.6261.128-1.el8.x86_64.rpm \ https://firefly.pandorafms.com/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ https://firefly.pandorafms.com/centos8/pandora_gotty-1.0-1.el8.x86_64.rpm \ https://firefly.pandorafms.com/centos8/pandorafms_made-0.1.0-1.el8.x86_64.rpm \ @@ -639,23 +639,6 @@ ServerTokens Prod EO_CONFIG_F -# Add ws proxy options to apache. -cat >> /etc/httpd/conf.modules.d/00-proxy.conf << 'EO_HTTPD_MOD' -LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so - -EO_HTTPD_MOD - -cat >> /etc/httpd/conf.d/wstunnel.conf << 'EO_HTTPD_WSTUNNEL' -ProxyRequests Off - - Require all granted - - -ProxyPass /ws ws://127.0.0.1:8080 -ProxyPassReverse /ws ws://127.0.0.1:8080 - -EO_HTTPD_WSTUNNEL - # Temporal quitar htaccess sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/images/.htaccess sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess @@ -813,16 +796,6 @@ EO_LRA chmod 0644 /etc/logrotate.d/pandora_server chmod 0644 /etc/logrotate.d/pandora_agent -# Add websocket engine start script. -mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ &>> "$LOGFILE" -chmod +x /etc/init.d/pandora_websocket_engine &>> "$LOGFILE" - -# Start Websocket engine -/etc/init.d/pandora_websocket_engine start &>> "$LOGFILE" - -# Configure websocket to be started at start. -systemctl enable pandora_websocket_engine &>> "$LOGFILE" - # Enable pandora ha service systemctl enable pandora_server --now &>> "$LOGFILE" execute_cmd "/etc/init.d/pandora_server start" "Starting Pandora FMS Server" diff --git a/extras/deploy-scripts/pandora_deploy_community_el9.sh b/extras/deploy-scripts/pandora_deploy_community_el9.sh index 70b473b49b..738833d774 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el9.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el9.sh @@ -386,8 +386,8 @@ console_dependencies=" \ mod_ssl \ libzstd \ openldap-clients \ - https://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \ - https://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \ + https://firefly.pandorafms.com/centos8/chromium-122.0.6261.128-1.el8.x86_64.rpm \ + https://firefly.pandorafms.com/centos8/chromium-common-122.0.6261.128-1.el8.x86_64.rpm \ https://firefly.pandorafms.com/centos8/pandora_gotty-1.0-1.el8.x86_64.rpm \ https://firefly.pandorafms.com/centos8/pandorafms_made-0.1.0-1.el8.x86_64.rpm " execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies" diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh index 6d0bb69d06..64beb74eb2 100644 --- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -371,7 +371,7 @@ ln -s /usr/bin/fping /usr/sbin/fping &>> "$LOGFILE" # Chrome rm -f /usr/bin/chromium-browser &>> "$LOGFILE" -CHROME_VERSION=google-chrome-stable_110.0.5481.177-1_amd64.deb +CHROME_VERSION=google-chrome-stable_122.0.6261.128-1_amd64.deb execute_cmd "wget https://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/${CHROME_VERSION}" "Downloading google chrome" execute_cmd "apt install -y ./${CHROME_VERSION}" "Intalling google chrome" execute_cmd "ln -s /usr/bin/google-chrome /usr/bin/chromium-browser" "Creating /usr/bin/chromium-browser Symlink" @@ -601,6 +601,7 @@ EOF_PARAM a2enmod ssl &>> "$LOGFILE" a2enmod headers &>> "$LOGFILE" +a2enmod rewrite &>> "$LOGFILE" a2enconf ssl-params &>> "$LOGFILE" a2ensite default-ssl &>> "$LOGFILE" a2enconf ssl-params &>> "$LOGFILE" @@ -648,17 +649,6 @@ ServerTokens Prod EO_CONFIG_F -#Enable quickshell proxy -cat >> /etc/apache2/mods-enabled/00-proxy.conf << 'EO_HTTPD_WSTUNNEL' -ProxyRequests Off - - Require all granted - - -ProxyPass /ws ws://127.0.0.1:8080 -ProxyPassReverse /ws ws://127.0.0.1:8080 -EO_HTTPD_WSTUNNEL - # Fixing console permissions chmod 600 $PANDORA_CONSOLE/include/config.php &>> "$LOGFILE" chown -R www-data:www-data $PANDORA_CONSOLE &>> "$LOGFILE" @@ -813,16 +803,6 @@ EO_LRA chmod 0644 /etc/logrotate.d/pandora_server chmod 0644 /etc/logrotate.d/pandora_agent -# Add websocket engine start script. -mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ &>> "$LOGFILE" -chmod +x /etc/init.d/pandora_websocket_engine &>> "$LOGFILE" - -# Start Websocket engine -/etc/init.d/pandora_websocket_engine start &>> "$LOGFILE" - -# Configure websocket to be started at start. -systemctl enable pandora_websocket_engine &>> "$LOGFILE" - # Enable pandora ha service execute_cmd "/etc/init.d/pandora_server start" "Starting Pandora FMS Server" systemctl enable pandora_server &>> "$LOGFILE" diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index 4f49fb8cf5..8cb980cff1 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -310,10 +310,6 @@ module_plugin pandora_df #module_description Postcondition test module #module_end -# This plugin runs several security checks in a Linux system - -#module_plugin pandora_security_check - # Extraction module example #module_begin #module_name Collector diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 1a93e1bda0..f2fc81555f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240402 +Version: 7.0NG.776-240408 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 dd97783482..500d41858f 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.776-240402" +pandora_version="7.0NG.776-240408" 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/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 882be1bda8..20714a13b7 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -270,6 +270,9 @@ module_plugin pandora_netusage # Service autodiscovery plugin module_plugin autodiscover --default +# This plugin runs several security checks in a Linux system +# module_plugin perl /usr/share/pandora_agent/plugins/pandora_security_check --conf /usr/share/pandora_agent/plugins/pandora_security_check.conf + # Plugin for inventory on the agent. # module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f8917912c2..6a1e830b5f 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.776'; -use constant AGENT_BUILD => '240402'; +use constant AGENT_BUILD => '240408'; # 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 87257d94e7..3446c15200 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.776 -%define release 240402 +%define release 240408 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 b10f85df8d..498f1430ed 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.776 -%define release 240402 +%define release 240408 %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 9c6a6060ee..64da22869f 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.776 -%define release 240402 +%define release 240408 %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 75e053f16e..9152dfa7c7 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.776 -%define release 240402 +%define release 240408 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 95cdfb9cb1..1478e1c157 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.776 -%define release 240402 +%define release 240408 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 8b89c4b715..adbea36a25 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240402" +PI_BUILD="240408" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/unix/plugins/pandora_security_check b/pandora_agents/unix/plugins/pandora_security_check index 0ad845639b..53022feba7 100644 --- a/pandora_agents/unix/plugins/pandora_security_check +++ b/pandora_agents/unix/plugins/pandora_security_check @@ -297,6 +297,10 @@ sub parse_configuration { $line =~ s/^\s+//; $line =~ s/\s+$//; + if($line =~ /^$/) { + next; + } + if ($line =~ /^\[($b_ports|$b_files|$b_passwords)\]$/) { $configuration_block = $1; } @@ -537,7 +541,6 @@ if ($check_files) { if ($can_check_files) { # Check each file integrity - my @errored_files; my @no_integrity_files; # Create unique check files list @@ -556,8 +559,6 @@ if ($check_files) { push @no_integrity_files, $file; } $integrity{$file_key} = $file_md5; - } else { - push @errored_files, $file; } } @@ -571,11 +572,6 @@ if ($check_files) { $value = 0; $desc = "Changed files found:\n" . join("\n", @no_integrity_files); } - - if (@errored_files) { - $value = 0; - $desc .= "\nUnable to check integrity of some files:\n" . join("\n", @errored_files); - } } print_xml_module('Files check status', 'generic_proc', $desc, $value); @@ -596,10 +592,15 @@ if ($check_passwords) { open my $shadow_fh, '<', $shadow_file; while (my $line = <$shadow_fh>) { chomp $line; + + if($line =~ /^$/) { + next; + } + my ($username, $password_hash, @rest) = split /:/, $line; # Skip users with no password hash - if ($password_hash ne "*" && $password_hash ne "!!" && $password_hash ne "!locked") { + if ($password_hash ne "*" && $password_hash ne "!!" && $password_hash ne "!locked" && $password_hash ne "!*") { my $salt = substr($password_hash, 0, rindex($password_hash, '$') + 1); my $user_hash = crypt($username, $salt); if ($user_hash eq $password_hash) { diff --git a/pandora_agents/unix/plugins/pandora_security_check.conf b/pandora_agents/unix/plugins/pandora_security_check.conf new file mode 100644 index 0000000000..c48d94af4d --- /dev/null +++ b/pandora_agents/unix/plugins/pandora_security_check.conf @@ -0,0 +1,22 @@ +[PORTS] +22 +80 +443 +41121 +8080 + +[FILES] +/etc/httpd/httpd.conf +/etc/my.cnf +/etc/sudoers +/etc/passwd +/etc/hosts + +[PASSWORDS] +pandora +PANDORA +P4nd0r4 +password +root +linux +admin diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 38490f2f6d..03adfba75e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240402} +{240408} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 33b0ea0cdf..4524724159 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.776 Build 240402") +#define PANDORA_VERSION ("7.0NG.776 Build 240408") string pandora_path; string pandora_dir; @@ -53,6 +53,9 @@ Key_Value::parseLine (string str) { string trimmedstr; trimmedstr = trim (str); + if (trimmedstr == "") { + return; + } /* Check if the string has " */ pos = trimmedstr.find ("\""); diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c7fc47bd7b..b11833f024 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.776(Build 240402))" + VALUE "ProductVersion", "(7.0NG.776(Build 240408))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b1fe76adcb..7969f1621d 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240402 +Version: 7.0NG.776-240408 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 debdb72758..88ff098d15 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.776-240402" +pandora_version="7.0NG.776-240408" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql index 19dfe33d6d..63e3a21b32 100644 --- a/pandora_console/extras/mr/69.sql +++ b/pandora_console/extras/mr/69.sql @@ -2,6 +2,10 @@ START TRANSACTION; DROP TABLE tskin; +ALTER TABLE tfavmenu_user CONVERT TO CHARACTER SET UTF8MB4; +ALTER TABLE tfiles_repo CONVERT TO CHARACTER SET UTF8MB4; +ALTER TABLE tfiles_repo_group CONVERT TO CHARACTER SET UTF8MB4; + ALTER TABLE `tusuario` ADD COLUMN `stop_lts_modal` TINYINT NOT NULL DEFAULT 0 AFTER `session_max_time_expire`; @@ -7708,4 +7712,38 @@ UPDATE `twelcome_tip` SET url = 'https://pandorafms.com/manual/!current/start?id DELETE FROM tconfig WHERE `token` = 'legacy_database_ha'; +-- Add new columns in tdeployment_hosts +ALTER TABLE `tdeployment_hosts` ADD COLUMN `deploy_method` ENUM('SSH', 'HTTP', 'HTTPS') DEFAULT 'SSH'; +ALTER TABLE `tdeployment_hosts` ADD COLUMN `deploy_port` INT UNSIGNED NOT NULL DEFAULT 22; +ALTER TABLE `tdeployment_hosts` ADD COLUMN `server_port` INT UNSIGNED NOT NULL DEFAULT 41121; +ALTER TABLE `tdeployment_hosts` ADD COLUMN `temp_folder` VARCHAR(500) DEFAULT '/tmp'; + +UPDATE + `tdeployment_hosts`, `tconfig_os` +SET + `tdeployment_hosts`.`deploy_method` = 'HTTP', + `tdeployment_hosts`.`deploy_port` = 5985, + `tdeployment_hosts`.`temp_folder` = 'C:\Widnows\Temp' +WHERE + `tdeployment_hosts`.`id_os` = `tconfig_os`.`id_os` AND `tconfig_os`.`name` = 'Windows' AND `tdeployment_hosts`.`deployed` = 0; + +-- Find the name of the foreign key constraint +SELECT @constraint_name := `constraint_name` +FROM `information_schema`.`key_column_usage` +WHERE `table_name` = 'tdeployment_hosts' AND `column_name` = 'id_os'; + +-- Drop the foreign key constraint using dynamic SQL +SET @drop_fk_query = CONCAT('ALTER TABLE `tdeployment_hosts` DROP FOREIGN KEY ', @constraint_name); +PREPARE stmt FROM @drop_fk_query; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +-- Drop unused columns in tdeployment_hosts +ALTER TABLE `tdeployment_hosts` DROP COLUMN `id_os`; +ALTER TABLE `tdeployment_hosts` DROP COLUMN `os_version`; +ALTER TABLE `tdeployment_hosts` DROP COLUMN `arch`; + +-- Update all deployment recon tasks port +UPDATE `trecon_task` SET `field4` = 41121 WHERE `type` = 9; + COMMIT; \ No newline at end of file diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index c1c9159134..f4aefb957a 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -936,7 +936,7 @@ $switchButtons[] = html_print_radio_button_extended( ); $tableAdvancedAgent->data['module_definition'][] = html_print_label_input_block( - __('Module definition').ui_print_help_tip(__('Three working modes can be selected for module definition. Learning mode: Default mode, if an XML arrives with new modules, they will be created automatically; it is a learning behavior. Normal mode: If an XML arrives with new modules, they will only be created if they are previously declared in the Console. Autodisable mode: It is the same as learning mode, but if all modules go into unknown, the agent will be disabled until information arrives again.'), true), + __('Module definition').ui_print_help_tip(__('Three working modes can be selected for module definition. Learning mode: Default mode, if an XML arrives with new modules, they will be created automatically; it is a learning behavior. Normal mode: If an XML arrives with new modules, they will only be created if they are previously declared in the Console. Autodisable mode: It is the same as learning mode, but if all modules go into unknown, the agent will be disabled until information arrives again.'), true).clippy_context_help('modules_not_learning_mode'), html_print_div( [ 'class' => 'switch_radio_button', @@ -1297,7 +1297,6 @@ if ($modo == 0) { echo "'; if ($new_agent === false) { @@ -1434,15 +1433,15 @@ ui_require_jquery_file('bgiframe'); function show_modules_not_learning_mode_context_help() { if ($("input[name='modo'][value=0]").is(':checked')) { - $("#modules_not_learning_mode_context_help").show().css('padding-right','8px'); - } - else { - $("#modules_not_learning_mode_context_help").hide(); + $(".div-modules_not_learning_mode").show(); + } else { + $(".div-modules_not_learning_mode").hide(); } } $(document).ready (function() { + show_modules_not_learning_mode_context_help(); var $id_agent = ''; var previous_primary_group_select; diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index aec6b98f4a..f98567d948 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1292,10 +1292,18 @@ if ($update_agent) { // Get all plugins (BASIC OPTIONS). $agent = new PandoraFMS\Agent($id_agente); $plugins = $agent->getPlugins(); + $pluginsToWrite = [ + 'security_hardening' => [ + 'write' => $security_hardening, + 'raw' => "module_begin \nmodule_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150 \nmodule_absoluteinterval 7d \nmodule_end", + ], + ]; + 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) { + $pluginsToWrite['security_hardening']['write'] = 0; if ($security_hardening === 1) { if ($row['disabled'] === 1) { $agent->enablePlugins($row['raw']); @@ -1347,6 +1355,12 @@ if ($update_agent) { } } + foreach ($pluginsToWrite as $name => $val) { + if ($val['write'] === 1) { + $result = $agent->addPlugins(io_safe_output($val['raw']), true); + } + } + $modules = $agent->getModules(); foreach ($modules as $key => $row) { diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index eb3b49c055..51607427fa 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -912,23 +912,30 @@ if ($modules !== false) { if ((bool) $linked !== false) { if ((bool) $adopt === true) { - $img = 'images/policies_brick.png'; + $img = 'images/policies_brick.svg'; $title = '('.__('Adopted').') '.$policyInfo['name_policy']; } else { - $img = 'images/policies_mc.png'; + $img = 'images/policy@svg.svg'; $title = $policyInfo['name_policy']; } } else { if ((bool) $adopt === true) { - $img = 'images/policies_not_brick.png'; + $img = 'images/policies_not_brick.svg'; $title = '('.__('Unlinked').') ('.__('Adopted').') '.$policyInfo['name_policy']; } else { - $img = 'images/unlinkpolicy.png'; + $img = 'images/unlinkpolicy.svg'; $title = '('.__('Unlinked').') '.$policyInfo['name_policy']; } } - $data[1] = ''.html_print_image($img, true, ['title' => $title]).''; + $data[1] = ''.html_print_image( + $img, + true, + [ + 'title' => $title, + 'class' => 'main_menu_icon', + ] + ).''; } } diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index fe0790f71b..0df61ee1c2 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -712,9 +712,9 @@ foreach ($simple_alerts as $alert) { WHERE id = '.$alert['id_alert_template'] ); if ($default_action != '') { - $data[3] .= "'; + $data[3] .= ''; $data[3] .= ''; } @@ -722,7 +722,7 @@ foreach ($simple_alerts as $alert) { $data[3] .= ''; $data[3] .= ''; $data[3] .= '