Ubuntu · Filesystem & permissions

Put /home, /var, /var/tmp, /var/log and /var/log/audit on separate filesystems

When it fails: User data, variable data and logs share the root filesystem. A user or a service that fills one of these directories fills the whole system, and they cannot get their own mount options.

CB-UBU-FS-005lowactiveautomatedprofile server-hardenedprofile desktop-hardened

As released in v0.1.1 (beta). Current state.

Description

Each directory of {{ separate_mounts }} is the mount point of its own filesystem (partition, LVM logical volume, or bind mount of a dedicated volume), instead of a plain directory of the root filesystem.

Ubuntu cloud images have a single root partition (plus /boot from 24.04), so this control fails there by design. The guided layouts of the Ubuntu installers put everything in one root filesystem or one LVM logical volume: choose "Custom storage layout" in the server installer, or describe the volumes in the storage section of an autoinstall file, and keep free space in the LVM volume group to grow them later.

Rationale

Separate filesystems contain disk exhaustion: logs or user files that grow without bound stop at their own volume, and the system keeps running and logging. They are also the only way to give these trees restrictive mount options (nodev, nosuid, noexec, see CB-UBU-FS-006), and they keep audit logs available when other data fills up.

Impact

Partitioning is chosen at installation. Changing it later means adding disks or shrinking volumes, moving data and editing /etc/fstab, with downtime. Volumes that are too small fill up sooner: size them from the expected log and data volumes, and prefer LVM to resize later.

Setting

Location/etc/fstab
DefaultSingle root filesystem
RecommendedSeparate filesystems for: {{ separate_mounts }}

Parameters

ParameterCoreServerServer hardenedDesktopDesktop hardenedBounds
separate_mountslist. Directories that must be mount points of their own filesystem./home, /var, /var/tmp, /var/log, /var/log/audit/home, /var, /var/tmp, /var/log, /var/log/audit/home, /var, /var/tmp, /var/log, /var/log/audit/home, /var, /var/tmp, /var/log, /var/log/audit/home, /var, /var/tmp, /var/log, /var/log/audit

The value used is your override (tailoring file), else the profile's, else the one of the profile it extends, else the default. Bounds limit what an override may set.

Audit

For each directory of {{ separate_mounts }}, run findmnt -kn <directory>. It must print a line.

Automated: every check must pass. Scanners report each check by its id.

mounts

Each listed directory is a mount point.

script: |
  rc=0
  for p in $CB_SEPARATE_MOUNTS; do
    o=$(findmnt -kn -o SOURCE,FSTYPE --mountpoint "$p" | tail -n 1)
    if [ -n "$o" ]; then echo "$p: $o"; else echo "$p: not a separate filesystem"; rc=1; fi
  done
  exit $rc

Remediation

At installation, create a partition or LVM logical volume for each directory of {{ separate_mounts }}.

On an installed system, for each missing one:

  1. Create the volume and its filesystem (for example lvcreate then mkfs.ext4).
  2. In single-user mode or with the services that write there stopped, mount it on a temporary directory and copy the data with cp -a (or rsync -aHAX), keeping owners and modes.
  3. Add the line to /etc/fstab with the options of CB-UBU-FS-006, mount it on the target directory, check, and remove the old copy hidden under the mount point.
  4. Reboot and check that every service starts.

References

Mappings

FrameworkIDRelationNote
ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0R28partialR28 also lists /boot, /opt, /srv and /usr; ours requires the five partitions CIS asks for.
NIST SP 800-53 Rev. 55.1.1SC-5(2)related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

  • related CB-UBU-FS-006 Mount separate filesystems with nodev, nosuid and noexec where they are not needed
  • related CB-UBU-FS-003 Mount /tmp as a separate filesystem with nodev, nosuid and noexec

People and lifecycle

Authors
Verified2026-10-19 by Sn0wAlice on 20.04, Proxmox VM 2520, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic. Fails on the single-partition cloud image; a loop-mounted /var/tmp is reported as separate.
Verified2026-10-19 by Sn0wAlice on 22.04, Proxmox VM 2522, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic. Fails on the single-partition cloud image; a loop-mounted /var/tmp is reported as separate.
Verified2026-10-19 by Sn0wAlice on 24.04, Proxmox VM 2524, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic. Fails on the single-partition cloud image; a loop-mounted /var/tmp is reported as separate.
Verified2026-10-19 by Sn0wAlice on 26.04, Proxmox VM 2526, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic. Fails on the single-partition cloud image; a loop-mounted /var/tmp is reported as separate.
Introduced inv0.1.0
Created, updated2026-10-19, 2026-10-19
Translationsfr