# Ensure telnet client is not installed

The Telnet protocol transmits all data, including usernames and passwords, in cleartext. This makes it highly vulnerable to eavesdropping and man-in-the-middle attacks, where an attacker on the same network can easily intercept credentials and other sensitive information. Disabling the telnet client prevents users from initiating these insecure connections, mitigating the risk of credential exposure. The audit script checks the system's package manager to determine if the 'telnet' package is installed. The remediation script uses the package manager to permanently remove (purge) the telnet package. The recommended state at all security levels (Basic, Moderate, and Strict) is 'not installed' because there is no secure use case for the Telnet protocol in a modern IT environment. Secure, encrypted alternatives like SSH (Secure Shell) should always be used for remote command-line access.

## 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. The script should use `dpkg-query` to determine the package status. If the package status contains 'install ok installed', the script must output the string 'installed'. If it is not installed, it must output 'not installed'. The output must contain only one of these strings and nothing else.

## Remediation Script Working

Bash script that accepts one positional argument representing the desired state. If the argument is 'not installed', the script must attempt to uninstall the 'telnet' package using 'apt-get purge telnet -y'. The script must then output 'true' if the command succeeds (exit code 0) and 'false' otherwise. If the argument is anything other than 'not installed', it should take no action and output 'false'.

