TMAegisBêta
Plus de règles pour linux

Linux distributions

TMA-ROCKY9-1.6.4

Ensure system wide crypto policy disables cbc for ssh

MoyenneNiveau 1Automatiséelinux

Description

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

Méthode de vérification

Méthode d'audit: Commande 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
Sortie attendue
compliant

Méthode de correction

Méthode de correction: Recommandation ou correctif d'infrastructure

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…

Propriétés

Systèmes d'exploitation
rocky-9
Étiquettes
cis-convertedlinux
Référence
CIS Rocky Linux 9 Benchmark v3.0.0 - 1.6.4

Vérifier cet hôte

Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.

shell
tmaegis scan --target linux