Add grpquota Option to /home
An XCCDF Rule
Description
The grpquota
mount option allows for the filesystem to have disk quotas configured.
Add the grpquota
option to the fourth column of
/etc/fstab
for the line which controls mounting of
/home
.
warning alert: Warning
The quota options for XFS file systems can only be activated when mounting the partition.
It is not possible to enable them by remounting an already mounted partition. Therefore,
if the desired options were not defined before mounting the partition, dismount and mount
it again to apply the quota options.
Rationale
To ensure the availability of disk space on /home, it is important to limit the impact a single user or group can cause for other users (or the wider system) by intentionally or accidentally filling up the partition. Quotas can also be applied to inodes for filesystems where inode exhaustion is a concern.
- ID
- xccdf_org.ssgproject.content_rule_mount_option_home_grpquota
- Severity
- Medium
- References
- Updated
Remediation - Ansible
- name: 'Add grpquota Option to /home: Check information associated to mountpoint'
command: findmnt --fstab '/home'
register: device_name
failed_when: device_name.rc > 1
changed_when: false
when: ( ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman",
Remediation - Anaconda Pre-Install Instructions
part /home --mountoptions="grpquota"
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if ( [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && findmnt --kernel "/home" > /dev/null || findmnt --fstab "/home" > /dev/null ); then
function perform_remediation {
# the mount point /home has to be defined in /etc/fstab