FILE_CHECK

Unix compliance audits typically test for the existence and settings of a given file. The “FILE_CHECK” audit uses four or more keywords to allow the specification of these checks. The keywords type, description, and file are mandatory and are followed by one or more checks. Current syntax supports checking for owner, group and file permissions.

It is possible to use globs in FILE_CHECK (e.g., /var/log/*). However, note that globs will only be expanded to files, not to directories. If a glob is specified and one or more matched files must be ignored from the search, use the “ignore” keyword to specify the files to ignore.

The allowed keywords are:

Multiple group ownership options (e.g., root or wheel) can be specified by using the || operator with the group keyword.

Example:

group: “root” || “wheel”

File permissions are considered uneven if the “group” or “other” have additional permissions than “owner” or if “other” has additional permissions than “group”.

Tip: For information about the parameters commonly found in Unix custom items, see Unix Configuration Keywords.

Examples:

<custom_item>

system: "Linux"

type: FILE_CHECK

description: "Permission and ownership check for /etc/default/cron"

file: "/etc/default/cron"

owner: "bin"

group: "bin"

mode: "-r--r--r--"

</custom_item>

<custom_item>

system: "Linux"

type: FILE_CHECK

description: "Permission and ownership check for /etc/default/cron"

file: "/etc/default/cron"

owner: "bin"

group: "bin"

mode: "444"

</custom_item>

<custom_item>

system: "Linux"

type: FILE_CHECK

description: "Make sure /tmp has its sticky bit set"

file: "/tmp"

mode: "1000"

</custom_item>

<custom_item>

type: FILE_CHECK

description: "/etc/passwd has the proper md5 set"

required: YES

file: "/etc/passwd"

md5: "ce35dc081fd848763cab2cfd442f8c22"

</custom_item>

<custom_item>

type: FILE_CHECK

description: "Ignore maillog in the file mode check"

required: YES

file: "/var/log/m*"

mode: "1000"

ignore: "/var/log/maillog"

</custom_item>

<custom_item>

system: "Linux"

type: FILE_CHECK

description: "Check /etc/crontab group ownership (root or wheel)"

file: "/etc/crontab"

owner: "root"

group: "root" || "wheel"

mode: "600"

</custom_item>