Red Hat Training
A Red Hat training course is available for RHEL 8
7.2. データの機密性にマルチカテゴリーセキュリティーを設定
デフォルトでは、MCS は targeted
ポリシーおよび mls
SELinux ポリシーでは有効ですが、ユーザーには設定されません。targeted
ポリシーでは、MCS は以下の場合にのみ設定されます。
- OpenShift
- virt
- サンドボックス (sandbox)
- ネットワークラベリング
-
コンテナー (
container-selinux
)
Type Enforcement に加え、MCS ルールで user_t
SELinux タイプを制約するルールを使用して、ローカルの SELinux モジュールを作成することにより、ユーザーを分類するように MCS を設定できます。
警告
特定のファイルのカテゴリーを変更すると、一部のサービスが稼働しなくなる場合があります。専門家でない場合は、Red Hat の営業担当者に連絡し、コンサルティングサービスを依頼してください。
前提条件
-
SELinux モードが
Enforcing
に設定されている。 -
SELinux のポリシーは
targeted
またはmls
に設定されている。 -
policycoreutils-python-utils
パッケージおよびsetools-console
パッケージがインストールされている。
手順
新しいファイルを作成します (例:
local_mcs_user.cil
)。# vim local_mcs_user.cil
以下のルールを挿入します。
(typeattributeset mcs_constrained_type (user_t))
ポリシーモジュールをインストールします。
# semodule -i local_mcs_user.cil
検証
各ユーザードメインに、すべてのコンポーネントの詳細を表示します。
# seinfo -xt user_t Types: 1 type user_t, application_domain_type, nsswitch_domain, corenet_unlabeled_type, domain, kernel_system_state_reader, mcs_constrained_type, netlabel_peer_type, privfd, process_user_target, scsi_generic_read, scsi_generic_write, syslog_client_type, pcmcia_typeattr_1, user_usertype, login_userdomain, userdomain, unpriv_userdomain, userdom_home_reader_type, userdom_filetrans_type, xdmhomewriter, x_userdomain, x_domain, dridomain, xdrawable_type, xcolormap_type;
関連情報
- Creating a local SELinux policy module
- コンテナーのコンテキストでの MCS の詳細については、ブログ記事 How SELinux separates containers using Multi-Level Security および Why you should be using Multi-Category Security for your Linux containers を参照してください。