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

TMA-BIND-2.7

Set Group Read-Only for BIND Files and Non-Runtime Directories

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

Опис

All of the BIND files and all of directories except the run-time directories into which BIND will create files should have group permissions set to not be writable. Any run-time files created by BIND will be owned by BIND, and therefore need not be group writable. The audit lists group-writable directories (outside runtime directories) and group-writable files under $BIND_HOME 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 d -perm /020 -print 2>/dev/null | { grep -Ev "$RT" || true; }; find $BH -type f -perm /020 -print 2>/dev/null | { grep -Ev "$RT" || true; }; }) || exit 1
[ -z "$out" ] && echo compliant || { printf '%s\n' "$out" | head -n 20; echo 'group-writable BIND files or directories'; }
Очекивани излаз
compliant

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

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

Perform the following: ; Capture the output from the audit commands above into a file named write- dirs.txt ; Review the purpose for the identified directories and either delete them if the directory is not needed, or change the permissions of the directory to not be writable by group or other. ; The following command can be used to change the permissions of the directories that are appropriate. xargs -a write-dirs.txt chmod g-w

Својства

Оперативни системи
Било који
Ознаке
binddnspermissions
Референца
CIS ISC BIND DNS Server 9.11 Benchmark v1.0.0 - 2.7 Set Group Read-Only for BIND Files and Non-Runtime Directories

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

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

shell
tmaegis scan --target bind