差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:documentation:07_technical_annexes:09_selinux_configuration_for_pandora_fms [2022/12/19 01:35] – [SELinux 設定] junichi | ja:documentation:07_technical_annexes:09_selinux_configuration_for_pandora_fms [Unknown date] (現在) – 削除 - 外部編集 (Unknown date) 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== Pandora FMS のための SELinux 設定 ====== | ||
- | {{indexmenu_n> | ||
- | |||
- | [[ja: | ||
- | |||
- | |||
- | |||
- | ===== 概要 ===== | ||
- | |||
- | In Pandora FMS the installation should always be done with Security-Enhanced Linux ([[https:// | ||
- | |||
- | Pandora FMS では、インストールは常に Security-Enhanced Linux ([[https:// | ||
- | |||
- | ===== CentOS 7 ===== | ||
- | |||
- | ==== 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 を使用できるようにいくつかのパッケージをインストールする必要がある場合があります。 root または同等の権限でコマンドラインから入力します (コマンドの先頭に **sudo** を付けます): | ||
- | |||
- | < | ||
- | |||
- | yum install selinux-policy-devel -y | ||
- | yum install policycoreutils-python -y | ||
- | |||
- | </ | ||
- | |||
- | ==== 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 が返すエラーは、以下にあります。 | ||
- | |||
- | * / | ||
- | * / | ||
- | |||
- | **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. | ||
- | |||
- | 確認をしやすくするために、すでに出ているログを削除し新たなログが出るまで待つことを強くお勧めします。 | ||
- | |||
- | syslog を停止します。(rsyslog の場合もあります) | ||
- | |||
- | < | ||
- | |||
- | # / | ||
- | |||
- | </ | ||
- | |||
- | audit.log とシステムのメッセージログファイルを削除します。 | ||
- | |||
- | < | ||
- | # rm / | ||
- | |||
- | </ | ||
- | |||
- | syslog を再開します。 | ||
- | |||
- | < | ||
- | # / | ||
- | |||
- | </ | ||
- | |||
- | ==== 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 を希望の内容で設定するには、設定ファイルを編集します。 | ||
- | |||
- | < | ||
- | # This file controls the state of SELinux on the system. | ||
- | # SELinux= can take one of these three values: | ||
- | # | ||
- | # | ||
- | # | ||
- | SELinux=enforcing | ||
- | # SELinuxTYPE= can take one of these two values: | ||
- | # | ||
- | # mls - Multi Level Security protection. | ||
- | SELinuxTYPE=targeted | ||
- | </ | ||
- | |||
- | プログラムの実行に制限を付けるには、SELinux を " | ||
- | |||
- | ==== ポリシールールを作成するためのエントリーの検索 ==== | ||
- | 最新のログを見るにはつぎのようにします。 | ||
- | |||
- | # tail -f / | ||
- | |||
- | 次のようないくつかのエラーがみつかります。 | ||
- | |||
- | # type=AVC msg=audit(1431437562.755: | ||
- | |||
- | これらのエラーを SELinux ルールに変換します。 | ||
- | |||
- | # grep collections / | ||
- | |||
- | 実行すると 2つの新たなファイルが作成されます。 | ||
- | |||
- | < | ||
- | - pandora.pp | ||
- | - pandora.te | ||
- | </ | ||
- | |||
- | 新たなルールを有効化するには、次のようにします。 | ||
- | |||
- | # sudo semodule -i pandora.pp | ||
- | |||
- | エラーが出たものをルールに追加する対応を繰り返します。その後、SELinux からエラーの出力がなくなります。 | ||
- | |||
- | ==== Pandora FMS の適切な動作に必要なルール ==== | ||
- | Pandora FMS が実行するすべてのサービスが正しく動作するようにしたい場合は、次の操作を許可するいくつかのルールを作成する必要があります。 | ||
- | |||
- | - コレクションの作成、更新、削除 | ||
- | |||
- | - プログラムタスクによるメール送信 (cronジョブ) | ||
- | |||
- | - エージェントのリモート設定 | ||
- | |||
- | 逆にいうと、SELinux はこれらの操作に関連するアクションをブロックします。 | ||
- | |||
- | SELinux が有効化された状態で Pandora FMS を利用するためのルールを追加するには、次のようにします。 | ||
- | |||
- | # grep -e data_in -e collections -e var_spool_t -e zip -e md5 -e denied / | ||
- | |||
- | その後、ルールを有効化するための前述の対応を行う必要があります。 | ||
- | |||
- | # sudo semodule -i pandora.pp | ||