Linux distributions
TMA-ALMA8-1.3.1.2
Ensure SELinux is not disabled in bootloader configuration
Опис
Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters.
Како се проверава
Метод провере: Команда љуске
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)"
Својства
- Оперативни системи
- almalinux-8
- Ознаке
- cis-convertedlinux
- Референца
- CIS AlmaLinux OS 8 Benchmark v4.0.0 - 1.3.1.2
Проверите овај рачунар
Покрените ово на рачунару за који имате дозволу за проверу. Скенирање ради у режиму само за читање.
tmaegis scan --target linux