Azure Container Linux
TMA-AZURE-CONTAINER-LINUX-5.2.23
Ensure sshd granular forwarding is disabled
Opis
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.
Kako se proverava
Metod provere: Komanda ljuske
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- Očekivani izlaz
compliant
Kako se ispravlja
Metod ispravke: Smernica ili zakrpa infrastrukture
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.
Svojstva
- Operativni sistemi
- Bilo koji
- Oznake
- azure-container-linuxcis-converted
- Referenca
- CIS Azure Container Linux Benchmark v1.0.0 - 5.2.23 Ensure sshd granular forwarding is disabled
Proverite ovaj računar
Pokrenite ovo na računaru za koji imate dozvolu za proveru. Skeniranje radi u režimu samo za čitanje.
tmaegis scan --target azure-container-linux --level 2