差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
ja:documentation:07_technical_annexes:15_security_architecture [2022/05/27 13:27] – [アクセス監査] junichi | ja:documentation:07_technical_annexes:15_security_architecture [2022/08/06 23:08] – [コンソール] junichi | ||
---|---|---|---|
行 111: | 行 111: | ||
* HTTP アクセスログを介してすべての要求を記録します。 | * HTTP アクセスログを介してすべての要求を記録します。 | ||
- | * 資格情報で保護された HTTP / HTTPS 経由の公開 API を提供します。 | + | |
+ | |||
+ | | ||
* 各システムオブジェクトの各ユーザの操作を記録するアプリケーション固有の監査があります。 | * 各システムオブジェクトの各ユーザの操作を記録するアプリケーション固有の監査があります。 | ||
行 314: | 行 316: | ||
</ | </ | ||
+ | ==== 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: | ||
+ | |||
+ | </ | ||
+ | |||
+ | In this case it is listening for everyone, we must ensure it. To do this, we will edit the file ''/ | ||
+ | |||
+ | この場合、どこからでも接続を受け付けます。制限するには、ファイル ''/ | ||
+ | |||
+ | < | ||
+ | |||
+ | 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: | ||
+ | |||
+ | </ | ||
+ | |||
+ | **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 ''/ | ||
+ | |||
+ | ''/ | ||
+ | |||
+ | < | ||
+ | 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 | ||
+ | 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 | ||
+ | |||
+ | </ | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | 各ポートを調査し、その背後にあるアプリケーションを知る必要があります。 この場合、443、80 は '' | ||
+ | |||
+ | Those services that listen on **localhost** ('' | ||
+ | |||
+ | **localhost** ('' | ||
+ | |||
+ | 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 / | ||
+ | |||
+ | </ | ||
+ | |||
+ | And if we are not using that service, we can remove it. | ||
+ | |||
+ | また、そのサービスを使用していない場合は、削除できます。 | ||
+ | |||
+ | This process of " | ||
+ | |||
+ | プロセスの " | ||
+ | |||
+ | ===== 追加設定 ===== | ||
+ | |||
+ | ==== NTP 時刻同期 ==== | ||
+ | |||
+ | It is recommended to configure the time synchronization of the system: | ||
+ | |||
+ | システムの時刻同期を設定することをお勧めします。 | ||
+ | |||
+ | < | ||
+ | yum install ntpdate | ||
+ | echo " | ||
+ | chmod 755 / | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== ローカル監視 ===== | ||
+ | |||
+ | The system should have a [[: | ||
+ | |||
+ | システムには、[[: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | 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: | ||
+ | |||
+ | * セキュリティプラグイン | ||
+ | * 完全なシステムインベントリ(特にユーザーとインストール済みパッケージ)。 | ||
+ | * システムおよびセキュリティログの収集 | ||
+ | |||
+ | < | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | 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:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | 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, | ||
+ | |||
+ | これには、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' | ||
+ | * 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** | ||
+ | * Check if there is a MySQL running without the **root** | ||
+ | * Other checks. | ||
+ | |||
+ | * 最も一般的な 500個のパスワードを含む辞書(あらかじめ提供)を使用したユーザパスワードの監査チェック。 通常、これには数秒しかかかりません。 数百人のユーザがいる場合は、プラグインの実行を 2〜6時間ごとにのみ実行するようにカスタマイズする必要があります。 組織の一般的なパスワードを " | ||
+ | * SSH がデフォルトのポートで実行されていないことの確認。 | ||
+ | * FTB がデフォルトのポートで実行されていないことの確認。 | ||
+ | * SSH が **root** アクセスを許可していないことの確認。 | ||
+ | * MySQL が **root** パスワード無しで実行されているかどうかの確認。 | ||
+ | * その他チェック。 | ||
+ | [[ja: |