BIND DNS
TMA-BIND-8.7
Ensure Signing Keys are Unique
Descripción
Each zone should have a unique Zone Signing Keys (ZSK) and a unique Key Signing Keys (KSK) that is different from all other keys. The audit extracts the DNSKEY values of every K*.key file under $BIND_HOME and requires each to be unique.
Cómo se verifica
Método de auditoría: Comando de shell
BH=''; for d in /var/named /etc/bind /var/cache/bind; do [ -d "$d" ] && BH="$BH $d"; done
[ -n "$BH" ] || { echo 'no BIND directory found'; exit 1; }
RUN=''; for d in /run/named /var/run/named; do [ -d "$d" ] && { RUN=$d; break; }; done
G='-group root'; U='-user root'; for a in named bind; do grep -q "^$a:" /etc/group 2>/dev/null && G="$G -o -group $a"; grep -q "^$a:" /etc/passwd 2>/dev/null && U="$U -o -user $a"; done
RT='^(/var/named(/chroot/var/named)?/(dynamic|slaves|data)|/var/named/chroot/(var/)?run/named|/var/named/chroot/var/log|/var/named/chroot/(var/)?tmp|/var/cache/bind|/run/named|/var/run/named)(/|$)'
keys=$(find $BH /etc/bind/keys -name 'K*.key' -type f 2>/dev/null | sort -u)
[ -n "$keys" ] || { echo compliant; exit 0; }
d=$(for k in $keys; do grep -ho 'DNSKEY .*' "$k"; done | sort | uniq -d | wc -l)
[ "$d" -eq 0 ] && echo compliant || echo "$d duplicated DNSKEY value(s)"- Salida esperada
compliant
Cómo se corrige
Método de corrección: Guía o parche de infraestructura
To remediate a duplicate key, perform the following: ; Generate a new key to replace the duplicate key using dnssec-keygen and one of the recommended algorithms. An example command is shown below: # dnssec-keygen -a ECDSAP256SHA256 example.org ; Implement a rollover period to phase out the duplicate key and replace it with the the newly generated key. ; Once the key is fully deleted from the active use, remove the file.
Propiedades
- Sistemas operativos
- Cualquiera
- Etiquetas
- binddnsdnssec
- Referencia
- CIS ISC BIND DNS Server 9.11 Benchmark v1.0.0 - 8.7 Ensure Signing Keys are Unique
Verificar este host
Ejecute esto en un equipo que tenga permiso para auditar. El escaneo es de solo lectura.
tmaegis scan --target bind --level 2