TMAegisBeta
Mais regras para linux

Linux distributions

TMA-ROCKY9-1.6.4

Ensure system wide crypto policy disables cbc for ssh

MédiaNível 1Automatizadalinux

Descrição

Cipher Block Chaining (CBC) is an algorithm that uses a block cipher.

Como é verificado

Método de auditoria: Comando shell

shell
alt0() { command -v grep >/dev/null 2>&1 || { echo "step1: grep not installed"; return 1; }; o=$(bash -c 'grep -Pi -- '"'"'^\h*cipher\h*=\h*([^#\n\r]+)?-CBC\b'"'"' /etc/crypto-' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- policies/state/CURRENT.pol || { echo step1: missing policies/state/CURRENT.pol; return 1; }; o=$(bash -c 'grep -Pi -- '"'"'^\h*cipher@(lib|open)ssh(-server|-client)?\h*=\h*([^#\n\r]+)?- CBC\b'"'"' /etc/crypto-policies/state/CURRENT.pol' 2>/dev/null); [ -z "$o" ] || { echo "step2: $o" | head -c 300; return 1; }; }; if alt0; then echo compliant; fi
Saída esperada
compliant

Como é corrigido

Método de correção: Orientação ou patch de infraestrutura

Create or edit a file in /etc/crypto-policies/policies/modules/ ending in .pmod and add or modify one of the following lines: cipher@SSH = -*-CBC # Disables the CBC cipher for SSH Example: # printf '%s\n' "# This is a subpolicy to disable all CBC mode ciphers" "# for the SSH protocol (libssh and OpenSSH)" "cipher@SSH = -*-CBC" >> /etc/crypto-policies/policies/modules/NO-SSHCBC.pmod Run the following command to update the system-wide cryptographic policy # update-crypto-policies --set <CRYPTO_POLICY>:<CRYPTO_SUBPOLICY1>:<CRYPTO_SUBPOLICY2>:<CRYPTO_SUBPOLICY3> Example: # update-crypto-policies --set DEFAULT:NO-SHA1:NO-WEAKMAC:NO-SSHCBC Run the following command to reboot the system to make you…

Propriedades

Sistemas operacionais
rocky-9
Tags
cis-convertedlinux
Referência
CIS Rocky Linux 9 Benchmark v3.0.0 - 1.6.4

Verificar este host

Execute isto em uma máquina que você tenha permissão para auditar. A varredura é somente leitura.

shell
tmaegis scan --target linux