6.1.1 Audit system file permissions

Information

The RPM package manager has a number of useful options. One of these, the --verify (or -V) option, can be used to verify that system packages are correctly installed. The --verify option can be used to verify a particular package or to verify all system packages. If no output is returned, the package is installed correctly. The following table describes the meaning of output from the verify option:

Code Meaning

S File size differs.

M File mode differs (includes permissions and file type).

5 The MD5 checksum differs.

D The major and minor version numbers differ on a device file.

L A mismatch occurs in a link.

U The file ownership differs.

G The file group owner differs.

T The file time (mtime) differs.

The rpm -qf command can be used to determine which package a particular file belongs to. For example, the following commands determines which package the /bin/bash file belongs to:

# rpm -qf /bin/bash

bash-4.1.2-29.el6.x86_64

To verify the settings for the package that controls the /bin/bash file, run the following:

# rpm -V bash-4.1.2-29.el6.x86_64

.M....... /bin/bash

Note that you can feed the output of the rpm -qf command to the rpm -V command:

# rpm -V 'rpm -qf /etc/passwd'

.M...... c /etc/passwd

S.5....T c /etc/printcap

Rationale:

It is important to confirm that packaged system files and directories are maintained with the permissions they were intended to have from the OS vendor.

NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance.

Solution

Correct any discrepancies found and rerun the audit until output is clean or risk is mitigated or accepted.

See Also

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

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: 9a5e2f5392bd07ee538c044ee1ad4331ccfe4d5241b2cc52634db15a2180960d