The HKEY_LOCAL_MACHINE SAM hive is the Windows registry area that stores local Security Accounts Manager data, including local user and group account information. It is loaded at boot from the SAM database on disk and helps Windows enforce local authentication and account control on the device.
What the SAM hive is
The SAM hive is the part of the Windows registry that exposes local Security Accounts Manager data to the operating system. It is where Windows keeps the records for local users and groups, so authentication and account checks on the device can be enforced consistently at startup and during logon.
Because the hive is loaded from disk during boot, it is both a live configuration structure and a forensic artefact. Changes to it can affect who can sign in locally, which groups exist on the machine, and whether account metadata matches what administrators expect.
Why the SAM hive matters for local account control
The SAM hive is central to local identity state on a Windows host. If it is corrupted, tampered with, or read by an attacker, the result can range from broken authentication to disclosure of local account details that support privilege escalation or lateral movement.
That makes the hive more than a registry detail, because it directly influences the trust a workstation or server places in local accounts. For incident responders, it is also a source of evidence about local account structure and account-related changes over time.
For a broader view of how Windows stores and protects this kind of secret-bearing state, see DPAPI and Windows secret stores.
How attackers and defenders interact with the SAM hive
Attackers value the SAM hive because local account material can help them recover reusable credentials, identify privileged local principals, or support offline access after a system image, disk, or registry copy is obtained. Defenders care about it because the hive is a high-value target when endpoint protections fail or a device is already compromised.
At the defensive end, the same artefact helps investigators confirm which local accounts existed, whether they were renamed or disabled, and whether a device shows signs of offline tampering. That is why SAM analysis is often paired with other Windows registry and artefact review during triage.
When you are analysing the hive as part of a Windows host investigation, the broader artefact context in Windows Forensic Artefacts Guide helps place it alongside other registry and execution evidence.
Operational implications for Windows security
The practical security implication is that local accounts should be treated as part of the endpoint trust boundary, not as a disposable administrative convenience. If local administrator passwords are shared, stale, or poorly governed, the SAM hive becomes a repository of risk rather than a simple system database.
Hardening therefore depends on reducing the value of what the hive can expose and limiting how much an attacker gains if it is accessed. On modern Windows systems, that often means tightening local admin practices, protecting credential material in memory and at rest, and reviewing whether local accounts are truly needed on the device.
For the adjacent control problem of protecting local secret stores and cached credentials, DPAPI and Windows secret stores is the most directly relevant companion resource.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
CIS Controls v8 and NIST SP 800-53 Rev 5 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CIS Controls v8 | CIS-5 — Account Management | The SAM hive stores local account records that account management must govern. |
| Recommendation — Inventory local accounts and remove stale or unnecessary principals from Windows hosts. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | SAM-related local account control depends on managing authenticators and account lifecycle. |
| AC-2 — Account Management | The hive reflects local account existence, status, and governance on the host. | |
| AU-6 — Audit Review, Analysis, and Reporting | SAM changes and account activity require review as part of host forensics and monitoring. | |
| Recommendation — Rotate and control local account credentials to reduce offline abuse of SAM data. Maintain authoritative local-account inventory and disable accounts no longer required. Review host audit data to detect unauthorized changes to local account state. | ||
| ISO/IEC 27001:2022 | A.5.16 — Identity management | Local account records in SAM are an identity management concern on Windows endpoints. |
| Recommendation — Define ownership for local identities and keep their lifecycle under formal control. | ||
Related resources from NHI Mgmt Group
- Who remains accountable for Terraform policy, auditability, and secret handling when engineers run plans from a local machine?
- What is the difference between copying files through a local machine and using direct host-to-host transfer for SCP?
- What breaks when agent telemetry stays only on the local machine?
- How should teams use local explainability when machine learning models affect high-stakes decisions?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 3, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org