TMAegis
Thêm quy tắc cho bind

BIND DNS

TMA-BIND-QUERYLOG

Ensure DNS query logging is enabled

ThấpCấp 2Tự độngbind

Mô tả

Query logs support incident response (malware C2 lookups, data exfiltration over DNS). They are verbose, so this is a level 2 control. The audit parses named-checkconf -p output (/etc/bind/named.conf or /etc/named.conf) and passes when "querylog yes;" is set in options or the logging block routes the queries category to a channel.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
conf=/etc/bind/named.conf; [ -f "$conf" ] || conf=/etc/named.conf
out=$(named-checkconf -p "$conf" 2>/dev/null) || exit 1
flat=$(printf '%s\n' "$out" | tr '\t\n' '  ')
printf '%s\n' "$flat" | grep -Eq '[{; ](querylog yes;|category "?queries"? \{)' && echo compliant
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

Add to the logging block: channel query_log { file "/var/log/named/query.log" versions 5 size 50m; print-time yes; }; category queries { query_log; }; (or "querylog yes;" in options). Run named-checkconf, then rndc reconfig.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
binddnslogging
Tham chiếu
CIS BIND DNS Server Benchmark - Logging / query logging (verify section number for your release)

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target bind --level 2