TMAegis
Thêm quy tắc cho solaris

TMA-SOLARIS-9.8

Ensure root PATH Integrity

CaoCấp 1Tự độngsolaris

Mô tả

The root user can execute any command on the system and could be tricked into executing programs if the PATH is not set correctly. Including the current working directory (.) or any other writable directory in root's executable path makes it likely that an attacker can gain superuser access by forcing an administrator operating as root to execute a malcode, such as a Trojan horse program. Audit: root's login PATH must not contain ::, a trailing :, '.', or group/other writable directories.

Cách kiểm tra

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

shell
p=$(su - root -c 'echo $PATH' 2>/dev/null | tail -n 1); [ -n "$p" ] || exit 1; r=compliant; case "$p" in *::*) r="Empty Directory in PATH (::)";; *:) r="Trailing : in PATH";; esac; IFS=:; set -- $p; unset IFS; for d in "$@"; do [ "$d" = . ] && r="PATH contains ."; if [ -d "$d" ]; then s=$(ls -ld "$d/" | awk 'substr($1,6,1)!="-" {print "Group Write permission set on directory"} substr($1,9,1)!="-" {print "Other Write permission set on directory"}' | head -n 1); [ -z "$s" ] || r="$s $d"; 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

Correct or justify any items discovered in the Audit step.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
solarisaccounts
Tham chiếu
CIS Oracle Solaris 11.4 Benchmark v1.1.0 - 9.8 Ensure root PATH Integrity

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 solaris