Information
The /etc/cron.yearly directory contains system cron jobs that run on an annual basis. Files in this directory are edited directly by system administrators rather than through the crontab command. The commands below restrict read, write, and search access to root only, preventing regular users from accessing this directory.
Granting write access to /etc/cron.yearly for non-privileged users would allow them to introduce arbitrary commands that run annually as root, providing a path to unauthorized privilege escalation. Granting read access would expose the contents of scheduled jobs, potentially revealing sensitive system information or attack opportunities.
Solution
- IF - cron is installed on the system:
Run the following commands to set ownership and permissions on the /etc/cron.yearly directory:
# chown root:root /etc/cron.yearly/
# chmod og-rwx /etc/cron.yearly/