目次

セキュリティアーキテクチャ

Pandora FMS ドキュメント一覧に戻る

セキュリティアーキテクチャ

このドキュメントの目的は、各 Pandora FMS コンポーネントのセキュリティ要素を説明し、管理者がそれらを理解し、PCI / DSS、ISO 27001、ENS、LOPD などの規制に従って、より安全なアーキテクチャを実装し使用する方法を知ることです。 さらに、ここでは、Pandora FMS で利用可能なツールや他の取りうるメカニズムを使用して、起こりうるリスクおよびそれらを最小化する方法の説明を提供します。

セキュリティの実装 (一般)

これらのポイントは、PCI / DSS、ISO 27001、National Security Scheme、LOPD などの国際標準に適用されます。これらは、それぞれの環境における安全な Pandora FMS 実装のガイドとして利用できます。

コンポーネントごとのセキュリティ

Pandora FMS アーキテクチャは、非常に簡略化すると、次のように要約できます。

サーバ

考えられる脆弱性と保護手段

#NFS を使用して、外部構成ファイル用の外部保護コンテナを実装します。

Tentacle

考えられる脆弱性と保護手段

コンソール

考えられる脆弱性と保護手段

エージェント

考えられる脆弱性と保護手段

データベース

考えられる脆弱性と保護手段

ベースシステムの強化

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.

システムの強化や保証は、企業のグローバルセキュリティ戦略の重要なポイントです。 メーカーとして、標準の RHEL7 プラットフォームまたは同等の Centos7 に基づいて、すべての Pandora FMS コンポーネントの安全なインストールを実行するための一連の推奨事項を示します。これらの推奨事項は、GNU/Linux に基づく他の監視システムでも当てはまります。

アクセス認証

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.

システムにアクセスするためには、特権のない必要に応じてアクセスを制限した目的に応じたユーザを作成します。 理想的には、各ユーザの認証は、トークンに基づく二段階認証システムと統合します。このガイドの範囲外ですが、GNU/Linux に統合可能な Google 認証システム® などの無料で安全な代替手段があります。 それらの使用を真剣に検討してください。

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).

アプリケーション用に何らかのユーザを作成する必要がある場合は、リモートアクセス権限のないユーザにする必要があります(そのためには、シェルまたは同等の利用を無効にします)。

スーパーユーザアクセス

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

特定のユーザーが管理者権限を持つ必要がある場合は、sudo コマンドを使用します。

システムを最新の状態に保つ

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

ネットワークに接続するか、プロキシサーバを使用するように yum システムを設定するだけです。

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.

このコマンドは、ライブラリー、設定などの変更で潜在的な問題を引き起こす可能性がありますが、特にシステムを本番環境として利用する場合は、システムのアップグレードを省略しないことが重要です。すでに利用中の本番システムの場合は、これらの重要なコンポーネント、つまり脆弱性のあるコンポーネントのみをアップグレードする必要がある場合があります。たとえば、mysql サーバ のみをアップグレードする場合は、アップグレードしたいパッケージ名を指定してコマンドを使用します。

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.

システムのアップグレードは、定期的に実行する必要がある対応です。 システムパッケージインベントリを使用して、脆弱なバージョンをチェックし、緊急アップグレードを実行します。

アクセス監査

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).

セキュリティログ /var/log/secure を有効化し、それらのログを監視する必要があります(これについては後で説明します)。

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

CentOS ではこれがデフォルトで有効になっています。そうでない場合は、/etc/rsyslog.conf または /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.

監査システムのログを取得し、外部のログ管理システムで収集することをお勧めします。Pandora FMS はそれを簡単に行うことができ、必要に応じてアラートを発報したり、一元的に確認したりするのに役立ちます。

SSH サーバの保護

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).

SSH サーバを使用すると、GNU/Linux システムにリモート接続してコマンドを実行できるため、これは重要なポイントであり、次の点に注意して保護する必要があります(そのためには、ファイル /etc/ssh/sshd_config を編集し、サービスを再起動します)。

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

MySQL サーバの保護

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:

待ち受けポート。 MySQL サーバが外部にサービスを提供する必要がある場合は、root の認証情報が安全であることを確認するだけです。 MySQL が内部にのみサービス提供する場合は、ローカルホストでのみ待ち受けるようにします。

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:

この場合、どこからでも接続を受け付けます。制限するには、ファイル /etc/my.cnf を編集し、セクション [mysqld] に次の行を追加します。

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

MySQL パスワード

Connect to the MySQL console with a privileged user:

特権ユーザで MySQL コンソールに接続します。

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.

このセキュリティ対策は、外部からの攻撃だけでなく、内部ユーザによる誤用からもデータベースを保護するために不可欠です。

Apache web サーバの保護

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.

/etc/httpd/conf/httpd.conf ファイルに次の行を追加して、サーバ情報ヘッダの Apache と OS バージョンを非表示にします。

ServerTokens Prod

システムサービスの最小化

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.

IPv6 を無効にした場合、tcp6 の行は、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.

各ポートを調査し、その背後にあるアプリケーションを知る必要があります。 この場合、443、80 は http サービスからのもののようですが、どのシステムプロセスが各ポートを使用しているかを確実に分析します。 これを行うには、lsof コマンドを使用します。これは、デフォルトではインストールされないため、yum とともにインストールする必要があります。

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).

localhost ( 127.0.0.1) でリッスンするサービスは、すべての IP アドレス (0.0.0.0) および一部のサービス(オープンでリッスンしている場合)をリッスンするサービスよりも安全です。 、ローカルホストのみをリッスンするようにセキュリティで保護する必要があります。 この画面例では、たとえば 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:

たとえば、メインの postfix プロセスが実行されていることがわかります。 このサービスは必要ないため、システムからアンインストールします。

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:

疑わしい各プロセスの PID を調査することにより(前述のステップを参照)、そのポートにあるプロセスを確認します。

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.

プロセスの “調査” のためのこの処理は、時間をかけて徹底的かつ反復的に行う必要があります。Pandora FMS プロセスインベントリシステムを使用して、時間の経過とともに新しいプロセスが開始されていないことを確認する必要があります。 サーバの待ち受けポートは、セキュリティの観点から非常に重要なものであり、建物の正面にある窓のようなものです。 私たちはそれが閉じていて安全であると信じているかもしれませんが、窓は常に権限のある人や、やる気のある侵入者の入り口となります。

追加設定

NTP 時刻同期

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

ローカル監視

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.

システムには、Pandora FMS ソフトウエアエージェントをインストールして起動します。MS Windows® オペレーティングシステムの場合、バージョン 761 以降、インストール実行ファイルは署名されています。

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:

ソフトウェアエージェントをインストールしたら、少なくとも次の情報をエージェントタブで手動で定義する必要があります。

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.

このプラグインは、最新の GNU/Linux コンピュータでのみ実行することを目的としています。 64ビットと 32ビットで実行できるように準備されています。

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.

これには、32および 64bit 版の John the ripper 1.8 + Contrib パッチのカスタムビルドが含まれています。プラグインの主な概要は、モノリシックであり、強化ポイントを検出し、管理者に何も尋ねることなくディストリビューション間の違いを解決しようとすることです。そのため、バージョン、ディストリビューション、またはアーキテクチャに関係なく、どのシステムでも同じように展開することができます。

This plugin will check:

このプラグインは以下をチェックします。

Pandora FMS ドキュメント一覧に戻る