差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
ja:documentation:07_technical_annexes:09_selinux_configuration_for_pandora_fms [2021/06/17 13:32] – 作成 junichi | ja:documentation:07_technical_annexes:09_selinux_configuration_for_pandora_fms [2022/12/19 01:38] – [ポリシールールを作成するためのエントリーの検索] junichi | ||
---|---|---|---|
行 4: | 行 4: | ||
[[ja: | [[ja: | ||
- | ===== Pandora FMS のための SELinux 設定 ===== | ||
- | ==== 概要 ==== | ||
- | 通常、Pandora のインストールでは SELinux は無効化することをお勧めしています(我々の ISO イメージには追加されてます)。しかし、セキュリティ上の理由から有効化が必要な環境も多くあります。 | ||
- | ここでは、カスタムで SELinux で個々のモジュールのポリシーを作成する方法を示します。 | + | ===== 概要 ===== |
- | ルールを作成するには、Audit2allow | + | In Pandora FMS the installation should always be done with Security-Enhanced Linux ([[https:// |
+ | |||
+ | Pandora FMS では、インストールは常に Security-Enhanced Linux ([[https:// | ||
+ | |||
+ | ===== CentOS 7 ===== | ||
==== Audit2allow のインストール ==== | ==== Audit2allow のインストール ==== | ||
- | インストールを開始するまえに、Audit2allow を使うために必要なパッケージをインストールします。 | + | |
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 will soon reach its end of life (**EOL**). //This documentation is retained for historical purposes.// | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 はまもなくサポート終了(**EOL**)になります。 // | ||
+ | |||
+ | </ | ||
+ | |||
+ | To create this type of rules use **Audit2allow**, | ||
+ | |||
+ | **Audit2allow** を利用したルールを作成します。これは必要なアクションを許可する役割を持ちます。 | ||
+ | |||
+ | Before you start creating the rules for the policies, you may need to install a number of packages to be able to use Audit2allow. enter in the command terminal with root or equivalent rights (prefix the command with **sudo**): | ||
+ | |||
+ | ポリシーのルール作成を開始する前に、Audit2allow を使用できるようにいくつかのパッケージをインストールする必要がある場合があります。 | ||
< | < | ||
- | # sudo yum install | + | |
- | # sudo yum install policycoreutils-python | + | yum install |
+ | yum install policycoreutils-python | ||
</ | </ | ||
==== SELinux ディレクトリの場所 ==== | ==== SELinux ディレクトリの場所 ==== | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 will soon reach its end of life (**EOL**). //This documentation is retained for historical purposes.// | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 はまもなくサポート終了(**EOL**)になります。 // | ||
+ | |||
+ | </ | ||
+ | |||
SELinux が返すエラーは、以下にあります。 | SELinux が返すエラーは、以下にあります。 | ||
* / | * / | ||
* / | * / | ||
+ | |||
+ | **IMPORTANT: | ||
+ | |||
+ | **重要:** | ||
+ | |||
+ | In versions prior to 747, the audit log path is: **/ | ||
+ | |||
+ | バージョン 747 までは、監査ログのパスは **/ | ||
+ | |||
+ | If updating from **OUM** | ||
+ | |||
+ | **OUM** からアップデートした場合は、**logrotate** [[: | ||
+ | |||
+ | In order to check the cleanest way, we highly recomend to remove previous logs and wait until it are generated again with new records. | ||
確認をしやすくするために、すでに出ているログを削除し新たなログが出るまで待つことを強くお勧めします。 | 確認をしやすくするために、すでに出ているログを削除し新たなログが出るまで待つことを強くお勧めします。 | ||
行 31: | 行 80: | ||
syslog を停止します。(rsyslog の場合もあります) | syslog を停止します。(rsyslog の場合もあります) | ||
- | | + | < |
+ | |||
+ | # / | ||
+ | |||
+ | </ | ||
audit.log とシステムのメッセージログファイルを削除します。 | audit.log とシステムのメッセージログファイルを削除します。 | ||
- | | + | < |
+ | # rm /var/ | ||
+ | |||
+ | </ | ||
syslog を再開します。 | syslog を再開します。 | ||
- | | + | < |
+ | # / | ||
+ | |||
+ | </ | ||
==== SELinux 設定 ==== | ==== SELinux 設定 ==== | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 will soon reach its end of life (**EOL**). //This documentation is retained for historical purposes.// | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 はまもなくサポート終了(**EOL**)になります。 // | ||
+ | |||
+ | </ | ||
+ | |||
SELinux を希望の内容で設定するには、設定ファイルを編集します。 | SELinux を希望の内容で設定するには、設定ファイルを編集します。 | ||
行 60: | 行 132: | ||
==== ポリシールールを作成するためのエントリーの検索 ==== | ==== ポリシールールを作成するためのエントリーの検索 ==== | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 will soon reach its end of life (**EOL**). //This documentation is retained for historical purposes.// | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 はまもなくサポート終了(**EOL**)になります。 // | ||
+ | |||
+ | </ | ||
+ | |||
最新のログを見るにはつぎのようにします。 | 最新のログを見るにはつぎのようにします。 | ||
- | | + | < |
+ | # tail -f /var/ | ||
+ | |||
+ | </ | ||
次のようないくつかのエラーがみつかります。 | 次のようないくつかのエラーがみつかります。 | ||
- | | + | < |
+ | # type=AVC msg=audit(1431437562.755: | ||
+ | |||
+ | </ | ||
これらのエラーを SELinux ルールに変換します。 | これらのエラーを SELinux ルールに変換します。 | ||
- | | + | < |
+ | # grep collections /var/ | ||
+ | |||
+ | </ | ||
実行すると 2つの新たなファイルが作成されます。 | 実行すると 2つの新たなファイルが作成されます。 | ||
行 81: | 行 175: | ||
新たなルールを有効化するには、次のようにします。 | 新たなルールを有効化するには、次のようにします。 | ||
- | | + | < |
+ | # sudo semodule -i pandora.pp | ||
+ | |||
+ | </ | ||
エラーが出たものをルールに追加する対応を繰り返します。その後、SELinux からエラーの出力がなくなります。 | エラーが出たものをルールに追加する対応を繰り返します。その後、SELinux からエラーの出力がなくなります。 | ||
==== Pandora FMS の適切な動作に必要なルール ==== | ==== Pandora FMS の適切な動作に必要なルール ==== | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 will soon reach its end of life (**EOL**). //This documentation is retained for historical purposes.// | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round info 60%> | ||
+ | |||
+ | CentOS 7 はまもなくサポート終了(**EOL**)になります。 // | ||
+ | |||
+ | </ | ||
+ | |||
Pandora FMS が実行するすべてのサービスが正しく動作するようにしたい場合は、次の操作を許可するいくつかのルールを作成する必要があります。 | Pandora FMS が実行するすべてのサービスが正しく動作するようにしたい場合は、次の操作を許可するいくつかのルールを作成する必要があります。 | ||