# Ensure no duplicate user names exist

The existence of duplicate user names is a critical security vulnerability that undermines the principle of individual accountability. When multiple user accounts share the same name, it becomes impossible for system logs, access controls, and auditing tools to reliably distinguish between them. This ambiguity can be exploited by an attacker to conceal their activities, as actions might be attributed to the wrong account. It also causes unpredictable behavior in system services that rely on unique user identifiers, potentially leading to unauthorized access or privilege escalation. The audit script verifies the uniqueness of all user names by parsing the `/etc/passwd` file and counting any names that appear more than once. The remediation for this finding must be manual, as an automated script cannot safely determine which duplicate account is legitimate and which should be removed or renamed. The recommended state for all security levels (Basic, Moderate, and Strict) is an absolute value of '0'. There is no acceptable scenario where duplicate user names should exist on a system, as even a single instance represents a significant configuration flaw and security risk.

## Recommended State Configuration

| Security Level | Value |
|----------------|-------|
| **Basic** | `[0, 0]` |
| **Moderate** | `[0, 0]` |
| **Strict** | `[0, 0]` |
| **Type** | `RANGE` |

## Audit Script Working

Bash script that counts the number of user names that are duplicated in the /etc/passwd file. The script must parse the first field of the /etc/passwd file, identify any user names that appear more than once, and output a single integer representing the total count of these duplicated names.

## Remediation Script Working

Bash script that accepts a target value as an argument (which must be '0' for this control). Since automatically removing user accounts is highly destructive and requires manual review, the script must not perform any changes. It should identify the duplicate user names and print a warning message to standard error instructing the administrator to resolve them manually. The script must always return 'false' to indicate that automatic remediation is not supported and manual intervention is required.

