tomoyotitle.png

ドメイン遷移

プロセスがプログラムを実行しようとすると、以下の処理が行われます。

[source] は現在のドメイン名(例: <kernel> /usr/sbin/sshd /bin/bash )または現在のドメイン名の最後のパス名(例: /bin/bash )を表します。

[current_domain] は現在のドメイン名(例: <kernel> /usr/sbin/sshd /bin/bash )を表します。

[current_namespace] は現在のドメインの名前空間の名前(例: <kernel> /usr/sbin/sshd /bin/bash ドメインの場合は <kernel> )を表します。

[destination] はプログラムの実行要求が成功した場合に遷移するドメイン名(例: <kernel> /usr/sbin/sshd /bin/bash /bin/cat )を表します。

[candidate] はパーミッションのチェックの対象となるパス名(例: /bin/cat )を表します。

ステップ

内容

(1) プログラムのパス名を取得

要求されたプログラムのパス名を取得し、それを [candidate] とします。
シンボリックリンクとして提供されているプログラムに対処するために、パス名の最後のシンボリックリンクは解決しないようにします。

(2) aggregator ディレクティブのチェック

もし、例外ポリシーに
  aggregator [candidate] [pathname]
というエントリが存在している場合、 [pathname] を [candidate] にします。

(3) file execute ディレクティブのチェック

ドメインポリシーに
  file execute [candidate]
というエントリが存在している場合、ステップ (4) に進みます。


存在しない場合、プロファイルの CONFIG または CONFIG::file または CONFIG::file::execute (後者が前者より優先されます)で mode=enforcing という設定が行われていた場合にはプログラムの実行要求は拒否されます。

(4) ドメイン遷移の決定

1番最初に、例外ポリシーに
  reset_domain [candidate] from [source]
  reset_domain any from [source]
  reset_domain any from any
の何れかのエントリが存在しており、かつ、
  no_reset_domain [candidate] from [source]
  no_reset_domain any from [source]
  no_reset_domain any from any
の何れのエントリも存在しない場合、 <[candidate]> を [destination] にしてステップ (5) へ進みます。


2番目に、例外ポリシーに
  initialize_domain [candidate] from [source]
  initialize_domain any from [source]
  initialize_domain any from any
の何れかのエントリが存在しており、かつ、
  no_initialize_domain [candidate] from [source]
  no_initialize_domain any from [source]
  no_initialize_domain any from any
の何れのエントリも存在しない場合、 [current_namespace] [candidate] を [destination] にしてステップ (5) へ進みます。


3番目に、例外ポリシーに
  keep_domain [candidate] from [source]
  keep_domain any from [source]
  keep_domain any from any
の何れかのエントリが存在しており、かつ、
  no_keep_domain [candidate] from [source]
  no_keep_domain any from [source]
  no_keep_domain any from any
の何れのエントリも存在しない場合、 [current_domain] を [destination] にしてステップ (5) へ進みます。


4番目に、 [current_domain] [candidate] を [destination] にします。

(5) 遷移先ドメインの作成

ステップ (4) で決定した [destination] が存在しない場合には作成します。


reset_domain で決定された [destination] を作成できなかった場合には、プログラムの実行要求は拒否されます。


ステップ (4) で決定された [destination] を作成できなかった場合で、かつ、プロファイルの CONFIG または CONFIG::file または CONFIG::file::execute (後者が前者より優先されます)で mode=enforcing という設定が行われていた場合にはプログラムの実行要求は拒否されます。
そうではない場合、 transition_failed ディレクティブを設定して、ドメイン遷移を行わないまま実行要求の処理を継続します。

(6) インタプリターのチェック

(インタプリタを必要とするプログラムの場合、)インタプリタに対する読み込み許可が [destination] ドメインに与えられておらず、かつ [destination] ドメインに割り当てられているプロファイル( CONFIG または CONFIG::file または CONFIG::file::open (後者が前者より優先されます))のモードが mode=enforcing の場合、実行要求は拒否されます。

(7) プログラムの実行

もし、カレントプロセスが要求されたプログラムによって正常に置き換えられた場合、カレントプロセスは [destination] ドメインへと遷移します。