Container-Optimized OS
TMA-COS-6.2.15
Ensure all groups in /etc/passwd exist in /etc/group
보통레벨 2자동cos
설명
Over time, system administration errors and changes can lead to groups being defined in /etc/passwd but not in /etc/group . Groups defined in the /etc/passwd file but not in the /etc/group file pose a threat to system security since group permissions are not properly managed.
점검 방법
감사 방식: 셸 명령
shell
alt0() { o=$(bash -c '#!/usr/bin/env bash
{
a_passwd_group_gid=("$(awk -F: '"'"'{print $4}'"'"' /etc/passwd | sort -u)")
a_group_gid=("$(awk -F: '"'"'{print $3}'"'"' /etc/group | sort -u)")
a_passwd_group_diff=("$(printf '"'"'%s\n'"'"' "${a_group_gid[@]}" "${a_passwd_group_gid[@]}" | sort | uniq -u)")
while IFS= read -r l_gid; do
awk -F: '"'"'($4 == '"'"'"$l_gid"'"'"') {print " - User: \"" $1 "\" has GID: \"" $4 "\" which does not exist in /etc/group" }'"'"' /etc/passwd
done < <(printf '"'"'%s\n'"'"' "${a_passwd_group_gid[@]}" "${a_passwd_group_diff[@]}" | sort | uniq -D | uniq)
unset a_passwd_group_gid; unset a_group_gid; unset a_passwd_group_diff
}' 2>&1); [ -z "$o" ] || { echo "step1: $o" | head -c 300; return 1; }; }; if alt0; then echo compliant; fi- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
Analyze the output of the Audit step above and perform the appropriate action to correct any discrepancies found.
속성
- 운영 체제
- 모두
- 태그
- container-optimized-oscos
- 참고 자료
- CIS Google Container-Optimized OS Benchmark v1.2.0 - 6.2.15 Ensure all groups in /etc/passwd exist in /etc/group
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target cos --level 2