Verify Owner on cron.yearly
Ensures the /etc/cron.yearly directory is owned by the root user (UID 0).
Checked against a path’s metadata, mode, owner, group, SUID/SGID.
A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.
Why this rule matters
The /etc/cron.yearly directory holds scripts that cron runs as root once a year. If it is not owned by root, an unprivileged user who can write to it can drop or alter a script and have it executed with full root privileges, a direct privilege-escalation path. Restricting ownership to root ensures only the administrator controls scheduled yearly tasks.
What Pavois checks
Pavois stats the live inode of /etc/cron.yearly and asserts its owner is UID 0. The check is skipped if the directory does not exist. Reading the actual filesystem metadata (not a config file) reflects the effective ownership cron will honor at runtime, including any post-install change.
only_if { file('/etc/cron.yearly').exist? }
describe file('/etc/cron.yearly') do
its('uid') { should eq 0 }
endHow to verify it is applied
Run stat -c '%U %u' /etc/cron.yearly. The expected output is root 0.
Inspect & investigate
Cron execution is recorded in /var/log/cron (RHEL family) or via journalctl -u crond. Ownership changes can be tracked with auditd if a watch is set: auditctl -w /etc/cron.yearly -p wa.
Remediation
No automated harden plan is defined for this rule yet, so it must be fixed manually: run chown root /etc/cron.yearly to restore root ownership.
Pavois applies this with its own harden engine, the plan below, not a shell script:
| owner | root |
|---|---|
| path | /etc/cron.yearly |
| resource | file |
pavois harden plan localwhere the target is local, a user@host SSH alias, or a container , Docs
Impact & precautions
If the directory is owned by a non-root user, that user can schedule arbitrary root-level commands, leading to full system compromise. Fixing it is low-risk: chown root /etc/cron.yearly only changes the owner, not the scripts or their schedule. Verify no legitimate automation relies on a non-root owner before applying, almost never the case for system cron directories.
Standards mapping
| Standard | Reference | Type | Version | Confidence |
|---|---|---|---|---|
| CIS | 2.4.1.7 | direct | per OS, see the benchmark table | high |
Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.