TMAegisБета
Другие правила для linux

Linux distributions

TMA-RHEL9-7.2.5

Ensure no duplicate GIDs exist

СреднийУровень 1Автоматическаяlinux

Описание

Although the groupadd program will not let you create a duplicate Group ID (GID), it is possible for an administrator to manually edit the /etc/group file and change the GID field.

Как проверяется

Метод проверки: Команда оболочки

shell
alt0() { o=$(bash -c '#!/usr/bin/env bash

{
   while read -r l_count l_gid; do
      if [ "$l_count" -gt 1 ]; then
      echo -e "Duplicate GID: \"$l_gid\" Groups: \"$(awk -F: '"'"'($3 == n) { print $1 }'"'"' n=$l_gid /etc/group | xargs)\""
    fi
  done < <(cut -f3 -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
Ожидаемый вывод
compliant

Как исправляется

Метод исправления: Рекомендация или патч инфраструктуры

Based on the Audit Procedure output, for each GID shared by more than one group, keep the GID on the correct group and assign a new, unused GID to each of the other groups: # groupmod -g <GID> <groupname> Review any files group-owned by the previously shared GID and reassign group ownership to the correct group as appropriate.

Свойства

Операционные системы
rhel-9
Теги
cis-convertedlinux
Источник
CIS Red Hat Enterprise Linux 9 Benchmark v3.0.0 - 7.2.5

Проверить этот хост

Выполните команду на компьютере, аудит которого вам разрешён. Сканирование работает только на чтение.

shell
tmaegis scan --target linux