diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 46f2eb7cea..78449cac7d 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-231020 +Version: 7.0NG.773.3-231024 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 6f559ea69c..e2fb7b5786 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.773.3-231020" +pandora_version="7.0NG.773.3-231024" 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 1b8131a42d..179f98dac8 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -313,6 +313,6 @@ module_plugin autodiscover --default #Hardening plugin for security compliance analysis. Enable to use it. #module_begin -#module_plugin /usr/share/pandora_agent/plugins/pandora_sca +#module_plugin /usr/share/pandora_agent/plugins/pandora_sca -t 150 #module_absoluteinterval 7d -#module_end \ No newline at end of file +#module_end diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 76ac179009..d35d45fd9d 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '231020'; +use constant AGENT_BUILD => '231024'; # 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 0806c3576f..47241efe72 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.773.3 -%define release 231020 +%define release 231024 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 3faf9f2ac5..1d083c4790 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.773.3 -%define release 231020 +%define release 231024 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 caa4a459ab..1f76bd9650 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.773.3 -%define release 231020 +%define release 231024 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 2fa6e02e56..0cbc4f92d3 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231020" +PI_BUILD="231024" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index d299325f3b..cd64fa670b 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -526,7 +526,7 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default # Hardening plugin for security compliance analysis. #module_begin -#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_sca.exe" +#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_sca.exe -t 150" #module_absoluteinterval 7d #module_end diff --git a/pandora_agents/win32/bin/util/pandora_sca.exe b/pandora_agents/win32/bin/util/pandora_sca.exe index be447566e1..25776c36b6 100755 --- a/pandora_agents/win32/bin/util/pandora_sca.exe +++ b/pandora_agents/win32/bin/util/pandora_sca.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d93bd9d56c938063045fa2093198d324746f84df2b74567648f3baebd635657 -size 5248006 +oid sha256:db207ef67053764be7e9b42cd04ea5509cc2a023548aab1c037745ca277b68a3 +size 4858753 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 726d8a6bfa..3dc24116ab 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231020} +{231024} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b58c64ba1d..57fc6ca3c3 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.773.3 Build 231020") +#define PANDORA_VERSION ("7.0NG.773.3 Build 231024") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3450bc3692..4f0d19d6be 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.773.3(Build 231020))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 231024))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d4d4eaf279..1f2b9abcf9 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-231020 +Version: 7.0NG.773.3-231024 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 e93109ed8b..32ddad8f60 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.773.3-231020" +pandora_version="7.0NG.773.3-231024" 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 a3c2eea0ca..8a9c50f605 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -106,6 +106,7 @@ enterprise/godmode/alerts/alert_events.php enterprise/godmode/alerts/alert_events_list.php enterprise/godmode/alerts/alert_events_rules.php enterprise/godmode/alerts/configure_alert_rule.php +enterprise/godmode/alerts/alert_correlation.php enterprise/include/functions_networkmap.php enterprise/operation/agentes/pandora_networkmap.view.php enterprise/include/ajax/map_enterprise.ajax.php diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index 9b097225c5..c9ea912e91 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -6,6 +6,98 @@ ALTER TABLE `ttrap` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0; UPDATE ttrap SET utimestamp=UNIX_TIMESTAMP(timestamp); +CREATE TABLE IF NOT EXISTS `tlog_alert` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `name` TEXT , + `description` MEDIUMTEXT, + `order` INT UNSIGNED DEFAULT 0, + `mode` ENUM('PASS','DROP'), + `field1` TEXT , + `field2` TEXT , + `field3` TEXT , + `field4` TEXT , + `field5` TEXT , + `field6` TEXT , + `field7` TEXT , + `field8` TEXT , + `field9` TEXT , + `field10` TEXT , + `time_threshold` INT NOT NULL DEFAULT 86400, + `max_alerts` INT UNSIGNED NOT NULL DEFAULT 1, + `min_alerts` INT UNSIGNED NOT NULL DEFAULT 0, + `time_from` time DEFAULT '00:00:00', + `time_to` time DEFAULT '00:00:00', + `monday` TINYINT DEFAULT 1, + `tuesday` TINYINT DEFAULT 1, + `wednesday` TINYINT DEFAULT 1, + `thursday` TINYINT DEFAULT 1, + `friday` TINYINT DEFAULT 1, + `saturday` TINYINT DEFAULT 1, + `sunday` TINYINT DEFAULT 1, + `recovery_notify` TINYINT DEFAULT 0, + `field1_recovery` TEXT, + `field2_recovery` TEXT, + `field3_recovery` TEXT, + `field4_recovery` TEXT, + `field5_recovery` TEXT, + `field6_recovery` TEXT, + `field7_recovery` TEXT, + `field8_recovery` TEXT, + `field9_recovery` TEXT, + `field10_recovery` TEXT, + `id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0, + `internal_counter` INT DEFAULT 0, + `last_fired` BIGINT NOT NULL DEFAULT 0, + `last_reference` BIGINT NOT NULL DEFAULT 0, + `times_fired` INT NOT NULL DEFAULT 0, + `disabled` TINYINT DEFAULT 0, + `standby` TINYINT DEFAULT 0, + `priority` TINYINT DEFAULT 0, + `force_execution` TINYINT DEFAULT 0, + `group_by` enum ('','id_agente','id_agentmodule','id_alert_am','id_grupo') DEFAULT '', + `special_days` TINYINT DEFAULT 0, + `disable_event` TINYINT DEFAULT 0, + `id_template_conditions` INT UNSIGNED NOT NULL DEFAULT 0, + `id_template_fields` INT UNSIGNED NOT NULL DEFAULT 0, + `last_evaluation` BIGINT NOT NULL DEFAULT 0, + `pool_occurrences` INT UNSIGNED NOT NULL DEFAULT 0, + `schedule` TEXT, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +CREATE TABLE IF NOT EXISTS `tlog_rule` ( + `id_log_rule` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_log_alert` INT UNSIGNED NOT NULL, + `operation` ENUM('NOP', 'AND','OR','XOR','NAND','NOR','NXOR'), + `order` INT UNSIGNED DEFAULT 0, + `window` INT NOT NULL DEFAULT 0, + `count` INT NOT NULL DEFAULT 1, + `name` TEXT, + `log_content` TEXT, + `log_source` TEXT, + `log_agent` TEXT, + `operator_log_content` TEXT COMMENT 'Operator for log_content', + `operator_log_source` TEXT COMMENT 'Operator for log_source', + `operator_log_agent` TEXT COMMENT 'Operator for log_agent', + PRIMARY KEY (`id_log_rule`), + KEY `idx_id_log_alert` (`id_log_alert`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +CREATE TABLE IF NOT EXISTS `tlog_alert_action` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_log_alert` INT UNSIGNED NOT NULL, + `id_alert_action` INT UNSIGNED NOT NULL, + `fires_min` INT UNSIGNED DEFAULT 0, + `fires_max` INT UNSIGNED DEFAULT 0, + `module_action_threshold` INT NOT NULL DEFAULT 0, + `last_execution` BIGINT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + FOREIGN KEY (`id_log_alert`) REFERENCES tlog_alert(`id`) + ON DELETE CASCADE ON UPDATE CASCADE, + FOREIGN KEY (`id_alert_action`) REFERENCES talert_actions(`id`) + ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` ( `id` INT NOT NULL auto_increment, `filter_name` VARCHAR(45) NULL, @@ -271,5 +363,10 @@ SET @id_os = 9; INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`) SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'ID:STATUS' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os); +INSERT INTO tmodule_group (name) SELECT ('Security') WHERE NOT EXISTS (SELECT name FROM tmodule_group WHERE LOWER(name) = 'security'); + +ALTER TABLE tagente_modulo ADD COLUMN `last_compact` TIMESTAMP NOT NULL DEFAULT 0; + +UPDATE `tevent_alert` ea INNER JOIN `tevent_rule` er ON ea.id = er.id_event_alert SET disabled=1 WHERE er.log_agent IS NOT NULL OR er.log_content IS NOT NULL OR er.log_source IS NOT NULL; COMMIT; diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index 6567347999..df6fe6e86e 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -26,14 +26,16 @@ * ============================================================================ */ +use PandoraFMS\TacticalView\GeneralTacticalView; + // Config functions. -require_once 'include/config.php'; + require_once 'include/config.php'; -// This solves problems in enterprise load. -global $config; + // This solves problems in enterprise load. + global $config; -check_login(); -// ACL Check. + check_login(); + // ACL Check. if (check_acl($config['id_user'], 0, 'AR') === 0) { db_pandora_audit( AUDIT_LOG_ACL_VIOLATION, @@ -43,322 +45,5 @@ if (check_acl($config['id_user'], 0, 'AR') === 0) { exit; } -require_once 'include/functions_reporting.php'; -require_once 'include/functions_tactical.php'; -require_once $config['homedir'].'/include/functions_graph.php'; - -if (tags_has_user_acl_tags()) { - ui_print_tags_warning(); -} - -$all_data = tactical_status_modules_agents( - $config['id_user'], - false, - 'AR' -); -$data = []; - -$data['monitor_not_init'] = (int) $all_data['_monitors_not_init_']; -$data['monitor_unknown'] = (int) $all_data['_monitors_unknown_']; -$data['monitor_ok'] = (int) $all_data['_monitors_ok_']; -$data['monitor_warning'] = (int) $all_data['_monitors_warning_']; -$data['monitor_critical'] = (int) $all_data['_monitors_critical_']; -$data['monitor_not_normal'] = (int) $all_data['_monitor_not_normal_']; -$data['monitor_alerts'] = (int) $all_data['_monitors_alerts_']; -$data['monitor_alerts_fired'] = (int) $all_data['_monitors_alerts_fired_']; -$data['monitor_total'] = (int) $all_data['_monitor_total_']; - - -$data['total_agents'] = (int) $all_data['_total_agents_']; - -$data['monitor_checks'] = (int) $all_data['_monitor_checks_']; -if (!empty($all_data)) { - if ($data['monitor_not_normal'] > 0 && $data['monitor_checks'] > 0) { - $data['monitor_health'] = format_numeric((100 - ($data['monitor_not_normal'] / ($data['monitor_checks'] / 100))), 1); - } else { - $data['monitor_health'] = 100; - } - - if ($data['monitor_not_init'] > 0 && $data['monitor_checks'] > 0) { - $data['module_sanity'] = format_numeric((100 - ($data['monitor_not_init'] / ($data['monitor_checks'] / 100))), 1); - } else { - $data['module_sanity'] = 100; - } - - if (isset($data['alerts'])) { - if ($data['monitor_alerts_fired'] > 0 && $data['alerts'] > 0) { - $data['alert_level'] = format_numeric((100 - ($data['monitor_alerts_fired'] / ($data['alerts'] / 100))), 1); - } else { - $data['alert_level'] = 100; - } - } else { - $data['alert_level'] = 100; - $data['alerts'] = 0; - } - - $data['monitor_bad'] = ($data['monitor_critical'] + $data['monitor_warning']); - - if ($data['monitor_bad'] > 0 && $data['monitor_checks'] > 0) { - $data['global_health'] = format_numeric((100 - ($data['monitor_bad'] / ($data['monitor_checks'] / 100))), 1); - } else { - $data['global_health'] = 100; - } - - $data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1); -} - -ui_require_css_file('logon'); - -echo '
'; - -// -// Overview Table. -// -$table = new stdClass(); -$table->class = 'no-class'; -$table->cellpadding = 4; -$table->cellspacing = 4; -$table->head = []; -$table->data = []; -$table->headstyle[0] = 'text-align:center;'; -$table->width = '100%'; -$table->head_colspan[0] = 4; - -// Indicators. -$tdata = []; -$stats = reporting_get_stats_indicators($data, 120, 10, false); -$status = ''; -foreach ($stats as $stat) { - $status .= ''; -} - -$status .= '
'.$stat['title'].''.$stat['graph'].'
'; -$table->rowclass = []; -$table->rowclass[0] = 'w100p'; -$table->rowclass[1] = 'w100p'; -$table->rowclass[2] = 'w100p'; -$table->rowclass[3] = 'w100p'; -$table->rowclass[4] = 'w100p'; -$table->rowclass[5] = 'w100p'; -$table->data[0][0] = $status; - -$table->data[] = $tdata; - -// Alerts. -$tdata = []; -$tdata[0] = reporting_get_stats_alerts($data); -$table->rowclass[] = ''; -$table->data[] = $tdata; - -// Modules by status. -$tdata = []; - -$data_agents = [ - __('Critical') => $data['monitor_critical'], - __('Warning') => $data['monitor_warning'], - __('Normal') => $data['monitor_ok'], - __('Unknown') => $data['monitor_unknown'], - __('Not init') => $data['monitor_not_init'], -]; - -$tdata[0] = reporting_get_stats_modules_status($data, 180, 100, false, $data_agents); -$table->rowclass[] = ''; -$table->data[] = $tdata; - -// Total agents and modules. -$tdata = []; -$tdata[0] = reporting_get_stats_agents_monitors($data); -$table->rowclass[] = ''; -$table->data[] = $tdata; - -// Users. -if (users_is_admin() || check_acl($config['id_user'], 0, 'UM')) { - $tdata = []; - $tdata[0] = reporting_get_stats_users($data); - $table->rowclass[] = ''; - $table->data[] = $tdata; -} - -ui_toggle( - html_print_table($table, true), - __('%s Overview', get_product_name()), - '', - 'overview', - false -); -unset($table); - -echo '