ja:documentation:07_technical_annexes:15_security_architecture

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
最新のリビジョン両方とも次のリビジョン
ja:documentation:07_technical_annexes:15_security_architecture [2022/05/27 13:27] – [アクセス監査] junichija:documentation:07_technical_annexes:15_security_architecture [2022/08/06 23:08] – [コンソール] junichi
行 111: 行 111:
   * HTTP アクセスログを介してすべての要求を記録します。   * HTTP アクセスログを介してすべての要求を記録します。
  
-  * 資格情報で保護された HTTP / HTTPS 経由の公開 API を提供します。+  * It offers a public API via HTTP / HTTPS, [[:en:documentation:08_technical_reference:02_annex_externalapi#security|secured]] with credentials and allowed IP address list. 
 + 
 +  * 資格情報で[[:ja:documentation:08_technical_reference:02_annex_externalapi#セキュリティ|保護]]された HTTP / HTTPS 経由の公開 API と許可された IP アドレスリストを提供します。
  
   * 各システムオブジェクトの各ユーザの操作を記録するアプリケーション固有の監査があります。   * 各システムオブジェクトの各ユーザの操作を記録するアプリケーション固有の監査があります。
行 314: 行 316:
 </code> </code>
  
 +==== 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 が内部にのみサービス提供する場合は、ローカルホストでのみ待ち受けるようにします。
 +
 +<code>
 +netstat -an | grep 3306 | grep LIST
 +tcp        0      0 0.0.0.0:3306            0.0.0.0:              LISTEN
 +
 +</code>
 +
 +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]'' に次の行を追加します。
 +
 +<code>
 +
 +bind-address = 127.0.0.1
 +
 +</code>
 +
 +And we will verify again that it is listening, but now only on localhost after restarting the service:
 +
 +待ち受けを再度確認します。サービスを再起動した後、ローカルホストでのみ待ち受けています。
 +
 +<code>
 +netstat -an | grep 3306 | grep LIST
 +tcp        0      0 127.0.0.1:3306          0.0.0.0:              LISTEN
 +
 +</code>
 +
 +**MySQL Password**
 +
 +**MySQL パスワード**
 +
 +Connect to the MySQL console with a privileged user:
 +
 +特権ユーザで MySQL コンソールに接続します。
 +
 +<code>
 +
 +mysql –h host –u root –p
 +
 +</code>
 +
 +Verify that the password is secure and that we have been asked for a password. If not, set it with the command:
 +
 +パスワードが安全であり、パスワードの入力を求められていることを確認します。 そうでない場合は、次のコマンドで設定します。
 +
 +<code>
 +mysqladmin password
 +
 +</code>
 +
 +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 バージョンを非表示にします。
 +
 +<code>
 +ServerTokens Prod
 +
 +</code>
 +
 +==== システムサービスの最小化 ====
 +
 +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:
 +
 +この手法は非常に網羅的であり、システムに不要なものをすべて排除するだけです。 このようにして、実際には必要のない、誤って設定されたアプリケーションで将来発生する可能性のある問題を回避します。 この方法へのアプローチを単純化するために、マシン上にポートを開いて待ち受けているアプリケーションのみを対象とします。このために、次のコマンドを実行します。
 +
 +<code>
 +netstat -tulpn
 +
 +</code>
 +
 +It should return a result for each listening port, something similar to this, but not the same:
 +
 +次のように、リスニングポートごとに結果が返されます。ただし、環境によって異なります。
 +
 +<code>
 +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 :::4444                 :::                   LISTEN      7726/java
 +tcp6            0 :::34599                :::*                    LISTEN      7726/java
 +tcp6            0 :::6099                 :::                   LISTEN      7721/Xvfb
 +
 +</code>
 +
 +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** プロセスが実行されていることがわかります。 このサービスは必要ないため、システムからアンインストールします。
 +
 +<code>
 +yum remove postfix
 +
 +</code>
 +
 +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 を調査することにより(前述のステップを参照)、そのポートにあるプロセスを確認します。
 +
 +<code>
 +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
 +
 +</code>
 +
 +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:
 +
 +システムの時刻同期を設定することをお勧めします。
 +
 +<code>
 +yum install ntpdate
 +echo "ntpdate 0.us.pool.ntp.org"> /etc/cron.daily/ntp
 +chmod 755 /etc/cron.daily/ntp
 +
 +</code>
 +
 +===== ローカル監視 =====
 +
 +The system should have a [[:en:documentation:02_installation:01_installing#pandora_fms_agent_installation|Pandora FMS Software Agent]] installed and launched against our server. For MS Windows® operating system, from version 761 onwards, the installation executables are signed.
 +
 +システムには、[[:ja:documentation:02_installation:01_installing#pandora_fms_agent_installation|Pandora FMS ソフトウエアエージェント]]をインストールして起動します。MS Windows® オペレーティングシステムの場合、バージョン 761 以降、インストール実行ファイルは署名されています。
 +
 +{{  :wiki:pfms-software_agent-ms_windows.png  }}
 +
 +The following active checks are recommended in addition to the standard checks:
 +
 +標準チェックに加えて、次のアクティブチェックをお勧めします。
 +
 +  * Active security plugin.
 +  * Complete system inventory (especially users and installed packages).
 +  * Collection of system and security logs:
 +
 +  * セキュリティプラグイン
 +  * 完全なシステムインベントリ(特にユーザーとインストール済みパッケージ)。
 +  * システムおよびセキュリティログの収集
 +
 +<code>
 +
 + module_plugin grep_log_module /var/log/messages Syslog \.\*
 + module_plugin grep_log_module /var/log/secure Secure \.\*
 +
 +</code>
 +
 +Once the Software Agent is installed, at least the following information must be manually defined in the agent tab:
 +
 +ソフトウェアエージェントをインストールしたら、少なくとも次の情報をエージェントタブで手動で定義する必要があります。
 +
 +  * Description.
 +  * IP address (if you have several, put all of them).
 +  * Group.
 +  * Department, responsible and physical location (custom fields).
 +
 +  * 説明
 +  * IP アドレス(複数ある場合は全て設定します)
 +  * グループ
 +  * 部門、責任者および物理的な場所(カスタムフィールド)
 +
 +===== GNU/Linux におけるセキュリティ監視 =====
 +
 +The [[https://pandorafms.com/library/linux-security-plugin|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.
 +
 +[[https://pandorafms.com/library/linux-security-plugin|公式プラグイン]]を使用すると、実行のたびに、ほぼリアルタイムでエージェントのセキュリティをプロアクティブに監視でき、関連するイベントの警告を発することができます。
 +
 +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:
 +
 +このプラグインは以下をチェックします。
 +
 +  * 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 run to run only every 2-6 hours. You can customize the password dictionary by simply adding your organization's typical password to the "basic_security/password-list" file.
 +  * Check that SSH does not run on the default port.
 +  * Check that FTP does not run on the default port.
 +  * Check that SSH does not allow **root**  access.
 +  * Check if there is a MySQL running without the **root**  password defined.
 +  * Other checks.
 +
 +  * 最も一般的な 500個のパスワードを含む辞書(あらかじめ提供)を使用したユーザパスワードの監査チェック。 通常、これには数秒しかかかりません。 数百人のユーザがいる場合は、プラグインの実行を 2〜6時間ごとにのみ実行するようにカスタマイズする必要があります。 組織の一般的なパスワードを "basic_security/password-list" ファイルに追加するだけで、パスワード辞書をカスタマイズできます。
 +  * SSH がデフォルトのポートで実行されていないことの確認。
 +  * FTB がデフォルトのポートで実行されていないことの確認。
 +  * SSH が **root** アクセスを許可していないことの確認。
 +  * MySQL が **root** パスワード無しで実行されているかどうかの確認。
 +  * その他チェック。
  
 +[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]