2.2. SELinux の Permissive モードへの変更
SELinux を Permissive モードで実行していると、SELinux ポリシーは強制されません。システムは動作し続け、SELinux がオペレーションを拒否せず AVC メッセージをログに記録できるため、このログを使用して、トラブルシューティングやデバッグ、ならびに SELinux ポリシーの改善に使用できます。この場合、各 AVC は一度だけログに記録されます。
前提条件
-
selinux-policy-targeted
、libselinux-utils
、およびpolicycoreutils
パッケージがシステムにインストールされている。 -
selinux=0
またはenforcing=0
カーネルパラメーターは使用されません。
手順
任意のテキストエディターで
/etc/selinux/config
ファイルを開きます。以下に例を示します。vi /etc/selinux/config
# vi /etc/selinux/config
Copy to Clipboard Copied! SELINUX=permissive
オプションを設定します。This file controls the state of SELinux on the system. SELINUX= can take one of these three values: enforcing - SELinux security policy is enforced. permissive - SELinux prints warnings instead of enforcing. disabled - No SELinux policy is loaded. SELINUXTYPE= can take one of these two values: targeted - Targeted processes are protected, mls - Multi Level Security protection.
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=permissive # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
Copy to Clipboard Copied! システムを再起動します。
reboot
# reboot
Copy to Clipboard Copied!
検証
システムの再起動後に、
getenforce
コマンドがPermissive
を返すことを確認します。getenforce
$ getenforce Permissive
Copy to Clipboard Copied!