Description
The system cron jobs live in /etc/crontab, /etc/cron.d/ and the /etc/cron.hourly,
cron.daily, cron.weekly, cron.monthly and cron.yearly directories. They must belong to
root:root, with mode 0600 for the file and 0700 for the directories, or stricter.
Ubuntu ships these paths with mode 0644 and 0755, so the control fails on a fresh install
of cron. A missing directory (/etc/cron.yearly is not created by every version) makes its
check not applicable.
Rationale
These jobs run as root. Reading them tells an attacker which scripts to target and when they run; a writable job or directory is a direct path to root.
Impact
Users can no longer list the system cron jobs. cron runs as root and is not affected.
Applies when
Detected: when: cron is installed A scanner reports the control not applicable when one is false.
Setting
| Location | /etc/crontab, /etc/cron.d, /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly, /etc/cron.yearly |
| Default | root:root, 0644 (file) and 0755 (directories) |
| Recommended | root:root, 0600 (file) and 0700 (directories) or stricter |
Audit
Run stat -Lc '%n %U:%G %a' /etc/crontab /etc/cron.d /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly /etc/cron.yearly. Each must be root:root, with mode
600 for /etc/crontab and 700 for the directories, or stricter.
Automated: every check must pass. Scanners report each check by its id.
crontab
/etc/crontab.
path: /etc/crontab
owner: root
group: root
mode: '0600'
cron-hourly
/etc/cron.hourly.
path: /etc/cron.hourly
owner: root
group: root
mode: '0700'
cron-daily
/etc/cron.daily.
path: /etc/cron.daily
owner: root
group: root
mode: '0700'
cron-weekly
/etc/cron.weekly.
path: /etc/cron.weekly
owner: root
group: root
mode: '0700'
cron-monthly
/etc/cron.monthly.
path: /etc/cron.monthly
owner: root
group: root
mode: '0700'
cron-yearly
/etc/cron.yearly.
path: /etc/cron.yearly
owner: root
group: root
mode: '0700'
cron-d
/etc/cron.d.
path: /etc/cron.d
owner: root
group: root
mode: '0700'
Remediation
Run chown root:root /etc/crontab /etc/cron.d /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly /etc/cron.yearly, chmod 600 /etc/crontab and
chmod 700 /etc/cron.d /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly /etc/cron.yearly.
| Restart | none |
| Disruption | none |
Rollback
Run chmod 644 /etc/crontab and chmod 755 on the directories.
crontab
Generated from check crontab: the engine writes the fix for every output, it sets the expected value and the check runs again after.
cron-hourly
Generated from check cron-hourly: the engine writes the fix for every output, it sets the expected value and the check runs again after.
cron-daily
Generated from check cron-daily: the engine writes the fix for every output, it sets the expected value and the check runs again after.
cron-weekly
Generated from check cron-weekly: the engine writes the fix for every output, it sets the expected value and the check runs again after.
cron-monthly
Generated from check cron-monthly: the engine writes the fix for every output, it sets the expected value and the check runs again after.
cron-yearly
Generated from check cron-yearly: the engine writes the fix for every output, it sets the expected value and the check runs again after.
cron-d
Generated from check cron-d: the engine writes the fix for every output, it sets the expected value and the check runs again after.
Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.
References
- cron(8), Ubuntu manual pages Canonical, vendor-doc, accessed 2026-10-19
- ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R50) ANSSI, guide, accessed 2026-10-19
Mappings
| Framework | ID | Relation | Note |
|---|---|---|---|
| ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0 | R50 | partial | R50 covers every sensitive file; this control covers the system cron jobs. |
| NIST SP 800-53 Rev. 55.1.1 | AC-3 | related |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
People and lifecycle
| Authors |
|
| Verified | 2026-10-19 by Sn0wAlice on 20.04, Proxmox VM, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic. Stock image fails (0644/0755); fix sets 0600/0700, audit passes, persistent after reboot; /etc/cron.yearly absent, check not applicable. |
| Verified | 2026-10-19 by Sn0wAlice on 22.04, Proxmox VM, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic. Stock image fails (0644/0755); fix sets 0600/0700, audit passes, persistent after reboot; /etc/cron.yearly absent, check not applicable. |
| Verified | 2026-10-19 by Sn0wAlice on 24.04, Proxmox VM, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic. Stock image fails (0644/0755); fix sets 0600/0700, audit passes, persistent after reboot. |
| Verified | 2026-10-19 by Sn0wAlice on 26.04, Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic. Stock image fails (0644/0755); fix sets 0600/0700, audit passes, persistent after reboot. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-19, 2026-10-19 |
| Translations | fr |