4.2. どのログファイルが使用されるか
Red Hat Enterprise Linux では、デフォルトのパッケージ選択から削除されていない限り、dbus パッケージおよび audit パッケージがデフォルトでインストールされます。yum を使用して setroubleshoot-server がインストールされている必要があります (yum install setroubleshoot-server コマンドを使用します)。
auditd デーモンが実行している場合は、以下のような SELinux 拒否メッセージが、デフォルトで /var/log/audit/audit.log に書き込まれます。
type=AVC msg=audit(1223024155.684:49): avc: denied { getattr } for pid=2000 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=399185 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:samba_share_t:s0 tclass=file
type=AVC msg=audit(1223024155.684:49): avc: denied { getattr } for pid=2000 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=399185 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:samba_share_t:s0 tclass=file
さらに、以下のようなメッセージは
/var/log/message ファイルに書き込まれます。
May 7 18:55:56 localhost setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1 (samba_share_t). For complete SELinux messages. run sealert -l de7e30d6-5488-466d-a606-92c9f40d316d
May 7 18:55:56 localhost setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1 (samba_share_t). For complete SELinux messages. run sealert -l de7e30d6-5488-466d-a606-92c9f40d316d
Red Hat Enterprise Linux 7 では、
setroubleshootd はサービスとして継続的に実行されなくなりました。ただし、AVC メッセージの分析には依然として使用されます。2 つの新しいプログラムは、必要に応じて setroubleshoot を開始するメソッドとして機能します。
sedispatchユーティリティーは、監査サブシステムの一部として実行します。AVC 拒否メッセージが返されると、sedispatchはdbusを使用してメッセージを送信します。これらのメッセージは、すでに実行中の場合はsetroubleshootdに直接表示されます。これが実行されていない場合、sedispatchは自動的に起動します。seappletユーティリティーはシステムツールバーで実行され、setroubleshootdの dbus メッセージをリッスンします。通知バブルを起動し、ユーザーが AVC メッセージを確認できるようにします。
手順4.1 デーモンの自動起動
auditdデーモンおよびrsyslogデーモンが、システムの起動時に自動的に起動するように設定するには、root で次のコマンドを実行します。systemctl enable auditd.service
~]# systemctl enable auditd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl enable rsyslog.service
~]# systemctl enable rsyslog.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - デーモンが有効になっていることを確認するには、シェルプロンプトで以下のコマンドを入力します。
systemctl is-enabled auditd
~]$ systemctl is-enabled auditd enabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl is-enabled rsyslog
~]$ systemctl is-enabled rsyslog enabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow または、systemctl status service-name.service コマンドを使用して、コマンド出力でenabledキーワードを検索します。以下に例を示します。systemctl status auditd.service | grep enabled
~]$ systemctl status auditd.service | grep enabled auditd.service - Security Auditing Service Loaded: loaded (/usr/lib/systemd/system/auditd.service; enabled)Copy to Clipboard Copied! Toggle word wrap Toggle overflow
systemd デーモンによるシステムサービスの管理方法の詳細は、System Administrator's Guide の Managing System Services の章を参照してください。