差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:documentation:pandorafms:technical_annexes:15_security_architecture [2024/08/21 05:46] – [システムを最新の状態に保つ] junichi | ja:documentation:pandorafms:technical_annexes:15_security_architecture [2024/10/12 08:01] (現在) – [概要] junichi | ||
---|---|---|---|
行 9: | 行 9: | ||
===== 概要 ===== | ===== 概要 ===== | ||
- | The security elements of each component of **Pandora FMS** are described, according to regulations such as PCI/DSS, ISO 27001, ENS, LOPD and similar. | + | The security elements of each **Pandora FMS** component |
**Pandora FMS** の各コンポーネントのセキュリティ要素を、PCI/ | **Pandora FMS** の各コンポーネントのセキュリティ要素を、PCI/ | ||
行 405: | 行 405: | ||
==== アクセス監査 ==== | ==== アクセス監査 ==== | ||
- | It is necessary to have the security log ''/ | + | It is necessary to have the security log ''/ |
- | セキュリティログ ''/ | + | セキュリティログ ''/ |
- | By default | + | By default this is enabled, if it is not, check the file ''/ |
CentOS ではこれがデフォルトで有効になっています。そうでない場合は、''/ | CentOS ではこれがデフォルトで有効になっています。そうでない場合は、''/ | ||
- | We recommend | + | It is recommended |
監査システムのログを取得し、外部のログ管理システムで収集することをお勧めします。Pandora FMS はそれを簡単に行うことができ、必要に応じてアラートを発報したり、一元的に確認したりするのに役立ちます。 | 監査システムのログを取得し、外部のログ管理システムで収集することをお勧めします。Pandora FMS はそれを簡単に行うことができ、必要に応じてアラートを発報したり、一元的に確認したりするのに役立ちます。 | ||
+ | |||
+ | <wrap #ks4_5 /> | ||
==== SSH サーバの保護 ==== | ==== SSH サーバの保護 ==== | ||
- | The SSH server allows | + | The SSH server allows |
SSH サーバを使用すると、GNU/ | SSH サーバを使用すると、GNU/ | ||
- | * Modify default port (e.g. to 31122) | + | |
* デフォルトポートの変更 (例: 31122) | * デフォルトポートの変更 (例: 31122) | ||
< | < | ||
- | #Port22 | + | #Port 22 -> Port 31122 |
</ | </ | ||
- | * Disable **root login** | + | * Disable |
* スーパーユーザである **root ログイン** の無効化 | * スーパーユーザである **root ログイン** の無効化 | ||
行 459: | 行 461: | ||
</ | </ | ||
- | * Remove SSH keys for remote **root** | + | * Remove SSH keys for remote |
* リモート **root** アクセスのための SSH 鍵の削除。リモートアクセスに有効なユーザーは 1人だけであると想定します(例: | * リモート **root** アクセスのための SSH 鍵の削除。リモートアクセスに有効なユーザーは 1人だけであると想定します(例: | ||
行 471: | 行 473: | ||
</ | </ | ||
+ | |||
+ | <wrap #ks4_6 /> | ||
==== MySQL サーバの保護 ==== | ==== 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, |
- | 待ち受けポート。 | + | MySQL が内部のみにサービスを提供する場合は、**netstat** を使用して、localhost |
- | < | + | < |
netstat -an | grep 3306 | grep LIST | netstat -an | grep 3306 | grep LIST | ||
tcp 0 0 0.0.0.0: | tcp 0 0 0.0.0.0: | ||
行 484: | 行 488: | ||
</ | </ | ||
- | In this case it is listening | + | In the previous example you are listening |
この場合、どこからでも接続を受け付けます。制限するには、ファイル ''/ | この場合、どこからでも接続を受け付けます。制限するには、ファイル ''/ | ||
- | < | + | < |
bind-address = 127.0.0.1 | bind-address = 127.0.0.1 | ||
</ | </ | ||
- | And we will verify again that it is listening, but now only on localhost after restarting the service: | + | After restarting the service, check the listening port again. |
- | 待ち受けを再度確認します。サービスを再起動した後、ローカルホストでのみ待ち受けています。 | + | サービスの再起動後、待ち受けを再度確認します。 |
- | + | ||
- | < | + | |
- | netstat -an | grep 3306 | grep LIST | + | |
- | tcp 0 0 127.0.0.1: | + | |
- | + | ||
- | </ | + | |
**MySQL Password** | **MySQL Password** | ||
行 512: | 行 509: | ||
特権ユーザで MySQL コンソールに接続します。 | 特権ユーザで MySQL コンソールに接続します。 | ||
- | < | + | < |
- | + | mysql -h host -u root -p | |
- | mysql –h host –u root –p | + | |
</ | </ | ||
- | Verify that the password is secure | + | Verify that the password is complex |
パスワードが安全であり、パスワードの入力を求められていることを確認します。 そうでない場合は、次のコマンドで設定します。 | パスワードが安全であり、パスワードの入力を求められていることを確認します。 そうでない場合は、次のコマンドで設定します。 | ||
- | < | + | < |
mysqladmin password | mysqladmin password | ||
</ | </ | ||
- | This security measure is essential to protect | + | This security measure is essential to protect databases not only against external attacks but also against misuse by internal users. |
このセキュリティ対策は、外部からの攻撃だけでなく、内部ユーザによる誤用からもデータベースを保護するために不可欠です。 | このセキュリティ対策は、外部からの攻撃だけでなく、内部ユーザによる誤用からもデータベースを保護するために不可欠です。 | ||
+ | |||
+ | <wrap #ks4_7 /> | ||
==== Apache web サーバの保護 ==== | ==== Apache web サーバの保護 ==== | ||
行 538: | 行 536: | ||
</ | </ | ||
- | Add the above line to the file: | + | Add the above line to hide the web server version (Apache, Nginx) in the server information headers: |
- | 上記を以下のファイルに追加します。 | + | 上記の行を追加すると、サーバ情報ヘッダー内の Web サーバのバージョン (Apache、Nginx) が非表示になります。 |
* ''/ | * ''/ | ||
* ''/ | * ''/ | ||
- | to hide the web server version (Apache, Nginx) in the server information headers. | + | <wrap #ks4_8 /> |
- | サーバ情報ヘッダ内の Web サーバのバージョン | + | ==== PHP アプリケーションエンジン ==== |
- | ==== システムサービスの最小化 ==== | + | To secure the application engine on which Pandora FMS runs, it may be necessary, in some particularly security-sensitive environments, |
- | 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: | + | Pandora FMS が実行されるアプリケーションエンジンを保護するために、特にセキュリティが重要な環境では、セッション // |
- | この手法は非常に網羅的であり、システムに不要なものをすべて排除するだけです。 このようにして、実際には必要のない、誤って設定されたアプリケーションで将来発生する可能性のある問題を回避します。 この方法へのアプローチを単純化するために、マシン上にポートを開いて待ち受けているアプリケーションのみを対象とします。このために、次のコマンドを実行します。 | + | <WRAP center round important 90%> |
- | < | + | This will cause the application to not work when used over HTTP (without encryption). |
- | netstat -tulpn | + | |
- | </code> | + | </WRAP> |
- | It should return a result for each listening port, something similar to this, but not the same: | + | <WRAP center round important 90%> |
- | 次のように、リスニングポートごとに結果が返されます。ただし、環境によって異なります。 | + | これにより、HTTP (暗号化なし) 経由で使用した場合にアプリケーションが動作しなくなります。 |
- | <code> | + | </WRAP> |
- | Proto Recv-Q Send-Q Local Address | + | |
- | tcp 0 0 127.0.0.1: | + | |
- | tcp 0 0 0.0.0.0: | + | |
- | tcp 0 0 0.0.0.0: | + | |
- | tcp 0 0 127.0.0.1: | + | |
- | tcp 0 0 0.0.0.0: | + | |
- | tcp 0 0 0.0.0.0: | + | |
- | tcp6 | + | |
- | tcp6 | + | |
- | tcp6 | + | |
- | </ | + | To do this, the following configuration tokens must be included in the '' |
- | 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 を使用してシステムに変更を加えた後、再起動せずに残されたサービスでない限り、表示されないはずです。 | + | < |
+ | session.cookie_httponly = 1 | ||
+ | session.cookie_secure = 1 | ||
- | We should investigate each port and know the application behind it. In this case, 443, 80 seems to be from the '' | + | </ |
- | 各ポートを調査し、その背後にあるアプリケーションを知る必要があります。 この場合、443、80 は '' | + | <wrap #ks4_9 /> |
- | Those services that listen on **localhost** ('' | + | ==== システムサービスの最小化 ==== |
- | **localhost** ('' | + | This technique, which can be very thorough, consists of removing everything unnecessary on the system. This avoids possible problems in the future with misconfigured applications that are not really needed. To simplify the approach to this practice, consider only those applications that have an open port on the machine, for this run: '' |
- | For example, we see that the main **postfix** process is running. As we do not need this service, we uninstall it from the system: | + | この手法は非常に網羅的であり、システムに不要なものをすべて排除するだけです。 このようにして、実際には必要のない、誤って設定されたアプリケーションで将来発生する可能性のある問題を回避します。 この方法へのアプローチを単純化するために、マシン上にポートを開いて待ち受けているアプリケーションのみを対象とします。このために、'' |
- | たとえば、メインの | + | Each port should be investigated and the application behind it should be known. To do this you can use the **lsof** command, which must be installed with **dnf** or **apt**. |
- | < | + | 各ポートを調査し、その背後にあるアプリケーションを把握する必要があります。これを行うには、**dnf** または **apt** でインストールできる **lsof** コマンドを使用できます。 |
- | yum remove postfix | + | |
- | </ | + | Those services listening on **localhost** ('' |
- | By investigating the PID of each of the processes in doubt (see previous step) we will see the process that is on that port: | + | **localhost** |
- | 疑わしい各プロセスの PID を調査することにより(前述のステップを参照)、そのポートにあるプロセスを確認します。 | + | By means of the Pandora FMS process inventory system, it should be verified that no new processes are started over time. |
- | < | + | Pandora FMS プロセスインベントリシステムを使用して、時間の経過とともに新しいプロセスが開始されていないことを確認します。 |
- | ps aux | grep 7726 root 7726 0.1 8.5 3258724 248608 ? Sl Mar09 60:01 / | + | |
- | </code> | + | <wrap #ks5 /> |
- | And if we are not using that service, we can remove it. | + | ===== 追加設定 ===== |
- | また、そのサービスを使用していない場合は、削除できます。 | + | <wrap #ks5_1 /> |
- | + | ||
- | This process of " | + | |
- | + | ||
- | プロセスの " | + | |
- | + | ||
- | ===== 追加設定 ===== | + | |
==== NTP 時刻同期 ==== | ==== NTP 時刻同期 ==== | ||
- | It is recommended to configure | + | It is recommended to configure |
- | システムの時刻同期を設定することをお勧めします。 | + | RHEL システムの時刻同期を設定することをお勧めします。 |
- | < | + | < |
- | yum install ntpdate | + | dnf install ntpdate |
echo " | echo " | ||
chmod 755 / | chmod 755 / | ||
</ | </ | ||
+ | |||
+ | <wrap #ks6 /> | ||
===== ローカル監視 ===== | ===== ローカル監視 ===== | ||
- | The system should have a [[:en: | + | The system should have an [[en: |
- | システムには、[[: | + | システムには、[[: |
- | + | ||
- | {{ : | + | |
The following active checks are recommended in addition to the standard checks: | The following active checks are recommended in addition to the standard checks: | ||
行 643: | 行 624: | ||
標準チェックに加えて、次のアクティブチェックをお勧めします。 | 標準チェックに加えて、次のアクティブチェックをお勧めします。 | ||
- | * Active security | + | * Security |
* Complete system inventory (especially users and installed packages). | * Complete system inventory (especially users and installed packages). | ||
- | * Collection of system | + | * System log collection |
* セキュリティプラグイン | * セキュリティプラグイン | ||
行 652: | 行 633: | ||
< | < | ||
- | + | module_plugin grep_log_module / | |
- | module_plugin grep_log_module / | + | module_plugin grep_log_module / |
- | | + | |
</ | </ | ||
行 663: | 行 643: | ||
* Description. | * Description. | ||
- | * IP address (if you have several, | + | * IP address (if you have several, |
* Group. | * Group. | ||
* Department, responsible and physical location (custom fields). | * Department, responsible and physical location (custom fields). | ||
行 671: | 行 651: | ||
* グループ | * グループ | ||
* 部門、責任者および物理的な場所(カスタムフィールド) | * 部門、責任者および物理的な場所(カスタムフィールド) | ||
+ | |||
+ | <wrap #ks7 /> | ||
===== GNU/Linux におけるセキュリティ監視 ===== | ===== GNU/Linux におけるセキュリティ監視 ===== | ||
- | The [[https:// | + | The [[https:// |
[[https:// | [[https:// | ||
- | This plugin is intended to run **only** on modern GNU/ | + | This plugin is intended to run **only** on modern GNU/ |
- | このプラグインは、最新の GNU/ | + | このプラグインは、最新の GNU/ |
- | + | ||
- | 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, | + | |
- | + | ||
- | これには、32および 64bit 版の John the ripper 1.8 + Contrib パッチのカスタムビルドが含まれています。プラグインの主な概要は、モノリシックであり、強化ポイントを検出し、管理者に何も尋ねることなくディストリビューション間の違いを解決しようとすることです。そのため、バージョン、ディストリビューション、またはアーキテクチャに関係なく、どのシステムでも同じように展開することができます。 | + | |
This plugin will check: | This plugin will check: | ||
行 690: | 行 668: | ||
このプラグインは以下をチェックします。 | このプラグインは以下をチェックします。 | ||
- | * User password audit check, using the dictionary (provided) with the 500 most common passwords. This usually takes no more than a few seconds. If you have hundreds of users, you probably need to customize the plugin | + | * Auditing user passwords, using the dictionary (provided) with the 500 most common passwords. If you have hundreds of users, you will probably need to customize the //plugin// to run only every 2 to 6 hours. You can customize the password dictionary by adding your organization' |
- | * Check that SSH does not run on the default port. | + | * SSH does not run on the default port. |
- | * Check that FTP does not run on the default port. | + | * SSH does not allow **root** access. |
- | * Check that SSH does not allow **root** | + | * That FTP does not run on the default port. |
- | * Check if there is a MySQL running without the **root** | + | * Check if there is a MySQL server |
- | * Other checks. | + | * Other checkups. |
* 最も一般的な 500個のパスワードを含む辞書(あらかじめ提供)を使用したユーザパスワードの監査チェック。 通常、これには数秒しかかかりません。 数百人のユーザがいる場合は、プラグインの実行を 2〜6時間ごとにのみ実行するようにカスタマイズする必要があります。 組織の一般的なパスワードを " | * 最も一般的な 500個のパスワードを含む辞書(あらかじめ提供)を使用したユーザパスワードの監査チェック。 通常、これには数秒しかかかりません。 数百人のユーザがいる場合は、プラグインの実行を 2〜6時間ごとにのみ実行するようにカスタマイズする必要があります。 組織の一般的なパスワードを " | ||
* SSH がデフォルトのポートで実行されていないことの確認。 | * SSH がデフォルトのポートで実行されていないことの確認。 | ||
- | * FTB がデフォルトのポートで実行されていないことの確認。 | ||
* SSH が **root** アクセスを許可していないことの確認。 | * SSH が **root** アクセスを許可していないことの確認。 | ||
+ | * FTP がデフォルトのポートで実行されていないことの確認。 | ||
* MySQL が **root** パスワード無しで実行されているかどうかの確認。 | * MySQL が **root** パスワード無しで実行されているかどうかの確認。 | ||
* その他チェック。 | * その他チェック。 | ||
[[ja: | [[ja: | ||
+ |