Linux distributions
TMA-SLES16-1.3.1.6
Ensure the SELinux mode is enforcing
説明
SELinux can run in enforcing or permissive mode. Enforcing - Is the recommended mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. Note: You can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t
チェック方法
監査方法: シェルコマンド
alt0() { command -v grep >/dev/null 2>&1 || { echo "step1: grep not installed"; return 1; }; o=$(bash -c 'grep -Pi -- '"'"'^\h*SELINUX=enforcing\b'"'"' /etc/selinux/config' 2>&1); printf '%s\n' "$o" | tr -s ' \t' ' ' | sed 's/^ //;s/ $//' | grep -Fxq -- SELINUX=enforcing || { echo step1: missing SELINUX=enforcing; return 1; }; command -v getenforce >/dev/null 2>&1 || { echo "step2: getenforce not installed"; return 1; }; o=$(bash -c getenforce 2>&1); printf '%s\n' "$o" | tr -s ' \t' ' ' | sed 's/^ //;s/ $//' | grep -Fxq -- Enforcing || { echo step2: missing Enforcing; return 1; }; }; if alt0; then echo compliant; fi- 期待される出力
compliant
修正方法
修正方法: ガイダンスまたは IaC パッチ
1. Reset the security context on the running system: # restorecon -R / 2. Update the SELinux running state to enforcing: Run the following command to create /etc/selinux/.autorelabel: # touch /etc/selinux/.autorelabel 3. Edit /etc/selinux/config and update the SELINUX parameter to SELINUX=enforcing Example: SELINUX=enforcing 4.Run the following command to reboot the system: # reboot WARNING: The autorelabel may be a long running process and require significant downtime. This should be planed for before executing the reboot! Note: Changing the SELinux mode temporarily can be done via the command setenforce 1
プロパティ
- オペレーティングシステム
- sles-16
- タグ
- cis-convertedlinux
- 参照
- CIS SUSE Linux Enterprise 16 Benchmark v1.0.0 - 1.3.1.6
このホストをチェック
監査が許可されているマシンで実行してください。スキャンは読み取り専用です。
tmaegis scan --target linux --level 2