# Ensure access to /etc/issue is configured

Necessity: The `/etc/issue` file contains a message or system identification to be printed before the login prompt. It is crucial to prevent unauthorized modification of this file, as it could be used to display misleading information, false security warnings, or social engineering prompts to trick users. Ensuring the file is owned by root and has read-only permissions for non-root users maintains the integrity of this pre-login banner and mitigates the risk of system misrepresentation.

Auditing and Remediation: The audit script verifies the current ownership (user and group) and file access permissions of `/etc/issue`. The remediation script corrects any deviation from the secure standard by using `chown` to set the owner and group to root, and `chmod` to set the permissions to `644`.

Recommended State Rationale: The recommended state for all levels (Basic, Moderate, and Strict) is `'root:root 644'`. This is the standard configuration recommended by security benchmarks like CIS. Owner and group `root:root` ensures that only the superuser can alter the file. Permissions `644` (`-rw-r--r--`) allows root to write to the file while permitting all other users and system processes to read it, which is necessary for it to be displayed at login. There is no practical or secure alternative; this single configuration is considered the correct and necessary state for system security.

## Recommended State Configuration

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

## Audit Script Working

bash script that retrieves the ownership and permissions of the `/etc/issue` file. The script should use the `stat` command to output the owner, group, and octal permissions in the format 'owner:group permissions' (e.g., 'root:root 644'). The output must contain only this value, with no extra text or formatting.

## Remediation Script Working

bash script that accepts a single string argument specifying the desired ownership and permissions for the `/etc/issue` file, in the format 'owner:group permissions' (e.g., 'root:root 644'). The script must parse this argument and use `chown` to set the owner:group and `chmod` to set the permissions accordingly. It must return `true` on success and `false` on failure.

