Azure Container Linux
TMA-AZURE-CONTAINER-LINUX-5.2.23
Ensure sshd granular forwarding is disabled
Deskripsi
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.
Cara pemeriksaan
Metode audit: Perintah 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- Output yang diharapkan
compliant
Cara perbaikan
Metode perbaikan: Panduan atau patch infrastruktur
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.
Properti
- Sistem operasi
- Apa saja
- Tag
- azure-container-linuxcis-converted
- Referensi
- CIS Azure Container Linux Benchmark v1.0.0 - 5.2.23 Ensure sshd granular forwarding is disabled
Periksa host ini
Jalankan ini pada mesin yang diizinkan untuk Anda audit. Pemindaian bersifat hanya baca.
tmaegis scan --target azure-container-linux --level 2