TMAegisBeta
Thêm quy tắc cho freebsd

FreeBSD

TMA-FREEBSD-4.1.2.1

Ensure at is restricted to authorized users

CaoCấp 1Tự độngfreebsd

Mô tả

The at utility allows some moderately complex time specifications. It accepts times of the form HHMM or HH:MM to run a job at a specific time of day. On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. Audit: /var/at/at.allow must exist with mode 640 or stricter, owner root or daemon, group wheel; at.deny must be absent or equally restricted.

Cách kiểm tra

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

shell
r=compliant; for f in /var/at/at.allow; do if [ -e "$f" ]; then set -- $(ls -ld "$f"); s=$(printf '%s %s %s\n' "$1" "$3" "$4" | awk -v m='rw-r-----' -v o='root|daemon' -v g='wheel' '{ok=1; for(i=1;i<=9;i++) if(substr(m,i,1)=="-" && substr($1,i+1,1)!="-") ok=0; if(o!="" && $2 !~ ("^(" o ")$")) ok=0; if(g!="" && $3 !~ ("^(" g ")$")) ok=0; print (ok ? "ok" : $0)}'); [ "$s" = ok ] || r="$f: $s"; else r="$f: missing"; fi; done; for f in /var/at/at.deny; do if [ -e "$f" ]; then set -- $(ls -ld "$f"); s=$(printf '%s %s %s\n' "$1" "$3" "$4" | awk -v m='rw-r-----' -v o='root|daemon' -v g='wheel' '{ok=1; for(i=1;i<=9;i++) if(substr(m,i,1)=="-" && substr($1,i+1,1)!="-") ok=0; if(o!="" && $2 !~ ("^(" o ")$")) ok=0; if(g!="" && $3 !~ ("^(" g ")$")) ok=0; print (ok ? "ok" : $0)}'); [ "$s" = ok ] || r="$f: $s"; else :; fi; done; echo "$r"
Đầ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

Run the following script to: /var/at/at.allow: o Create the file if it doesn't exist o Change owner or user root or daemon o Change group to wheel o Change mode to 640 or more restrictive -IF- /var/at/at.deny exists: o Change owner or user root o Change group to wheel o Change mode to 640 or more restrictive #!/bin/sh { [ ! -e "/var/at/at.allow" ] && touch /var/at/at.allow chown root:wheel /var/at/at.allow chmod u-x,g-wx,o-rwx /var/at/at.allow [ -e "/var/at/at.deny" ] && chown root:wheel /var/at/at.deny [ -e "/var/at/at.deny" ] && chmod u-x,g-wx,o-rwx /var/at/at.deny }

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
freebsdaccounts
Tham chiếu
CIS FreeBSD 14 Benchmark v1.0.1 - 4.1.2.1 Ensure at is restricted to authorized users

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 freebsd