1.1.2.6.1 Ensure separate partition exists for /var/log

Information

The /var/log directory is used by system services to store log data.

The default installation only creates a single / partition. Since the /var/log directory contains log files which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole.

Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev . These options limit an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options.

As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point.

/var/log stores system logs that must persist for operational and audit purposes, so it must reside on persistent (non-volatile) storage.

Solution

Configure /var/log as a separate mount on persistent (non-volatile) storage.

New installations: During installation, create a custom partitioning layout and assign a separate partition or logical volume to /var/log.

Existing systems: Create a new filesystem for /var/log and add it to the mount table. For example, using LVM (adjust the volume group, size, and device to suit the host):

# lvcreate -L <size> -n var_log <vg_name>
# mkfs.ext4 /dev/<vg_name>/var_log

Add the mount to /etc/fstab :

/dev/<vg_name>/var_log /var/log ext4 defaults,nodev,nosuid,noexec 0 0

Migrate the existing contents into the new filesystem and activate the mount using the repartitioning steps in the section overview, then run mount /var/log (or reboot).

Impact:

Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations.

See Also

https://workbench.cisecurity.org/benchmarks/27893

Item Details

Category: AUDIT AND ACCOUNTABILITY, CONFIGURATION MANAGEMENT

References: 800-53|AU-4, 800-53|CM-6b., 800-53|CM-7, CSCv7|6.4

Plugin: Unix

Control ID: 6ab04565ea377b5e2b5912585119baa8257a9641fd715f2b485220a524f918b3