1.6.9 Ensure access to pam_motd file is configured

Information

pam_motd is a PAM module that can be used to display arbitrary motd (message of the day) files after a successful login. By default, pam_motd shows files in the following locations:

/etc/motd
/run/motd
/usr/lib/motd
/etc/motd.d/
/run/motd.d/
/usr/lib/motd.d/

If the pam_motd file does not have the correct access configured, it could be modified by unauthorized users with incorrect or misleading information.

Solution

Run the following commands to set mode, owner, and group to the pam_motd file:

# chown root:root </path/to/motd/>
# chmod u-x,go-wx </path/to/motd/>

Note: The audit procedure command grep -hPo 'motd=\K\S+' /etc/pam.d/* output will provide the path to the pam_motd file.

Example

# chown root:root /run/motd.dynamic
# chmod u-x,go-wx /run/motd.dynamic

See Also

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

Item Details

Category: ACCESS CONTROL, MEDIA PROTECTION

References: 800-53|AC-3, 800-53|AC-5, 800-53|AC-6, 800-53|MP-2, CSCv7|14.6

Plugin: Unix

Control ID: bbe62d758d441e4849d50226a7684c10e78398902781cdad53a5525d7ffdcdc7