FileRisk: Do not touch
SECURITY C:\Windows\System32\config\SECURITY
Registry hive HKLM\SECURITY: local security policy, LSA secrets and cached credentials. Access restricted to the system.
What it’s for
SECURITY is the hive that carries the local security policy. Windows loads it at startup and exposes it under HKEY_LOCAL_MACHINE\SECURITY. Only the system can open it: even an administrator cannot browse it in regedit without running as SYSTEM. The rules common to all hives are on the System32\config page.
What it contains
- The local security policy: auditing, user rights and LSA security settings.
- LSA secrets, such as service account passwords, and depending on configuration the cached domain credentials used for offline sign-in.
- The companion transaction files (
SECURITY.LOG1,SECURITY.LOG2), next to the hive.
Risks and best practices
- This hive holds secrets. An offline copy, together with the
SYSTEMhive, allows them to be extracted, so protect physical access and backups. - To change local policy, use
secpol.mscorsecedit, not the file.
Useful commands
# The hive and its companion files (.LOG1, .LOG2, .regtrans-ms)Get-ChildItem -Force "$env:windir\System32\config" -Filter "SECURITY*" | Select-Object Name, Length, LastWriteTime
# Export the local security policy for reading (as administrator)secedit /export /cfg "$env:TEMP\secpol.inf"
# Offline copy of the hive (as administrator)reg save HKLM\SECURITY "$env:TEMP\security.hiv"