# Ensure permissions on /etc/crontab are configured

The `/etc/crontab` file contains system-wide cron jobs that are executed with root privileges. Incorrect permissions on this file represent a critical security vulnerability. If a non-privileged user can modify this file, they could add a malicious script or command, leading to privilege escalation and complete system compromise. Even read access for unauthorized users could reveal sensitive information about system maintenance and operations. The audit script verifies the file's current permissions by checking its octal mode. The remediation script uses the `chmod` command to enforce the correct, secure permissions. A state of '600' is recommended across all security levels because it is the only setting that properly enforces the principle of least privilege for this critical system file. It ensures that only the root user can read or write to `/etc/crontab`, which is essential for maintaining system integrity and preventing unauthorized modifications.

## Recommended State Configuration

| Security Level | Value |
|----------------|-------|
| **Basic** | `['600']` |
| **Moderate** | `['600']` |
| **Strict** | `['600']` |
| **Type** | `ENUM` |

## Audit Script Working

Bash script that uses the `stat` command with the format specifier `%a` to retrieve the octal permissions for the file `/etc/crontab`. The script must output only the numeric permission value (e.g., '600') and nothing else.

## Remediation Script Working

Bash script that accepts a single positional argument, which is the desired octal permission mode (e.g., '600'). The script must use the `chmod` command to apply these permissions to the `/etc/crontab` file. It must return `true` if the command succeeds and `false` if it fails.

