Bottlerocket
TMA-BOTTLEROCKET-1.5.1
Ensure SELinux is configured
AltaNivel 1Automatizadabottlerocket
Descripción
SELinux must be enabled and in enforcing mode. The audit runs sestatus and requires SELinux enabled with the fortified policy and enforcing current and configured mode (falls back to getenforce = Enforcing when sestatus is not present). Run tmaegis on the host through the admin container root shell (sudo sheltie).
Cómo se verifica
Método de auditoría: Comando de shell
shell
if command -v sestatus >/dev/null 2>&1; then
out=$(sestatus 2>/dev/null) || exit 1
bad=0
for l in 'SELinux status: enabled' 'Loaded policy name: fortified' 'Current mode: enforcing' 'Mode from config file: enforcing'; do
printf '%s\n' "$out" | tr -s ' \t' ' ' | grep -Fxq -- "$l" || { echo "missing: $l"; bad=1; }
done
[ "$bad" -eq 0 ] && echo compliant
else
m=$(getenforce 2>/dev/null) || exit 1
[ "$m" = Enforcing ] && echo compliant || echo "SELinux: $m"
fi- Salida esperada
compliant
Cómo se corrige
Método de corrección: Guía o parche de infraestructura
Replace the system or reinstall the distribution.
Propiedades
- Sistemas operativos
- Cualquiera
- Etiquetas
- bottlerocketsystem
- Referencia
- CIS Bottlerocket Benchmark v1.0.0 - 1.5.1 Ensure SELinux is configured
Verificar este host
Ejecute esto en un equipo que tenga permiso para auditar. El escaneo es de solo lectura.
shell
tmaegis scan --target bottlerocket