Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Crontab
Cyber Security

Crontab

← Back to Glossary
By NHI Mgmt Group Updated October 31, 2026 Domain: Cyber Security

Crontab is the configuration file that stores scheduled cron entries for a user or for the system. Each line defines when a command runs and what it runs. Because crontab can control recurring execution of sensitive scripts, it should be managed like privileged configuration, not a convenience file.

What crontab controls in practice

Crontab is not just a text file, it is the control plane for recurring command execution. Each entry defines schedule, command, and execution context, so the file directly governs when scripts run and under whose authority. In security terms, that makes it part scheduling mechanism and part privileged configuration surface.

Because cron jobs often run without interactive oversight, a small change can have outsized operational impact. A malformed line, an unexpected environment variable, or an altered command path can change what actually runs, or stop a scheduled task entirely.

Why crontab matters for system operations

Crontab is used for backups, maintenance, log processing, patch orchestration, and other routine automation. Its value comes from reliability, but the same reliability creates dependency: if the schedule is wrong or the command is altered, the error repeats until someone notices.

That repeatability is why crontab deserves change control. A schedule that looks harmless in review may still launch a privileged script, a cleanup job, or an administrative action that affects confidentiality, integrity, or availability every day.

How crontab entries are structured

A cron entry combines timing fields with a command, and the command is usually interpreted by a shell. That means quoting, expansion, relative paths, and environment settings all matter. The file may also be user-specific or system-wide, which changes who can edit it and how broadly a job can affect the host.

System crontabs can define a user field explicitly, while per-user crontabs inherit the owning account's execution context. That distinction matters because a job running as root, service admin, or another powerful account can turn a simple schedule entry into an administrative action.

Security implications of scheduled execution

Crontab is security-sensitive because it can trigger trusted code on a fixed schedule without a human present. If an attacker can modify the file, replace the target script, or abuse a writable directory in the execution path, they can convert routine automation into persistence or privilege abuse.

For that reason, the command path, script ownership, file permissions, and surrounding directories are all part of the security boundary. The job itself may be correct, yet still unsafe if it depends on a world-writable script, an untrusted working directory, or a brittle environment assumption.

Risk and Threat Considerations

Crontab becomes risky when recurring execution is trusted more than the integrity of the file, the script, or the path it launches. A compromised schedule can create durable persistence, repeated execution of malicious commands, or quiet disruption of maintenance tasks that defenders rely on.

Failure mechanism: Attackers or careless operators may alter a cron entry, hijack a referenced script, or exploit weak permissions so the scheduled command runs something different from what reviewers expect.

Impact: The result can be repeated unauthorized execution, privilege escalation, backup failure, log tampering, or persistence that survives reboots and ordinary user session resets.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5CM-2 — Baseline ConfigurationCrontab is a privileged configuration artifact that needs controlled baselines and change tracking.
CM-6 — Configuration SettingsCron jobs depend on secure settings for file ownership, paths, and execution context.
AC-6 — Least PrivilegeCron entries often execute with elevated authority, so least privilege directly limits abuse.
Recommendation — Baseline cron configuration and require approval for changes to scheduled execution. Harden cron-related settings and verify permissions on files, scripts, and directories. Run scheduled jobs with the minimum privileges required for the task.
CIS Controls v8CIS-4 — Secure Configuration of Enterprise Assets and SoftwareCrontab security depends on hardened configuration and controlled execution paths.
CIS-5 — Account ManagementUser and service accounts behind cron jobs need ownership, review, and lifecycle control.
Recommendation — Harden cron infrastructure and restrict who can modify scheduled tasks. Assign clear ownership to cron-run accounts and remove unused scheduled access.

Practitioner Guidance

Why practitioners should care: Treat crontab like privileged configuration, because its effect is operational authority, not just timing. Review who can edit it, who owns the invoked scripts, and whether the command path is deterministic and non-writable.

Common misunderstanding: A cron job is not safe merely because the schedule is simple. The real risk is often in the command target, inherited environment, or script dependency chain, not in the five timing fields.

Practitioner takeaway: Baseline cron entries, lock down file and directory permissions, and verify scheduled jobs after changes so unintended persistence or privilege abuse is caught early.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org