Linux distributions
TMA-ALMA8-1.3.1.2
Ensure SELinux is not disabled in bootloader configuration
Beschreibung
Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters.
So wird geprüft
Prüfmethode: Shell-Befehl
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- Erwartete Ausgabe
compliant
So wird behoben
Behebungsmethode: Anleitung oder Infrastruktur-Patch
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)"
Eigenschaften
- Betriebssysteme
- almalinux-8
- Tags
- cis-convertedlinux
- Referenz
- CIS AlmaLinux OS 8 Benchmark v4.0.0 - 1.3.1.2
Diesen Host prüfen
Führen Sie dies auf einem Rechner aus, den Sie prüfen dürfen. Der Scan ist schreibgeschützt.
tmaegis scan --target linux