TMAegis
Weitere Regeln für freebsd

TMA-FREEBSD-4.5.2.2

Ensure root user umask is configured

HochStufe 1Automatisiertfreebsd

Beschreibung

The user file-creation mode mask (umask) is used to determine the file permission for newly created directories and files. In FreeBSD, the default permissions for any newly created directory is 0755 (rwxr-xr-x), and for any newly created file it is 0644 (rw-r-- r--). The umask modifies the default FreeBSD permissions by restricting (masking) these permissions. Audit: automated read-only check derived from the CIS audit procedure; it prints "compliant" when the control is met.

So wird geprüft

Prüfmethode: Shell-Befehl

shell
command -v grep >/dev/null 2>&1 || exit 1; out=$( { grep -Esi -- "^[[:space:]]*umask[[:space:]]+(([0-7][0-7][01][0-7]\b|[0-7][0-7][0-7][0-6]\b)|([0-7][01][0-7]\b|[0-7][0-7][0-6]\b)|(u=[rwx]{1,3},)?(((g=[rx]?[rx]?w[rx]?[rx]?\b)(,o=[rwx]{1,3})?)|((g=[wrx]{1,3},)?o=[wrx]{1,3}\b)))" /root/.profile /root/.shrc ; } 2>/dev/null ); [ -z "$out" ] && echo compliant || printf '%s\n' "$out" | head -n 20
Erwartete Ausgabe
compliant

So wird behoben

Behebungsmethode: Anleitung oder Infrastruktur-Patch

Edit /root/.profile and /root/.shrc and remove, comment out, or update any line with umask to be 0027 or more restrictive.

Eigenschaften

Betriebssysteme
Beliebig
Tags
freebsdaccounts
Referenz
CIS FreeBSD 14 Benchmark v1.0.1 - 4.5.2.2 Ensure root user umask is configured

Diesen Host prüfen

Führen Sie dies auf einem Rechner aus, den Sie prüfen dürfen. Der Scan ist schreibgeschützt.

shell
tmaegis scan --target freebsd