# Ensure permissions on /etc/cron.monthly are configured

The '/etc/cron.monthly' directory contains scripts that are executed monthly with root privileges by the cron daemon. Securing this directory is critical to prevent privilege escalation. If an unauthorized user gains write access, they could insert a malicious script that would later be executed as root, leading to a complete compromise of the system. The audit script verifies the directory's permissions and ownership against security best practices. The remediation script uses the 'chmod' and 'chown' commands to enforce the correct state. The recommended state for all levels (Basic, Moderate, and Strict) is '700 root:root'. This configuration ensures that only the root user can read, write, or execute files within the directory, which is the principle of least privilege. Any less restrictive setting introduces an unacceptable risk, making '700 root:root' the only appropriate configuration for this critical system directory.

## Recommended State Configuration

| Security Level | Value |
|----------------|-------|
| **Basic** | `['700 root:root']` |
| **Moderate** | `['700 root:root']` |
| **Strict** | `['700 root:root']` |
| **Type** | `ENUM` |

## Audit Script Working

shell script that retrieves the permissions and ownership for the directory '/etc/cron.monthly'. The script must output a single string in the format 'permissions user:group', for example, '700 root:root'. The output must not contain any extra text or formatting.

## Remediation Script Working

shell script that accepts a single positional argument representing the desired state in the format 'permissions user:group' (e.g., '700 root:root'). The script must parse this argument to set the appropriate permissions (using chmod) and ownership (using chown) for the '/etc/cron.monthly' directory. The script must output 'true' upon successful application of the settings, and 'false' on failure.

