TMAegis
Више правила за bind

TMA-BIND-2.5

Set root Ownership of BIND Configuration Files

СредњаНиво 1Аутоматскаbind

Опис

The configuration files in the ISC BIND directories should be owned by root. Of course, any files created at run time by BIND, such as pid files, log files and slave zone files will necessarily be owned by named. The audit lists files under $BIND_HOME, outside the runtime directories, not owned by root and requires none. $BIND_HOME is taken as the existing ones of /var/named (RHEL, including a chroot), /etc/bind and /var/cache/bind (Debian/Ubuntu) and $RUNDIR as /run/named; the runtime directories (dynamic, slaves, data, run, log, tmp, /var/cache/bind) are excluded where the benchmark excludes them.

Како се проверава

Метод провере: Команда љуске

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)(/|$)'
out=$(find $BH -type f \! -user root -print 2>/dev/null | { grep -Ev "$RT" || true; }) || exit 1
[ -z "$out" ] && echo compliant || { printf '%s\n' "$out" | head -n 20; echo 'files not owned by root'; }
Очекивани излаз
compliant

Како се исправља

Метод исправке: Смерница или закрпа инфраструктуре

Perform the following: ; Capture the output of the previous audit command to a file named nonroot- files.txt and review any files not owned by root to ensure the files are necessary and are not expected run-time files. Delete any unnecessary files, and ensure any run-time files are being created in the appropriate run-time directory. # find $BIND_HOME -type f \! -user root | egrep -v \ \^$DYNDIR\|\^$SLAVEDIR\|\^$DATADIR\|\^$RUNDIR\|\^$LOGDIR\|\^$TMPDIR > \ $TMPDIR/nonroot-files.txt ; The remaining non-run-time files should be changed to be owned by root, with a command like the following: \# cat $TMPDIR/nonroot-files.txt | xargs chown root \# rm $TMPDIR/nonroot-files.txt

Својства

Оперативни системи
Било који
Ознаке
binddnspermissions
Референца
CIS ISC BIND DNS Server 9.11 Benchmark v1.0.0 - 2.5 Set root Ownership of BIND Configuration Files

Проверите овај рачунар

Покрените ово на рачунару за који имате дозволу за проверу. Скенирање ради у режиму само за читање.

shell
tmaegis scan --target bind