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

修正方法

修正方法: ガイダンスまたは IaC パッチ

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