TMAegis
aix için daha fazla kural

TMA-AIX-6.1.3

Ensure sudo commands use pty

YüksekDüzey 2Otomatikaix

Açıklama

sudo can be configured to run only from a pseudo terminal (pseudo-pty) Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing. Audit: automated read-only check derived from the CIS audit procedure; it prints "compliant" when the control is met.

Nasıl denetlenir

Denetim yöntemi: Kabuk komutu

shell
c=$(cat /etc/sudoers /etc/sudoers.d/* 2>/dev/null); [ -n "$c" ] || exit 1; printf '%s\n' "$c" | grep -Eiq "^[[:blank:]]*Defaults[[:blank:]]+([^#]+,[[:blank:]]*)?!use_pty" && { echo "!use_pty set"; exit 0; }; printf '%s\n' "$c" | grep -Eiq "^[[:blank:]]*Defaults[[:blank:]]+([^#]+,[[:blank:]]*)?use_pty([[:blank:]]*,|[[:blank:]]*$|[[:blank:]]+#)" && echo compliant || echo "Defaults use_pty not set"
Beklenen çıktı
compliant

Nasıl düzeltilir

Düzeltme yöntemi: Kılavuz veya altyapı yaması

Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with /usr/sbin/visudo -f <PATH TO FILE> and add the following line: Defaults use_pty Edit the file /etc/sudoers with visudo and any files in /etc/sudoers.d/ with /usr/sbin/visudo -f <PATH TO FILE> and and remove any occurrence of !use_pty

Özellikler

İşletim sistemleri
Herhangi biri
Etiketler
aixhardening
Referans
CIS IBM AIX 7 Benchmark v1.2.0 - 6.1.3 Ensure sudo commands use pty

Bu ana makineyi denetle

Bunu denetleme izniniz olan bir makinede çalıştırın. Tarama salt okunurdur.

shell
tmaegis scan --target aix --level 2