1.1.3 Ensure nodev option set on /tmp partition

Information

The nodev mount option specifies that the filesystem cannot contain special devices.

Rationale:

Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp.

Solution

Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount:

[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,noexec,nodev,nosuid

Run the following commands to enable systemd /tmp mounting:

systemctl unmask tmp.mount
systemctl enable tmp.mount

Notes:

systemd includes the tmp.mount service which should be used instead of configuring /etc/fstab. Mounting options are configured in the Options setting in /etc/systemd/system/local-fs.target.wants/tmp.mount.

See Also

https://workbench.cisecurity.org/files/2619

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6, CSCv7|5.1

Plugin: Unix

Control ID: b71a34cf138e7a92621b1fca23345d8033727820cb7eed24384f5154f3b39549