# Ensure access to /etc/issue is configured

Necessity: The `/etc/issue` file contains a message or system identification banner that is displayed before the login prompt. It is crucial for presenting legal notices and warnings against unauthorized access. If this file is writable by non-privileged users, an attacker could modify it to display misleading information for social engineering attacks, trick users into revealing credentials, or remove legally required warning banners. Ensuring the file is owned by `root` and not world-writable prevents such tampering. Auditing and Remediation: The audit script verifies the ownership and file permissions of `/etc/issue` to ensure they match the secure baseline. The remediation script uses the `chown` and `chmod` commands to reset the ownership to `root:root` and apply the standard secure permissions, respectively. Recommended State Rationale: The recommended state for Basic, Moderate, and Strict levels is 'root:root 644'. This configuration is the industry standard (e.g., CIS benchmarks) and provides the necessary security without impairing functionality. Ownership by `root:root` ensures only the administrator can modify the file. Permissions of `644` (`-rw-r--r--`) allow the root user to write to the file while permitting all other users and system services to read it, which is required for the banner to be displayed correctly. There are no tangible security benefits to making the permissions stricter, as doing so might interfere with the intended function of displaying the banner.

## 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 uses the `stat` command to retrieve the owner, group, and octal permissions of the `/etc/issue` file. The script must output this information in the format 'owner:group permissions' (e.g., 'root:root 644'), with no additional text or formatting.

## Remediation Script Working

Bash script that accepts a single positional argument representing the desired octal permissions (e.g., '644'). The script must use `chown` to set the ownership of `/etc/issue` to `root:root` and `chmod` to apply the provided permissions. The script must return `true` on success and `false` on failure.

