TMAegisBeta
Más reglas para linux

Linux distributions

TMA-ALINUX2-5.1.8

Ensure at/cron is restricted to authorized users

MediaNivel 1Automatizadalinux

Descripción

Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs.

Cómo se verifica

Método de auditoría: Comando de shell

shell
alt0() { command -v stat >/dev/null 2>&1 || { echo "step1: stat not installed"; return 1; }; o=$(bash -c 'stat /etc/cron.deny' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'stat: cannot stat `/etc/cron.deny'"'"': No such file or directory' || { echo step1: missing 'stat: cannot stat `/etc/cron.deny'"'"': No such file or director'; return 1; }; command -v stat >/dev/null 2>&1 || { echo "step2: stat not installed"; return 1; }; o=$(bash -c 'stat /etc/at.deny' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'stat: cannot stat` /etc/at.deny'"'"': No such file or directory' || { echo step2: missing 'stat: cannot stat` /etc/at.deny'"'"': No such file or directory'; return 1; }; command -v stat >/dev/null 2>&1 || { echo "step3: stat not installed"; return 1; }; o=$(bash -c 'stat /etc/cron.allow' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)' || { echo step3: missing 'Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)'; return 1; }; command -v stat >/dev/null 2>&1 || { echo "step4: stat not installed"; return 1; }; o=$(bash -c 'stat /etc/at.allow' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)' || { echo step4: missing 'Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)'; return 1; }; }; if alt0; then echo compliant; fi
Salida esperada
compliant

Cómo se corrige

Método de corrección: Guía o parche de infraestructura

Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow : # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod 600 /etc/cron.allow # chmod 600 /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow

Propiedades

Sistemas operativos
alinux-2
Etiquetas
cis-convertedlinux
Referencia
CIS Aliyun Linux 2 Benchmark v1.0.0 ARCHIVE - 5.1.8

Verificar este host

Ejecute esto en un equipo que tenga permiso para auditar. El escaneo es de solo lectura.

shell
tmaegis scan --target linux