# Ensure nis server services are not in use

Necessity: The Network Information Service (NIS) is an outdated directory service protocol that lacks modern security features. It transmits sensitive information, including password hashes, across the network in plaintext, making it highly vulnerable to eavesdropping and credential theft by attackers on the same network segment. Its use introduces a significant and unnecessary security risk. Modern, secure alternatives like LDAP over TLS or Kerberos should be used instead. Auditing and Remediation: The audit script verifies whether the 'nis' package is installed on the system using the 'dpkg' package manager. The remediation script uses 'apt-get purge' to completely remove the 'nis' package and its associated configuration files, effectively disabling the service. Recommended State Rationale: The recommended state for all hardening levels (Basic, Moderate, and Strict) is 'Not Installed'. Due to its inherent security flaws, the mere presence of the NIS server package is considered a vulnerability. There is no secure configuration for NIS in a modern IT environment, so its complete removal is the only acceptable state to ensure system security.

## 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 'nis' package is installed. 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 labels.

## Remediation Script Working

Bash script that accepts one positional argument, which must be 'Not Installed'. The script should attempt to uninstall the 'nis' package using 'apt-get purge'. The script must output 'true' if the package is successfully removed or was already not installed, and 'false' if the removal fails.

