Table of Contents

Security Architecture

Security Architecture

The purpose of this document is to describe the security elements of each Pandora FMS component, so that the administrator knows them and knows how to use them to implement a more secure architecture, in accordance with regulations such as PCI / DSS, ISO 27001, ENS, LOPD or similar. In addition, this file provides a specific description of the security mechanisms of each Pandora FMS element, possible risks as well as the way to minimize them, using the tools available in Pandora FMS or other possible mechanisms.

Declaration of conformity with the National Security Scheme, Basic Category, RD 3/2010.

Security implementation (general)

These points apply to international standards such as PCI / DSS, ISO 27001, National Security Scheme, LOPD, etc. They work as a guide for a safe Pandora FMS implementation in your environment.

Security by architecture components

Pandora FMS architecture, in a very simple way, can be summarized as follows:

Server

Possible vulnerabilities and safeguards

  1. Disable remote configuration on highly sensitive agents after configuration and leave them running without being able to carry out any changes remotely, for total security.
  2. Remote monitoring - without agents - of the most delicate devices.
  1. Password protection system (which works by group).
  2. Limiting agent self-creation, and creating them instead manually.
  3. Limiting the ability to auto detect changes in the agent and not take new information from the XML, apart from the existing one.

Tentacle

Possible vulnerabilities and safeguards

  1. It is protected in the same way as the server, by means of a secured external NFS system.
  1. Set up an HA solution on the TCP service it offers for balancing, or an active / active cluster. Any hardware or software solution available is valid because it is a standard TCP service.

Console

Possible vulnerabilities and safeguards

Agents

Possible vulnerabilities and safeguards

Database

Possible vulnerabilities and safeguards

Base system hardening

The hardening or system assurance is a key point in the global security strategy of a company. As manufacturers we issue a series of recommendations to perform a secure installation of all Pandora FMS components, based on a standard RHEL7 platform or its equivalent Centos7. These same recommendations are valid for any other monitoring system based on GNU/Linux.

Access credentials

To access the system, nominative access users will be created, without privileges and with access restricted to the needs they have. Ideally, the authentication of each user should be integrated with a double authentication system, based on tokens. There are free and secure alternatives such as Google Authenticator® integrable on GNU/Linux, although outside the scope of this guide. Seriously consider using them.

If it is necessary to create other users for applications, they should be users without remote access (to do so, disable their shell or equivalent method).

Superuser access

In case certain users need to have administrator permissions, the sudo command is used.

Keep your system up to date

You only need to be connected to the network or configure your yum system to use a proxy server.

This command can cause potential problems with changing libraries, configurations, etc. It is important not to skip the system upgrade, especially when you are putting the system into production. If you are checking an already active production system, you may need to upgrade only those critical components, i.e. those with a vulnerability, for example if you would like to upgrade only mysql server, use the command with the package name you want to upgrade.

yum update mysql-server

Upgrading the system is a process that should be done periodically. Using the system package inventory, you can check for vulnerable versions and run emergency upgrades.

Access audit

It is necessary to have the security log /var/log/secure active and to monitor those logs with the monitoring (which we will see later).

By default CentOS comes with this enabled. If not, check the /etc/rsyslog.conf or /etc/syslog.conf .

We recommend that you take the logs of the audit system and collect them with an external log management system, Pandora FMS can do it easily and it will be useful to establish alerts or review them in a centralized way in case of need.

Securing the SSH server

The SSH server allows us to connect remotely to our GNU/Linux systems to execute commands, so it is a critical point and must be secured by paying attention to the following points (to do so, edit the file /etc/ssh/sshd_config and then restart the service).

#Port22     ->     Port 31122
#PermitRootLogin yes        ->    PermitRootLogin no
#AllowTcpForwarding yes        ->    AllowTcpForwarding no
#PermitTunnel no        ->    PermitTunnel no
Banner /etc/issue.net

Securing the MySQL server

Listening port. If the MySQL server has to service the outside, we simply check that the root credentials are secure. If MySQL only services an internal element, we make sure that it only listens on localhost:

netstat -an | grep 3306 | grep LIST
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN

In this case it is listening for everyone, we must ensure it. To do this, we will edit the file /etc/my.cnf and in the section [mysqld] we will add the following line:

bind-address = 127.0.0.1

And we will verify again that it is listening, but now only on localhost after restarting the service:

netstat -an | grep 3306 | grep LIST
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN

MySQL Password

Connect to the MySQL console with a privileged user:

mysql –h host –u root –p

Verify that the password is secure and that we have been asked for a password. If not, set it with the command:

mysqladmin password

This security measure is essential to protect our databases not only against external attacks but also against misuse by internal users.

Securing the Apache web server

We will add the following line to the /etc/httpd/conf/httpd.conf file to hide the apache and OS version in the server information headers.

ServerTokens Prod

PHP Application Engine

In order to secure the application engine on which Pandora FMS works, it could be necessary, in some environments especially sensitive in terms of security, to secure the access to the application so that the session cookies are only transmitted with SSL.

To do this, in the php.ini file include the following tokens configuration:

session.cookie_httponly = 1
session.cookie_secure = 1

This will cause the application to not work when used over HTTP (without encryption).

Minimization of system services

This technique, which can be very exhaustive, simply consists of eliminating everything that is not necessary in the system. This way we avoid possible problems in the future with misconfigured applications that we do not really need. To simplify the approach to this practice, we will consider only those applications that have an open port on the machine, for this, we will run the following command:

netstat -tulpn

It should return a result for each listening port, something similar to this, but not the same:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      996/master
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      75171/httpd
tcp        0      0 0.0.0.0:31122           0.0.0.0:*               LISTEN      872/sshd
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      75097/mysqld
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      75171/httpd
tcp        0      0 0.0.0.0:6099            0.0.0.0:*               LISTEN      7721/Xvfb
tcp6       0      0 :::4444                 :::*                    LISTEN      7726/java
tcp6       0      0 :::34599                :::*                    LISTEN      7726/java
tcp6       0      0 :::6099                 :::*                    LISTEN      7721/Xvfb

If we have disabled IPv6 we should not see tcp6 lines unless they are services that were started in ipv6 mode and have been left without restarting after making a change in the system with sysctl.

We should investigate each port and know the application behind it. In this case, 443, 80 seems to be from the http service, but to be sure we will analyze which system processes are using each port. To do this we will use the lsof command, which will have to be installed with yum because it is not installed by default.

Those services that listen on localhost (127.0.0.1) are more secure than those that listen to all IP addresses (0.0.0.0) and some of them, if they are listening in open, we should try to secure them to listen only to localhost. In this example screen it has been done for example for MySQL (3306).

For example, we see that the main postfix process is running. As we do not need this service, we uninstall it from the system:

yum remove postfix

By investigating the PID of each of the processes in doubt (see previous step) we will see the process that is on that port:

ps aux | grep 7726 root 7726 0.1 8.5 3258724 248608 ? Sl Mar09 60:01 /usr/bin/java -jar /usr/lib/pwr/selenium-server-standalone-2.53.1.jar -host 185.247.117.28 -port 4444 -firefoxProfileTemplate /opt/firefox_profile root 79041 0.0 0.0 112716 960 pts/4 S+ 11:54 0:00 grep --color=auto 7726

And if we are not using that service, we can remove it.

This process of “investigation” of processes must be exhaustive and repetitive over time. By means of the Pandora FMS process inventory system, we should verify that no new processes are started along the time. A listening port in a server is something very significant from the security point of view, it would be like a window in the front of the building. We may believe that it is closed and secure, but a window will always be a possible entry point for a qualified and motivated intruder.

Additional configuration

NTP time synchronization

It is recommended to configure the time synchronization of the system:

yum install ntpdate
echo "ntpdate 0.us.pool.ntp.org"> /etc/cron.daily/ntp
chmod 755 /etc/cron.daily/ntp

Local Monitoring

The system should have a Pandora FMS Software Agent installed and launched against our server. For MS Windows® operating system, from version 761 onwards, the installation executables are signed.

The following active checks are recommended in addition to the standard checks:

 module_plugin grep_log_module /var/log/messages Syslog \.\*
 module_plugin grep_log_module /var/log/secure Secure \.\*

Once the Software Agent is installed, at least the following information must be manually defined in the agent tab:

Security monitoring in GNU/Linux

The official plugin allows to proactively monitor the security in the agent, in each execution, almost in real time, offering some checks that can alert us of some relevant events in a proactive way.

This plugin is intended to run only on modern GNU/Linux computers. It is prepared to run on 64 and 32 bits.

It contains a custom build of John the ripper 1.8 + Contrib patches with 32 and 64 static binaries. The main concept of the plugin is to be monolithic, detect what can be hardened and try to resolve differences between distros without asking anything to the administrator, so the deployment could be the same for any system, ignoring versions, distro or architecture.

This plugin will check:

Go back to Pandora FMS documentation index