# Ensure telnet client is not installed

Necessity: The Telnet protocol is inherently insecure as it transmits all data, including usernames and passwords, in cleartext. This makes it trivial for an attacker with access to the network to intercept credentials and gain unauthorized access to systems. The presence of the telnet client on a system poses a risk as it can be used by an attacker who has gained initial access to pivot to other systems, or by users who may inadvertently expose credentials on the network. Removing it enforces the use of secure alternatives like SSH.

Auditing and Remediation: The audit script queries the system's RPM package database to verify whether the 'telnet' package is installed. The remediation script uses the system's package manager (YUM or DNF) to remove the 'telnet' package, thereby eliminating the tool from the system.

Recommended State Rationale: The recommended state for all security levels (Basic, Moderate, and Strict) is 'Not Installed'. There is no modern use case where the installation of a telnet client is considered secure or acceptable. Its protocol lacks encryption, which is a fundamental requirement for secure communications. Therefore, regardless of the overall system hardening level, the telnet client must be removed to mitigate the risk of credential exposure and enforce secure administrative practices.

## Recommended State Configuration

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

## Audit Script Working

Bash script that checks if the 'telnet' package is installed using 'rpm -q telnet'. The script should output 'Installed' if the package is present and 'Not Installed' if it is not. The output must not contain any other text or formatting.

## Remediation Script Working

Bash script that accepts a single positional argument for the desired state. If the argument is 'Not Installed', the script must use 'yum remove -y telnet' or 'dnf remove -y telnet' to uninstall the package. The script must return 'true' if the package is successfully uninstalled or was already in the desired state, and 'false' otherwise.

