ja:documentation:07_technical_annexes:09_selinux_configuration_for_pandora_fms

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
最新のリビジョン両方とも次のリビジョン
ja:documentation:07_technical_annexes:09_selinux_configuration_for_pandora_fms [2022/12/19 01:22] – [概要] junichija:documentation:07_technical_annexes:09_selinux_configuration_for_pandora_fms [2022/12/19 01:38] – [ポリシールールを作成するためのエントリーの検索] junichi
行 4: 行 4:
 [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]
  
-===== Pandora FMS のための SELinux 設定 =====+
  
 ===== 概要 ===== ===== 概要 =====
行 11: 行 11:
  
 Pandora FMS では、インストールは常に Security-Enhanced Linux ([[https://en.wikipedia.org/wiki/Security-Enhanced_Linux|SELinux]] ) を無効にして行う必要があります。 インストール後、環境によって有効にする必要がある場合の CentOS 7 での設定について詳しく説明します。 Pandora FMS では、インストールは常に Security-Enhanced Linux ([[https://en.wikipedia.org/wiki/Security-Enhanced_Linux|SELinux]] ) を無効にして行う必要があります。 インストール後、環境によって有効にする必要がある場合の CentOS 7 での設定について詳しく説明します。
 +
 +===== 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> 
 + 
 +<WRAP center round info 60%> 
 + 
 +CentOS 7 はまもなくサポート終了(**EOL**)になります。 //このドキュメントは過去の記録のために保持しています.// 
 + 
 +</WRAP> 
 + 
 +To create this type of rules use **Audit2allow**, which will be in charge of allowing the necessary actions. 
 + 
 +**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** を付けます):
  
 <code> <code>
-# sudo yum install SELinux-policy-devel + 
-# sudo yum install policycoreutils-python+yum install selinux-policy-devel -y 
 +yum install policycoreutils-python -y 
 </code> </code>
  
 ==== 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>
 +
 +<WRAP center round info 60%>
 +
 +CentOS 7 はまもなくサポート終了(**EOL**)になります。 //このドキュメントは過去の記録のために保持しています.//
 +
 +</WRAP>
 +
 SELinux が返すエラーは、以下にあります。 SELinux が返すエラーは、以下にあります。
  
   * /var/log/audit/audit.log   * /var/log/audit/audit.log
   * /var/log/messages   * /var/log/messages
 +
 +**IMPORTANT:**
 +
 +**重要:**
 +
 +In versions prior to 747, the audit log path is: **/var/log/audit/audit.log**.
 +
 +バージョン 747 までは、監査ログのパスは **/var/log/audit/audit.log** です。
 +
 +If updating from **OUM**  you will need to modify the **logrotate**  [[:en:documentation:04_using:11_managing_and_administration#local_server_logs|file]].
 +
 +**OUM** からアップデートした場合は、**logrotate** [[:ja:documentation:04_using:11_managing_and_administration#ローカルサーバログ|ファイル]]を修正する必要があります。
 +
 +In order to check the cleanest way, we highly recomend to remove previous logs and wait until it are generated again with new records.
  
 確認をしやすくするために、すでに出ているログを削除し新たなログが出るまで待つことを強くお勧めします。 確認をしやすくするために、すでに出ているログを削除し新たなログが出るまで待つことを強くお勧めします。
行 30: 行 80:
 syslog を停止します。(rsyslog の場合もあります) syslog を停止します。(rsyslog の場合もあります)
  
-  # /etc/init.d/syslog stop +<code> 
 + 
 +# /etc/init.d/syslog stop 
 + 
 +</code>
  
 audit.log とシステムのメッセージログファイルを削除します。 audit.log とシステムのメッセージログファイルを削除します。
  
-  # rm /var/log/audit/audit.log /var/log/messages+<code> 
 +# rm /var/www/html/pandora_console/log/audit.log /var/log/messages 
 + 
 +</code>
  
 syslog を再開します。 syslog を再開します。
  
-  # /etc/init.d/syslog start+<code> 
 +# /etc/init.d/syslog start 
 + 
 +</code>
  
 ==== 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>
 +
 +<WRAP center round info 60%>
 +
 +CentOS 7 はまもなくサポート終了(**EOL**)になります。 //このドキュメントは過去の記録のために保持しています.//
 +
 +</WRAP>
 +
 SELinux を希望の内容で設定するには、設定ファイルを編集します。 SELinux を希望の内容で設定するには、設定ファイルを編集します。
  
行 59: 行 132:
  
 ==== ポリシールールを作成するためのエントリーの検索 ==== ==== ポリシールールを作成するためのエントリーの検索 ====
 +
 +<WRAP center round info 60%>
 +
 +CentOS 7 will soon reach its end of life (**EOL**). //This documentation is retained for historical purposes.//
 +
 +</WRAP>
 +
 +<WRAP center round info 60%>
 +
 +CentOS 7 はまもなくサポート終了(**EOL**)になります。 //このドキュメントは過去の記録のために保持しています.//
 +
 +</WRAP>
 +
 最新のログを見るにはつぎのようにします。 最新のログを見るにはつぎのようにします。
  
-  # tail -f /var/log/audit/audit.log /var/log/messages+<code> 
 +# tail -f /var/www/html/pandora_console/log/audit.log /var/log/messages 
 + 
 +</code>
  
 次のようないくつかのエラーがみつかります。 次のようないくつかのエラーがみつかります。
  
-  # type=AVC msg=audit(1431437562.755:437): avc:  denied  { write } for  pid=1835 comm="httpd" name="collections" dev=dm-0 ino=266621 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:var_spool_t:s0 tclass=dir+<code> 
 + # type=AVC msg=audit(1431437562.755:437): avc:  denied  { write } for  pid=1835 comm="httpd" name="collections" dev=dm-0 ino=266621 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:var_spool_t:s0 tclass=dir 
 + 
 +</code>
  
 これらのエラーを SELinux ルールに変換します。 これらのエラーを SELinux ルールに変換します。
  
-  # grep collections /var/log/audit/audit.log | audit2allow -M pandora+<code> 
 + # grep collections /var/www/html/pandora_console/log/audit.log | audit2allow -M pandora 
 + 
 +</code>
  
 実行すると 2つの新たなファイルが作成されます。 実行すると 2つの新たなファイルが作成されます。
行 80: 行 175:
 新たなルールを有効化するには、次のようにします。 新たなルールを有効化するには、次のようにします。
  
-  # sudo semodule -i pandora.pp+<code> 
 +# sudo semodule -i pandora.pp 
 + 
 +</code>
  
 エラーが出たものをルールに追加する対応を繰り返します。その後、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>
 +
 +<WRAP center round info 60%>
 +
 +CentOS 7 はまもなくサポート終了(**EOL**)になります。 //このドキュメントは過去の記録のために保持しています.//
 +
 +</WRAP>
 +
 Pandora FMS が実行するすべてのサービスが正しく動作するようにしたい場合は、次の操作を許可するいくつかのルールを作成する必要があります。 Pandora FMS が実行するすべてのサービスが正しく動作するようにしたい場合は、次の操作を許可するいくつかのルールを作成する必要があります。