TMAegisBeta
Thêm quy tắc cho azure-container-linux

Azure Container Linux

TMA-AZURE-CONTAINER-LINUX-5.3.2

Ensure sudo authentication timeout is configured correctly

CaoCấp 1Tự độngazure-container-linux

Mô tả

sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies. Audit: Passes when every timestamp_timeout in /etc/sudoers and /etc/sudoers.d is between 0 and 15 minutes; with none set the sudo default of 5 minutes applies.

Cách kiểm tra

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

shell
bad=0; for v in $(grep -rhoP "timestamp_timeout=\K-?[0-9.]*" /etc/sudoers /etc/sudoers.d 2>/dev/null); do case $v in -*|"") bad=1;; *) [ "${v%.*}" -le 15 ] 2>/dev/null || bad=1;; esac; done; [ $bad -eq 0 ] && echo compliant || echo noncompliant
Đầ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

If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f <PATH TO FILE> and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on its own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
azure-container-linuxsudo
Tham chiếu
CIS Azure Container Linux Benchmark v1.0.0 - 5.3.2 Ensure sudo authentication timeout is configured correctly

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 azure-container-linux