TMAegisБета
Више правила за linux

Linux distributions

TMA-ROCKY9-1.3.1.2

Ensure SELinux is not disabled in bootloader configuration

СредњаНиво 1Аутоматскаlinux

Опис

Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters.

Како се проверава

Метод провере: Команда љуске

shell
alt0() { o=$(bash -c 'grubby --info=ALL | grep -Po '"'"'(selinux|enforcing)=0\b'"'"'' 2>/dev/null); [ -z "$o" ] || { echo "step1: $o" | head -c 300; return 1; }; o=$(bash -c 'grep -Prs -- '"'"'^\h*([^#\n\r]+\h+)?kernelopts=([^#\n\r]+\h+)?(selinux|enforcing)=0\b'"'"' /boot/grub2 /boot/efi' 2>/dev/null); [ -z "$o" ] || { echo "step2: $o" | head -c 300; return 1; }; }; if alt0; then echo compliant; fi
Очекивани излаз
compliant

Како се исправља

Метод исправке: Смерница или закрпа инфраструктуре

Run the following command to remove the selinux=0 and enforcing=0 parameters: # grubby --update-kernel ALL --remove-args "selinux=0 enforcing=0" Run the following command to remove the selinux=0 and enforcing=0 parameters if they were created by the deprecated grub2-mkconfig command: # grep -Prsq -- '^\h*([^#\n\r]+\h+)?kernelopts=([^#\n\r]+\h+)?(selinux|enforcing)=0\b' /boot/grub2 /boot/efi && grub2-mkconfig -o "$(grep -Prl -- '\h*([^#\n\r]+\h+)?kernelopts=([^#\n\r]+\h+)?(selinux|enforcing)=0\b' /boot/grub2 /boot/efi)"

Својства

Оперативни системи
rocky-9
Ознаке
cis-convertedlinux
Референца
CIS Rocky Linux 9 Benchmark v3.0.0 - 1.3.1.2

Проверите овај рачунар

Покрените ово на рачунару за који имате дозволу за проверу. Скенирање ради у режиму само за читање.

shell
tmaegis scan --target linux