Rudy Ruckerの同名の著書とは直接関係ありませんが、私の思考の道具箱であることは確かです。大抵のページは書きかけで、内容も不完全ですのでご注意を。

Dan Walshの記事
http://danwalsh.livejournal.com/20931.html

Fedora6とRHEL5から、setroubleshootというツールが導入された。
これはsyslogのAVC auditのメッセージを監視して、pluginとして定義されたマッチングパターンに一致するものを走査する。そして、SELixuxがなぜアクセスを拒否したのか、これを解決するにはどうしたらいいか、もしくは、可能性のあるアタックに対してどう対処すべきかを表示する。
このツールの出力を読めば、SELinuxが何をしているのか、理解しやすいだろう。
setroubleshootをグラフィックな環境で使ったことがある人は、画面にポップアップしたウィンドウに保安官の☆のバッジが光っているのを目にしたことがあるだろう。その☆をクリックすれば、メッセージを読むことができる。

In Fedora 6 and Red Hat Enterprise Linux 5 we introduced setroubleshoot. This is a tool which listens for AVC audit messages and then runs them through a database of plugins looking for a match, and then trying to explain what SELinux has prevented and how to fix the problem or to react to a potential break in. It has been fairly successful in explaining what SELinux is doing. Most people that have used setroubleshoot see a bubble window appear in the top tool bar and the "old West Sheriff Star" appear. If you click on the Star, the message appears.

グラフィカルなデスクトップ環境があればいいけれど、サーバとして利用している場合はどうだろう?
This is great for the Desktop, but what about people using this on servers?

setroubleshoot自体は、Xウィンドウ環境やグラフィカルなインターフェースが無くても動作する。
setroubleshootは3つのRPMパッケージで構成されている
Setroubleshoot can be run without X windows and without the GUI. setroubleshoot is broken into three different RPMS.

たとえばFedora 9では
On Fedora 9:

# rpm -qa setroubleshoot\*
setroubleshoot-server-2.0.8-2.fc9.noarch
setroubleshoot-2.0.8-2.fc9.noarch
setroubleshoot-plugins-2.0.4-5.fc9.noarch

の3つだ

サーバマシンなら、setroubleshoot-serverとsetroubleshoot-pluginsだけをインストールすればよい。
setroubleshootの本体は、グラフィカルなデスクトップ環境の場合だけ必要だ。
serverがインストールされていると、syslogの出力ファイルである/var/log/messagesの中に、次のようなメッセージが出力されるようになる。
On a server only machine you can install just the server and the plugins. You only need setroubleshoot if you are using the graphical interfaces. With the server component installed you will see messages like the following appear in /var/log/messages.

Jul 1 22:03:01 localhost setroubleshoot: SELinux is preventing semodule (staff_t) "read" to ./BackupPC.pp (semanage_store_t). For complete SELinux messages. run sealert -l bca0cd18-5a5b-4cc5-9b08-5f5778439b2c

メッセージにあるとおり、'For complete SELinux messages. run ...' setroubleshootが出力するすべてのメッセージを表示したければ、sealertコマンドを実行すればよい。
sealert -l \*
というコマンドを実行すれば、setroubleshootから受け取ったすべてのメッセージの詳細をみることもできる。
メッセージがデスクトップの画面に表示できないサーバ環境でも、setroubleshootは役に立つのだ。
You can then use sealert to look at any AVC messages you get. sealert also has a neat feature, that you can execute 'sealert -l \*' to look at all the alert messages that you received.
While these messages do not instantly appear on you desktop, you can still use setroubleshoot on a server.

もし、SELinuxのレポートをメールで受け取りたい場合には、setroubleshoot-serverの設定次第で可能だ。
/var/lib/setroubleshoot/emali_alert_recipients というファイルに、受信メールアドレスの行をくわえるだけでいい。同じタイプのalertを続けて受け取りたくない場合には、メールアドレスに続いて
filter_type=after_first
と書けばよい。
If you want to receive email whenever SELinux reports a problem, you can configure setroubleshoot-server to send email messages. Edit /var/lib/setroubleshoot/email_alert_recipients, add a line containing your email address, if you only want email the first time an alert fires and not subsequently add "filter_type=after_first" after the email address.

この記事は、John Dennisからのメールから一部をお借りしている。
Partially borrowed from an Email message from John Dennis.
タグ

Wiki内検索

メニューバーA

ここは自由に編集できるエリアです。

フリーエリア

編集にはIDが必要です