← All rules
SOCLE-CLD-MNT-010// Mountsmediumeffective runtime

Add nosuid Option to /home

Mounts the /home partition with the nosuid option so setuid/setgid bits on files in user directories are ignored.

Checked against the resolved running state (e.g. sshd -T, sysctl, systemctl show), catches drop-ins and Includes a file read would miss. Caveat: runtime ≠ persistence; a value correct now may not survive a reboot.

A pass proves✓ running now✓ on disk✓ survives rebootthe qualified verdict →
Debian 12CIS 1.1.0Debian 13CIS 1.0.0FedoraRHEL 10 / Rocky 10 / AlmaLinux 10RHEL 8 / Rocky 8 / AlmaLinux 8CIS 4.0.0RHEL 9 / Rocky 9 / AlmaLinux 9CIS 2.0.0Ubuntu 22.04CIS 3.0.0Ubuntu 24.04CIS 1.0.0Ubuntu 26.04
One check, maps to 3 standards

Pavois asserts the effective configuration, the live, resolved state, not a file. File-based scanners (OVAL/SCAP, Lynis) miss Includes, drop-ins and runtime defaults; this check sees what is actually applied.

A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.

Why this rule matters

The presence of SUID and SGID executables must be tightly controlled. /home is user-writable space where setuid/setgid binaries have no legitimate purpose. Mounting /home with nosuid makes the kernel ignore those bits, so a user (or an attacker on their account) cannot place a SUID-root binary in a home directory to escalate privileges.

What Pavois checks

Pavois reads the effective mount via mount('/home') and asserts the resolved options include nosuid. The live mount table reflects the kernel's actual state, including options from systemd mount units or a remount, which a static read of /etc/fstab could misrepresent. If /home is not a separate mount point, there is no dedicated partition to harden.

describe mount('/home') do
  its('options') { should include 'nosuid' }
end
describe command("{ findmnt --fstab -no OPTIONS /home 2>/dev/null; grep -hsE '[[:space:]]/home[[:space:]]' /etc/fstab 2>/dev/null; systemctl show -p Options -- $(systemd-escape -p --suffix=mount /home 2>/dev/null) 2>/dev/null; } | grep -ow 'nosuid'") do
  its('stdout') { should match(/\S/) }
end

How to verify it is applied

Run findmnt /home (or findmnt -no OPTIONS /home) and confirm nosuid is present, e.g. rw,nosuid,nodev,relatime.

Inspect & investigate

Use findmnt /home to inspect the active options. A SUID binary run from a nosuid mount executes without elevated privileges; auditd EXECVE/SYSCALL records in /var/log/audit/audit.log can corroborate execution attempts.

Remediation

This rule has no automated harden plan: apply it manually. Add nosuid to the /home line in /etc/fstab (e.g. defaults,nodev,nosuid), then mount -o remount /home and verify with findmnt /home.

Pavois applies this with its own harden engine, the plan below, not a shell script:

commandawk -v m=/home -v o=nosuid '$0!~/^[[:space:]]*#/&&$2==m{n=split($4,a,",");h=0;for(i=1;i<=n;i++)if(a[i]==o)h=1;if(!h)$4=$4","o}{print}' /etc/fstab >/etc/.fstab.pav && cat /etc/.fstab.pav >/etc/fstab && rm -f /etc/.fstab.pav; mountpoint -q /home && mount -o remount,nosuid /home || true
namemount-home-nosuid
not_ifawk -v m=/home '$2==m&&$0!~/^[[:space:]]*#/{print $4}' /etc/fstab | tr , '\n' | grep -qx nosuid
resourceexec
pavois harden plan local

where the target is local, a user@host SSH alias, or a container , Docs

Impact & precautions

Without nosuid, a SUID-root binary placed in a home directory could be used for privilege escalation. Applying nosuid is low risk: legitimate user data does not rely on setuid files. Precautions: the remount is generally non-disruptive; if /home is not a separate partition, never apply nosuid to /, the root filesystem hosts essential SUID binaries (sudo, su, passwd) and would break authentication. Combine with nodev (and, where suitable, noexec) for full hardening.

Standards mapping

StandardReferenceTypeVersionConfidence
ANSSI BP-028R28direct2.0high
CIS1.1.2.3.3directper OS, see the benchmark tablehigh
NISTAC-6, AC-6(1), CM-6(a), CM-7(a), CM-7(b), MP-7supporting800-53 Rev 5 · 800-171 Rev 2 (pinned)medium

Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.

Sources & references