TMAegisБета
Другие правила для azure-container-linux

Azure Container Linux

TMA-AZURE-CONTAINER-LINUX-5.2.23

Ensure sshd granular forwarding is disabled

НизкийУровень 2Автоматическаяazure-container-linux

Описание

As a supplement to the DisableForwarding directive, all individual SSH forwarding mechanisms should be disabled: AllowTcpForwarding, X11Forwarding, AllowAgentForwarding, AllowStreamLocalForwarding, and PermitTunnel. Setting the five granular directives allows a cluster to selectively re-enable one forwarding type (for example AllowTcpForwarding for kubectl port-forward) while keeping the others disabled.

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

Метод проверки: Команда оболочки

shell
alt0() { o=$(bash -c 'sshd -T | grep -iE '"'"'allowtcpforwarding|x11forwarding|allowagentforwarding|allowstreamlocalforwarding|p ermittunnel'"'"'' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'allowtcpforwarding no' || { echo step1: missing 'allowtcpforwarding no'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'x11forwarding no' || { echo step1: missing 'x11forwarding no'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'allowagentforwarding no' || { echo step1: missing 'allowagentforwarding no'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'allowstreamlocalforwarding no' || { echo step1: missing 'allowstreamlocalforwarding no'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'permittunnel no' || { echo step1: missing 'permittunnel no'; return 1; }; }; if alt0; then echo compliant; fi
Ожидаемый вывод
compliant

Как исправляется

Метод исправления: Рекомендация или патч инфраструктуры

Edit /etc/ssh/sshd_config (or a drop-in in /etc/ssh/sshd_config.d/) to set the following above any Include entry: AllowTcpForwarding no X11Forwarding no AllowAgentForwarding no AllowStreamLocalForwarding no PermitTunnel no Note: First occurrence of an option takes precedence.

Свойства

Операционные системы
Любая
Теги
azure-container-linuxcis-converted
Источник
CIS Azure Container Linux Benchmark v1.0.0 - 5.2.23 Ensure sshd granular forwarding is disabled

Проверить этот хост

Выполните команду на компьютере, аудит которого вам разрешён. Сканирование работает только на чтение.

shell
tmaegis scan --target azure-container-linux --level 2