TMAegisBeta
More rules for bind

BIND DNS

TMA-BIND-6.2

Hide Nameserver ID

MediumLevel 1Automatedbind

Description

The server-id option provides a server identifier that will be returned in response to an NSID query. An NSID query is described in RFC-5001, and is a method to identify servers in an environment where there are multiple DNS servers sharing the same IP address. The audit requires server-id to be unset (default none) or none, so id.server/NSID queries return nothing. The audit parses the effective configuration printed by named-checkconf -p (all include files resolved) from /etc/named.conf (RHEL; chroot /var/named/chroot is detected) or /etc/bind/named.conf (Debian/Ubuntu).

How it is checked

Audit method: Shell command

shell
if [ -f /var/named/chroot/etc/named.conf ]; then out=$(named-checkconf -t /var/named/chroot -p /etc/named.conf 2>/dev/null) || exit 1
else conf=/etc/named.conf; [ -f "$conf" ] || conf=/etc/bind/named.conf
  out=$(named-checkconf -p "$conf" 2>/dev/null) || exit 1; fi
flat=$(printf '%s\n' "$out" | tr '\t\n' '  ' | tr -s ' ')
opts=$(printf '%s\n' "$out" | awk '/^options[ \t]*\{/{f=1} f{print} f&&/^\};/{exit}' | tr '\t\n' '  ' | tr -s ' ')
s=$(printf '%s\n' "$opts" | grep -Eo '[{; ]server-id [^;]*;')
case "$s" in ''|*' none;'|*'"none";') ;; *) echo "server-id disclosed: $s"; exit 1 ;; esac
printf '%s\n' "$opts" | grep -Eq '[{; ]hostname "[^"]+";' && ! printf '%s\n' "$opts" | grep -Eq '[{; ]hostname "?none"?;' && { echo 'hostname statement discloses a name'; exit 1; }
echo compliant
Expected output
compliant

How it is fixed

Fix method: Guidance or infrastructure patch

To explicitly disable NSID support, add or modify the server-id option in the global BIND options with a value of none as shown below. server-id none;

Properties

Operating systems
Any
Tags
binddnsinformation-disclosure
Reference
CIS ISC BIND DNS Server 9.11 Benchmark v1.0.0 - 6.2 Hide Nameserver ID

Check this host

Run this on a machine you are allowed to audit. The scan is read-only.

shell
tmaegis scan --target bind