NAME

Monitoring::Sneck::Checks::file_mode - checks the mode, owner, and group of files

VERSION

Version 0.0.1

SYNOPSIS

!shadow_mode|control=CIS-6.1.3 framework=CIS|perl:file_mode -f /etc/shadow -M 0640 -o root
!ssh_keys||perl:file_mode -f /etc/ssh/ssh_host_ed25519_key -f /etc/ssh/ssh_host_rsa_key -m 0600 -o root -g 0
!tmp_sticky||perl:file_mode -f /tmp -m 1777

DESCRIPTION

Checks each file is as given. Any that is not, or is not there, is CRITICAL, unless --ignore-missing is given. Symlinks are followed.

--mode needs the mode to be exactly that, while --max-mode allows less, so 0640 allows 0600 and 0400 but not 0644.

OPTIONS

- -f, --file :: A file. May be given more than once. Required.

- -m, --mode :: The mode it must have, in octal, such as 0600.

- -M, --max-mode :: The most it may have, in octal, such as 0640.

- -o, --owner :: The user that must own it, by name or UID.

- -g, --group :: The group that must own it, by name or GID.

- -i, --ignore-missing :: Files not there are OK.

One or more of --mode, --max-mode, --owner, or --group must be given.

METHODS

check

Does the check.