# Ensure remote login warning banner is configured properly

Necessity: Displaying a warning banner before a user logs in is a critical security and legal control. It serves to notify all users, particularly potential attackers, that they are accessing a private system, that their activities may be monitored, and that unauthorized access is prohibited and will be prosecuted. This removes any expectation of privacy and establishes a legal basis for taking action against intruders. Failing to display a banner could be interpreted as granting implicit consent for access, weakening the legal standing to prosecute unauthorized individuals. Auditing and Remediation: The audit script verifies that the '/etc/issue.net' file, which contains the banner text for remote logins, is properly configured and not empty. The remediation script populates this file with an organization-approved warning message, ensuring all remote access attempts are preceded by the appropriate legal notification. Recommended State Rationale: The recommended state for all hardening levels (Basic, Moderate, Strict) is 'Configured'. The binary nature of this setting—either a banner is present or it is not—means the primary goal is ensuring its existence. The difference between the levels lies not in the state itself, but in the content of the banner. A 'Basic' implementation might have a simple warning, while a 'Strict' implementation would feature comprehensive text drafted or approved by legal counsel, explicitly mentioning monitoring, the absence of privacy rights, and the legal consequences of misuse. Since this check only validates the presence of a banner, the state is consistently 'Configured'.

## Recommended State Configuration

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

## Audit Script Working

Bash script that checks if the file '/etc/issue.net' exists and is not empty. The script should output 'Configured' if the file exists and contains content, and 'Not Configured' otherwise. The output must be only the value, with no additional text.

## Remediation Script Working

Bash script that accepts a single string argument representing the warning banner text. The script must overwrite the '/etc/issue.net' file with this text. It should also ensure the file permissions are set to '644' (owner read/write, group read, other read) and the ownership is 'root:root'. The script must return 'true' on success and 'false' on failure.

