Linux distributions
TMA-RHEL9-7.2.7
Ensure no duplicate group names exist
Trung bìnhCấp 1Tự độnglinux
Mô tả
Although the groupadd program will not let you create a duplicate group name, it is possible for an administrator to manually edit the /etc/group file and change the group name.
Cách kiểm tra
Phương pháp kiểm tra: Lệnh shell
shell
alt0() { o=$(bash -c '#!/usr/bin/env bash
{
while read -r l_count l_group; do
if [ "$l_count" -gt 1 ]; then
echo -e "Duplicate Group: \"$l_group\" Groups: \"$(awk -F: '"'"'($1 == n) { print $1 }'"'"' n=$l_group /etc/group | xargs)\""
fi
done < <(cut -f1 -d":" /etc/group | sort -n | uniq -c)
}' 2>&1); [ -z "$o" ] || { echo "step1: $o" | head -c 300; return 1; }; }; if alt0; then echo compliant; fi- Đầ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
Based on the Audit Procedure output, for each duplicated group name, determine which entry is correct and make each group name unique. Use vigr to safely edit the group database and either remove the redundant entry or rename it to a unique group name: # vigr File group ownerships will reflect the change automatically as long as each group has a unique GID.
Thuộc tính
- Hệ điều hành
- rhel-9
- Thẻ
- cis-convertedlinux
- Tham chiếu
- CIS Red Hat Enterprise Linux 9 Benchmark v3.0.0 - 7.2.7
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 linux