Ansible Role linuxfabrik.lfops.cron_permissions¶
This role restricts the system-wide cron configuration to root, as the CIS Benchmarks require for hosts on which cron is installed. It neither installs nor starts cron: LFOps schedules its own jobs with systemd timers.
Available in the next LFOps release.
How the Role Behaves¶
/etc/crontaband/etc/cron.denyget mode0600, and/etc/cron.d,/etc/cron.hourly,/etc/cron.daily,/etc/cron.weekly,/etc/cron.monthlyand/etc/cron.yearlyget mode0700, all owned byroot:root. Paths that do not exist are left alone: on a host without cron the role changes nothing, and not every platform ships every path (for example/etc/cron.yearlyon the Red Hat family,/etc/cron.denyon Debian and Ubuntu).- Unprivileged users can no longer list the system cron jobs. The cron daemon reads these paths as root, and
crontabonly reads/etc/cron.deny, as root (it is setuid root on the Red Hat family), so both keep working. - A package update may restore the modes the package ships. The next run of this role sets them again.
- The role does not manage cron jobs, and it does not create
/etc/cron.allow, so every user may still keep a personal crontab.
Tags¶
cron_permissions
- Restricts the modes of the system-wide cron configuration.
- Triggers: none.