diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index 8eec7eee9c..f06b52567a 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -88,7 +88,7 @@ check_root_permissions () { } ## Main -echo 'Starting PandoraFMS Community deployment $S_VERSION' +echo "Starting PandoraFMS Community deployment ver. $S_VERSION" # Centos Version if [ ! "$(grep -i centos /etc/redhat-release)" ]; then @@ -103,7 +103,8 @@ echo -en "${cyan}Check Centos Version...${reset}" check_cmd_status 'Error OS version, Centos 7 is expected' # initialice logfile -execute_cmd "echo 'Starting community deployment #S_VERSION' > $LOGFILE" "All installer activity is logged on $LOGFILE" +execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE" +echo "Community installer version: $S_VERSION" >> $LOGFILE # Pre checks # Root permisions @@ -268,23 +269,9 @@ execute_cmd "yum install -y $vmware_dependencies" "Installing Oracle Instant cli # Disabling SELINUX and firewalld setenforce 0 -sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/sysconfig/selinux +sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config systemctl disable firewalld --now &>> $LOGFILE -cat > /etc/issue.net << EOF_banner - -Welcome to Pandora FMS appliance on CentOS ------------------------------------------- -$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to http://"$1"/pandora_console to manage this server"}') - -You can find more information at http://pandorafms.com - -EOF_banner - -rm -f /etc/issue -ln -s /etc/issue.net /etc/issue - -execute_cmd "echo 'Banner /etc/issue.net' >> /etc/ssh/sshd_config" "Adding SSH banner" #Configuring Database execute_cmd "systemctl start mysqld" "Starting database engine" @@ -567,13 +554,32 @@ echo "* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandor systemctl enable pandora_agent_daemon &>> $LOGFILE execute_cmd "systemctl start pandora_agent_daemon" "starting Pandora FMS Agent" +#SSH banner +[ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) + +cat > /etc/issue.net << EOF_banner + +Welcome to Pandora FMS appliance on CentOS +------------------------------------------ +Go to Public http://$ipplublic/pandora_console$to to login web console +$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}') + +You can find more information at http://pandorafms.com + +EOF_banner + +rm -f /etc/issue +ln -s /etc/issue.net /etc/issue + +echo 'Banner /etc/issue.net' >> /etc/ssh/sshd_config + +# Remove temporary files execute_cmd "echo done" "Pandora FMS Community installed" cd execute_cmd "rm -rf $HOME/pandora_deploy_tmp" "Removing temporary files" +# Print nice finish message GREEN='\033[01;32m' NONE='\033[0m' - -[ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) printf " -> Go to Public ${green}http://"$ipplublic"/pandora_console${reset} to manage this server" ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v -e "172.1[0-9].0.1" | awk '{print $2}' | awk -v g=$GREEN -v n=$NONE -F '/' '{printf "\n -> Go to Local "g"http://"$1"/pandora_console"n" to manage this server \n -> Use this credentials to login in the console "g"[ User: admin / Password: pandora ]"n" \n"}' \ No newline at end of file diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4184fa468b..2b9b27c895 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.752-210128 +Version: 7.0NG.752-210201 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 e0a33a305b..dcedaad18f 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.752-210128" +pandora_version="7.0NG.752-210201" 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 0b11f9a048..13769807ec 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1016,7 +1016,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.752'; -use constant AGENT_BUILD => '210128'; +use constant AGENT_BUILD => '210201'; # 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 68c3eb64b9..ee40f6b009 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.752 -%define release 210128 +%define release 210201 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 6c68ea6850..a145a90f75 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.752 -%define release 210128 +%define release 210201 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 09b1c04fa4..eff88cee08 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.752" -PI_BUILD="210128" +PI_BUILD="210201" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index d342954307..1ad6e20642 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210128} +{210201} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b66e7ca954..3eda05b2a0 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.752(Build 210128)") +#define PANDORA_VERSION ("7.0NG.752(Build 210201)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e1fdffe78f..ebac6998e3 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.752(Build 210128))" + VALUE "ProductVersion", "(7.0NG.752(Build 210201))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 18e827f7fc..703ee24ae5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.752-210128 +Version: 7.0NG.752-210201 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 4cd781a928..0db3318bd5 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.752-210128" +pandora_version="7.0NG.752-210201" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index dc2ae5fbbe..27d69eb2da 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210128'; +$build_version = 'PC210201'; $pandora_version = 'v7.0NG.752'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 1afd3f8431..d30da4cc4c 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -13090,7 +13090,8 @@ function api_get_special_days($thrash1, $thrash2, $other, $thrash3) $separator = $other['data'][0]; } - $filter = false; + $user_groups = implode(',', array_keys(users_get_groups($config['id_user'], 'LM'))); + $filter = "id_group IN ($user_groups)"; $special_days = @db_get_all_rows_filter('talert_special_days', $filter); @@ -13127,17 +13128,17 @@ function api_set_create_special_day($thrash1, $thrash2, $other, $thrash3) return; } - if (!check_acl($config['id_user'], 0, 'LM')) { - returnError('forbidden', 'string'); - return; - } - $special_day = $other['data'][0]; $same_day = $other['data'][1]; $description = $other['data'][2]; $idGroup = $other['data'][3]; - $check_id_special_day = db_get_value('id', 'talert_special_days', 'date', $special_day); + if (!check_acl($config['id_user'], $idGroup, 'LM', true)) { + returnError('forbidden', 'string'); + return; + } + + $check_id_special_day = db_get_value_filter('id', 'talert_special_days', ['date' => $special_day, 'id_group' => $idGroup]); if ($check_id_special_day) { returnError('error_create_special_day', __('Error creating special day. Specified day already exists.')); @@ -13155,7 +13156,7 @@ function api_set_create_special_day($thrash1, $thrash2, $other, $thrash3) } else { $group = groups_get_group_by_id($idGroup); - if ($group == false) { + if ($idGroup != 0 && $group == false) { returnError('error_create_special_day', __('Error creating special day. Id_group doesn\'t exist.')); return; } @@ -13641,16 +13642,16 @@ function api_set_update_special_day($id_special_day, $thrash2, $other, $thrash3) return; } - if (!check_acl($config['id_user'], 0, 'LM')) { - returnError('forbidden', 'string'); - return; - } - $special_day = $other['data'][0]; $same_day = $other['data'][1]; $description = $other['data'][2]; $idGroup = $other['data'][3]; + if (!check_acl($config['id_user'], $idGroup, 'LM', true)) { + returnError('forbidden', 'string'); + return; + } + if ($id_special_day == '') { returnError('error_update_special_day', __('Error updating special day. Id cannot be left blank.')); return; @@ -13663,6 +13664,13 @@ function api_set_update_special_day($id_special_day, $thrash2, $other, $thrash3) return; } + $id_group_org = db_get_value('id_group', 'talert_special_days', 'id', $id_special_day); + + if (!check_acl($config['id_user'], $id_group_org, 'LM', true)) { + returnError('forbidden', 'string'); + return; + } + if (!preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $special_day)) { returnError('error_update_special_day', __('Error updating special day. Invalid date format.')); return; @@ -13725,6 +13733,12 @@ function api_set_delete_special_day($id_special_day, $thrash2, $thrash3, $thrash return; } + $id_group = db_get_value('id_group', 'talert_special_days', 'id', $id_special_day); + if (!check_acl($config['id_user'], $id_group, 'LM', true)) { + returnError('forbidden', 'string'); + return; + } + $return = alerts_delete_alert_special_day($id_special_day); if (is_error($return)) { diff --git a/pandora_console/install.php b/pandora_console/install.php index 884f217623..23957cc7e3 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
= count($rangeSeed)) ? $size : count($rangeSeed); + + $auxIndex = 0; + for ($i = 0; $i < $size; $i++) { + $tmpSeedValues = explode(':', $rangeSeed[$auxIndex]); + $output = $output.chr(rand($tmpSeedValues[1], $tmpSeedValues[0])); + $auxIndex++; + if ($auxIndex >= 4) { + $auxIndex = 0; + } } - return $temp; + // Remix the string for strong the password. + return str_shuffle($output); } diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 60861cc7af..6d470df5c0 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.752 -%define release 210128 +%define release 210201 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index e35da6f377..b03833eefe 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.752 -%define release 210128 +%define release 210201 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index f07efc5463..80d7eb9280 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.752 -%define release 210128 +%define release 210201 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 578f414296..b3596ac35e 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.752-210128 +Version: 7.0NG.752-210201 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 657cba32c0..76f9d96557 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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.752-210128" +pandora_version="7.0NG.752-210201" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 8abefbce62..d8a3d90612 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -45,7 +45,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.752"; -my $pandora_build = "210128"; +my $pandora_build = "210201"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 6afb74d4ab..a4f7c74d87 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.752"; -my $pandora_build = "210128"; +my $pandora_build = "210201"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index f30b1e1cee..7d7c3fbfd9 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -2462,7 +2462,7 @@ sub p_decode_json { if ($JSON::VERSION > 2.90) { # Initialize JSON manager. - my $json = JSON->new->allow_nonref; + my $json = JSON->new->utf8->allow_nonref; $decoded_data = $json->decode($data); } else { $decoded_data = decode_json($data); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 7ff4a34cdc..6314014156 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.752 -%define release 210128 +%define release 210201 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index bf2c4883f4..292830bed5 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.752 -%define release 210128 +%define release 210201 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 01556b69eb..4a5f7a40ae 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.752" -PI_BUILD="210128" +PI_BUILD="210201" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index d3d7387d7e..17b2e1a94a 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.752 PS210128"; +my $version = "7.0NG.752 PS210201"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ff37a3d13d..235d1efb53 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.752 PS210128"; +my $version = "7.0NG.752 PS210201"; # save program name for logging my $progname = basename($0);