Linux distributions
TMA-ALMA9-7.2.4
Ensure no duplicate UIDs exist
보통레벨 1자동linux
설명
Although the useradd program will not let you create a duplicate User ID (UID), it is possible for an administrator to manually edit the /etc/passwd file and change the UID field.
점검 방법
감사 방식: 셸 명령
shell
alt0() { o=$(bash -c '#!/usr/bin/env bash
{
while read -r l_count l_uid; do
if [ "$l_count" -gt 1 ]; then
echo -e "Duplicate UID: \"$l_uid\" Users: \"$(awk -F: '"'"'($3 == n) { print $1 }'"'"' n=$l_uid /etc/passwd | xargs)\""
fi
done < <(cut -f3 -d":" /etc/passwd | sort -n | uniq -c)
}' 2>&1); [ -z "$o" ] || { echo "step1: $o" | head -c 300; return 1; }; }; if alt0; then echo compliant; fi- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
Based on the Audit Procedure output, for each UID shared by more than one account, keep the UID on the correct account and assign a new, unused UID to each of the other accounts: # usermod -u <UID> <username> usermod reassigns ownership of files in the account's home directory automatically. Review any other files owned by the previously shared UID and reassign ownership to the correct account as appropriate.
속성
- 운영 체제
- almalinux-9
- 태그
- cis-convertedlinux
- 참고 자료
- CIS AlmaLinux OS 9 Benchmark v3.0.0 - 7.2.4
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target linux