TMAegisBeta
More rules for freebsd

FreeBSD

TMA-FREEBSD-6.2.10

Ensure local interactive user home directories are configured

MediumLevel 1Automatedfreebsd

Description

The user home directory is space defined for the particular user to set local environment variables and to store personal files. While the system administrator can establish secure permissions for users' home directories, the users can easily override these. Users can be defined in /etc/passwd without a home directory or with a home directory that does not actually exist. Audit: interactive users (uid >= 1000 with a login shell) must have an existing home they own that is mode 755 or stricter.

How it is checked

Audit method: Shell command

shell
command -v awk >/dev/null 2>&1 || exit 1; out=$( { awk -F: '$3>=1000 && $1!="nobody" && $7!~/(nologin|false)$/ {print $1, $6}' /etc/passwd | while read u h; do if [ ! -d "$h" ]; then echo "$u: home $h does not exist"; continue; fi; ls -ld "$h/" | awk -v u="$u" '$3!=u {print u ": home not owned by user"} substr($1,6,1)=="w" || substr($1,9,1)=="w" {print u ": home is group/other writable"}'; done ; } 2>/dev/null ); [ -z "$out" ] && echo compliant || printf '%s\n' "$out" | head -n 20
Expected output
compliant

How it is fixed

Fix method: Guidance or infrastructure patch

If a local interactive users' home directory is undefined and/or doesn't exist, follow local site policy and perform one of the following: Lock the user account Remove the user from the system Create a directory for the user. If undefined, edit /etc/passwd and add the absolute path to the directory to the last field of the user.

Properties

Operating systems
Any
Tags
freebsdaccounts
Reference
CIS FreeBSD 14 Benchmark v1.0.1 - 6.2.10 Ensure local interactive user home directories are configured

Check this host

Run this on a machine you are allowed to audit. The scan is read-only.

shell
tmaegis scan --target freebsd