TMAegisBeta
Više pravila za linux

Linux distributions

TMA-ALMA8-7.2.3

Ensure all groups in /etc/passwd exist in /etc/group

SrednjaNivo 1Automatskalinux

Opis

Over time, system administration errors and changes can lead to groups being defined in /etc/passwd but not in /etc/group .

Kako se proverava

Metod provere: Komanda ljuske

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
Očekivani izlaz
compliant

Kako se ispravlja

Metod ispravke: Smernica ili zakrpa infrastrukture

Analyze the output of the Audit step above and perform the appropriate action to correct any discrepancies found.

Svojstva

Operativni sistemi
almalinux-8
Oznake
cis-convertedlinux
Referenca
CIS AlmaLinux OS 8 Benchmark v4.0.0 - 7.2.3

Proverite ovaj računar

Pokrenite ovo na računaru za koji imate dozvolu za proveru. Skeniranje radi u režimu samo za čitanje.

shell
tmaegis scan --target linux