# Ensure NIS Client is not installed

Necessity: The Network Information Service (NIS), also known as Yellow Pages (YP), is an outdated and insecure directory service protocol for distributing system configuration data. Its most critical vulnerability is the transmission of all data, including password hashes, in cleartext across the network. This makes systems using NIS highly susceptible to credential theft and information leakage through network sniffing. The risk of misconfiguration or use is a widespread compromise of user accounts and sensitive system data. Modern and secure alternatives like LDAP with TLS or Kerberos should be used instead.

Auditing and Remediation: The audit script verifies the system's state by checking for the installation of the 'ypbind' package, which provides the NIS client service. The remediation script ensures this potential vulnerability is eliminated by completely removing the 'ypbind' package from the system, thereby disabling the NIS client.

Recommended State Rationale: The recommended state for all hardening levels (Basic, Moderate, and Strict) is 'not installed'. Due to the fundamental insecurities of the NIS protocol, there is no secure configuration for it. The presence of the NIS client package represents an unacceptable security risk in any modern environment. Industry best practices and benchmarks like the CIS Benchmarks mandate its removal. Therefore, the only acceptable state is for the service to be uninstalled, regardless of the desired security posture.

## Recommended State Configuration

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

## Audit Script Working

shell script that checks if the 'ypbind' package is installed. The script should use 'rpm -q ypbind' and output only 'installed' or 'not installed', with no other text.

## Remediation Script Working

shell script that accepts one positional argument: the desired state ('not installed'). The script should use 'yum remove -y ypbind' or 'dnf remove -y ypbind' to uninstall the package if the argument is 'not installed' and the package is present. It must return 'true' if the final state matches the desired state, and 'false' otherwise.

