1.1.5 Ensure noexec option set on /tmp partition

Information

The noexec mount option specifies that the filesystem cannot contain executable binaries.

Rationale:

Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp .

Solution

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

[Mount]
Options=mode=1777,strictatime,noexec,nodev,nosuid

Run the following command to remount /tmp :

# mount -o remount,noexec /tmp

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, SYSTEM AND INFORMATION INTEGRITY

References: 800-53|CM-11, 800-53|SI-3, CSCv7|2.6, CSCv7|8

Plugin: Unix

Control ID: 6a4d3f1072bf171da7c32ee29ec899a685f9c0faf8b3612af6251aaeeb29032d