SHA-256 Integrity Baseline
A SHA-256 cryptographic hash is generated for the trusted /etc/passwd file.
Establish a trusted cryptographic representation of the expected file state.
Enterprise Linux servers maintain critical authentication and system configuration files that directly influence user access and system security. The Linux /etc/passwd file contains essential account information used by the operating system for user identification and account management.
Unauthorized modification of /etc/passwd can indicate malicious activity, account manipulation, or an attempt to alter the authentication environment. If such modification is not detected quickly, an attacker may continue operating with unauthorized account privileges or manipulate the server's user configuration.
In this use case, a controlled enterprise-like Linux environment is created using Ubuntu virtual machines. The /etc/passwd file is treated as a protected critical configuration file.
A cryptographic integrity baseline is established by calculating the SHA-256 hash of the protected file. The baseline hash represents the expected integrity state of the file.
A controlled file-tampering simulation is then performed within the isolated laboratory environment. The /etc/passwd file is intentionally modified in a controlled manner to generate a detectable integrity change. No real account takeover or destructive modification is performed.
Wazuh is configured to monitor the protected file and detect the unauthorized modification. The cryptographic integrity value is compared against the established baseline to identify a hash mismatch.
When unauthorized modification is detected, Wazuh generates a security alert. Wazuh Active Response is then used to execute the predefined containment action.
The modified file is subsequently investigated and restored to its known-good state. The SHA-256 hash is recalculated to confirm that the original integrity has been recovered.
The Linux /etc/passwd file stores essential information about local user accounts on a Linux system. Because this file is involved in account management, unauthorized modification can affect the security state of the server.
Traditional monitoring may identify that a file has changed, but a security system must also determine whether the current file state matches the previously trusted state. Without cryptographic integrity verification, unauthorized modifications to critical configuration files may remain unnoticed until they produce visible authentication or system-level consequences.
Unauthorized modification of /etc/passwd can change the integrity state of a critical authentication configuration file and may lead to potential account manipulation or continued unauthorized activity.
The security problem is therefore:
The proposed solution introduces SHA-256 cryptographic integrity verification combined with Wazuh File Integrity Monitoring and automated incident response to detect and contain unauthorized modification of /etc/passwd.
The attack scenario simulates unauthorized modification of the Linux /etc/passwd file. A controlled laboratory modification is performed against the protected file so that the cryptographic integrity monitoring mechanism can identify the change.
The simulation does not create unauthorized real-world access or compromise a production authentication system. The purpose is to reproduce the file-tampering behavior and validate whether the security system can detect the integrity violation and initiate the appropriate response.
The primary security concept is cryptographic integrity verification using SHA-256.
A SHA-256 hash is generated from the trusted /etc/passwd file and stored as the baseline integrity value. When the file is modified, its SHA-256 hash changes. The current hash is compared with the trusted baseline.
The secure processing flow is:
A matching hash indicates that the monitored file content remains unchanged. A different hash indicates that the file content has changed and requires security investigation.
A SHA-256 cryptographic hash is generated for the trusted /etc/passwd file.
Establish a trusted cryptographic representation of the expected file state.
Wazuh monitors the protected /etc/passwd file for changes.
Identify unauthorized file modification activity.
The current integrity value is compared with the trusted baseline.
Detect changes in the file content.
A hash mismatch combined with the corresponding file-change event is treated as a potential integrity violation.
Identify suspicious modification of the critical authentication file.
Wazuh generates a security alert when unauthorized modification is detected.
Provide immediate visibility into critical configuration tampering.
Available event information is used to identify the host, timestamp, user, and modification activity associated with the file change.
Support incident investigation.
Wazuh Active Response executes the predefined response when the integrity-violation condition is triggered.
Contain the affected system or account according to the response policy.
The trusted /etc/passwd configuration is restored after investigation.
Return the authentication configuration to its known-good state.
A new SHA-256 hash is calculated after restoration.
Confirm that the file has returned to its trusted integrity state.
The protected file remains under Wazuh monitoring after recovery.
Detect subsequent unauthorized modifications.
Wazuh is the primary security tool because it provides endpoint monitoring, File Integrity Monitoring, security-rule processing, alert generation, and Active Response.
SHA-256 is the cryptographic hashing mechanism used to establish and verify the integrity of the protected file.
Ubuntu provides the controlled enterprise-like Linux environment.
Kali Linux is used as the controlled security-testing environment.
VirtualBox provides the isolated laboratory infrastructure.