Security Identifier
In the context of the Microsoft Windows NT line of operating systems, a Security Identifier (commonly abbreviated SID) is a unique, immutable identifier of a user, user group, or other security principal. A security principal has a single SID for life, and all properties of the principal, including its name, are associated with the SID. This design allows a principal to be renamed (for example, from "John" to "Jane") without affecting the security attributes of objects that refer to the principal.
Overview
Windows grants or denies access and privileges to resources based on access control lists (ACLs), which use SIDs to uniquely identify users and their group memberships. When a user logs into a computer, an access token is generated that contains user and group SIDs and user privilege level. When a user requests access to a resource, the access token is checked against the ACL to permit or deny particular action on a particular object.
SIDs are useful for troubleshooting issues with security audits, Windows server and domain migrations.
The format of an SID can be illustrated using the following example: "S-1-5-21-3623811015-3361044348-30300820-1013";
S | 1 | 5 | 21-3623811015-3361044348-30300820 | 1013 |
---|---|---|---|---|
The string is a SID. | The revision level (the version of the SID specification). | The identifier authority value. | Domain or local computer identifier | A Relative ID (RID). Any group or user that is not created by default will have a Relative ID of 1000 or greater. |
Possible identifier authority values are:
- 0 - Null Authority
- 1 - World Authority
- 2 - Local Authority
- 3 - Creator Authority
- 4 - Non-unique Authority
- 5 - NT Authority
- 9 - Resource Manager Authority[1][2]
Duplicated SIDs
In a Workgroup of computers running Windows NT/2K/XP it is possible for a user to have unexpected access to shared files or files stored on a removable storage. This can be circumvented by setting access control lists on a susceptible file. Then the effective permissions can be determined by the user SID. If this user SID is duplicated on another computer (because the computer SID is duplicated and because the user SIDs are built based on the computer SID and a sequential number), a user of a second computer having the same SID could have access to the files that the user of a first computer has protected.
When the computers are joined into a domain (Active Directory or NT domain for instance), each computer has a unique Domain SID which is recomputed each time a computer enters a domain. Thus there are typically no significant problems with duplicated SIDs when the computers are members of a domain, especially if local user accounts are not used. If local user accounts are used, there is a potential security issue similar to the one described above, but the issue is limited to the files and resources protected by local users, as opposed to by domain users.
Duplicated SIDs are usually not a problem with Microsoft Windows systems. Microsoft used to provide the '"NewSID" utility to change a machine SID.[3]
Other programs that detect SIDs might have problems with its security.
After NewSID's retirement, Microsoft engineer Mark Russinovich posted an article on his blog[4] explaining the retirement of the NewSID stating that neither he nor the Windows security team could think of any situation where duplicate SIDs could cause any problems at all, against commonly accepted wisdom.
On November 1, 2009, Microsoft added the following to the NewSID download page:
Note: NewSID will be retired from Sysinternals on November 2, 2009.
At present, the only supported mechanism for duplicating disks for Windows operating systems is through use of SysPrep.
Machine SIDs
The machine SID is stored in the SECURITY registry hive located at SECURITY\SAM\Domains\Account, this key has two values F and V. The V value is a binary value that has the computer SID embedded within it at the end of its data (last 96 bits).[5]
- "NewSID ensures that this SID is in a standard NT 4.0 format (3 32-bit subauthorities preceded by three 32-bit authority fields). Next, NewSID generates a new random SID for the computer. NewSID's generation takes great pains to create a truly random 96-bit value, which replaces the 96-bits of the 3 subauthority values that make up a computer SID."
- From NewSID readme.
Decoding Machine SID
The SID number is used in file, registry, service and users permissions. The machine SID is determined in hexadecimal form from here:
regedit.exe
: \HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\V (last 12 bytes)explorer.exe
: \%windir%\system32\config\SAMIf the SAM file is missing at startup, a backup is retrieved in hexadecimal form here:
regedit.exe
: \HKEY_LOCAL_MACHINE\SECURITY\Policy\PolAcDmS\@ (last 12 bytes)explorer.exe
: \%windir%\system32\config\SECURITYSometimes the SID number is referenced in decimal form. [6]
Example | 2E,43,AC,40,C0,85,38,5D,07,E5,3B,2B |
---|---|
1) Divide the bytes into 3 sections: | 2E,43,AC,40 - C0,85,38,5D - 07,E5,3B,2B |
2) Reverse the order of bytes in each section: | 40,AC,43,2E - 5D,38,85,C0 - 2B,3B,E5,07 |
3) Convert each section into decimal: | 1085031214 - 1563985344 - 725345543 |
4) Add the machine SID prefix: | S-1-5-21-1085031214-1563985344-725345543 |
Other Uses
The machine SID is also used by some free-trial programs, such as Start8 to prevent a computer restarting the trial, though experienced users can easily change the machine SID.
Service SIDs
Service SIDs are a feature of service isolation, a security feature introduced in Windows Vista and Windows Server 2008.[7] Any service with the "unrestricted" SID-type property will have a service-specific SID added to the access token of the service host process.
The purpose of Service SIDs is to allow permissions for a single service to be managed without necessitating the creation of service accounts, an administrative overhead.
Each service SID is a local, machine-level SID generated from the service name using the following formula:
S-1-5-80-{SHA-1(service name in upper case)}
The sc.exe utility can be used to generate an arbitrary service SID:
sc.exe showsid dnscache
NAME: dnscache
SERVICE SID: S-1-5-80-859482183-879914841-863379149-1145462774-2388618682
STATUS: Active
The service can also be referred to as NT SERVICE\<service_name> (e.g. "NT SERVICE\dnscache").
See also
- Access control
- Access Control Matrix
- Discretionary Access Control (DAC)
- Globally Unique Identifier (GUID)
- Mandatory Access Control (MAC)
- Role-Based Access Control (RBAC)
- Capability-based security
- Post-cloning operations
References
- ↑ See "Custom Principals" section on https://msdn.microsoft.com/en-us/library/aa480244.aspx
- ↑ http://blogs.msdn.com/larryosterman/archive/2004/09/01/224051.aspx
- ↑ "NewSID v4.10". Windows Sysinternals. Microsoft. 2006-11-01.
- ↑ Russinovich, Mark (2009-11-03). "The Machine SID Duplication Myth". TechNet Blogs. Microsoft.
- ↑ "MS TechNet NewSID Utility - How It Works". Knowledge Base. Microsoft. November 1, 2006. Retrieved 2008-08-05.
- ↑ Security Accounts Manager, clark@hushmail.com
- ↑ "Windows Service Isolation Feature". Article. Windows IT Pro. June 6, 2012. Retrieved December 7, 2012.
External links
- Official
- Other