Security identifier (SID)
The Security Identifier (SID, by its acronym in English) it is a unique value assigned to each security object in a Windows operating system and is used to manage security and access permissions to resources. SIDs are fundamental for the functioning of Identity-Based Access Control (IBAC) in Windows environments, and allow systems to unequivocally identify users, groups, and other security objects, thus facilitating the implementation of security policies.
SID Structure
A SID is composed of various components that define its hierarchical structure. The basic structure of a SID is as follows:
- Revision: Indicates the version of the SID format.
- SubAuthorityCount: A number indicating how many sub-authority values there are in the SID.
- IdentifierAuthority: A value that defines the security authority under which the SID was generated. This field can contain an authority value indicating whether the SID was created in a domain or on a local machine.
- SubAuthorities: A series of values that provide a unique identifier for the security object within the context of the security authority.
An example of a SID could be: S-1-5-32-544, where:
Sindicates that it is a SID.1is the revision version.5is the identifier of the security authority.32is the value for the known sub-authority, in this case, local groups.544es el identificador para el grupo de administradores en el sistema.
Ejemplo de SIDs Comunes
- S-1-5-18: Esta es la cuenta del sistema local (SYSTEM).
- S-1-5-19: Esta es la cuenta del servicio local (LOCAL SERVICE).
- S-1-5-20: Esta es la cuenta del servicio de red (NETWORK SERVICE).
- S-1-5-32-544: El grupo de administradores.
- S-1-5-32-545: El grupo de usuarios estándar.
Creación y Asignación de SIDs
Los SIDs son generados automáticamente por el sistema operativo en el momento que se crea un nuevo objeto, ya sea un usuario, un grupo, o cualquier otro recurso de seguridad. Cada vez que se crea un objeto, el sistema consulta la autoridad de seguridad responsable y genera un SID único que no se repetirá en ningún otro objeto creado bajo esa misma autoridad.
Proceso de Creación
- Solicitud de Creación: When an administrator or a program requests the creation of a new security object, the operating system starts the process.
- SID Generation: The system uses its internal mechanisms to assign a new SID, ensuring that it is unique and follows the defined structure.
- Storage: The new object along with its SID is stored in the system's security database, As the Active DirectoryActive Directory (AD) is a directory service developed by Microsoft that allows you to manage and organize resources within a network. Facilitates authentication and authorization of users and computers, offering a framework for centralized management of security and access policies. AD uses a hierarchical structure that includes domains, trees and forests, providing efficient scalability. What's more, allows the implementation of Group Policies, that help...., in the case of domain environments.
SID Persistence
One of the most important features of SIDs is their persistence. Once a SID is created and assigned, it remains associated with the object even if names are changed or they are moved to other systems. This feature ensures that access to resources remains unchanged, regardless of changes in the system's nomenclature or architecture.
Use of SIDs in Access Control
The main function of a SID is its use in controlling access to resources in a Windows system. Each resource, such as files and folders, has an access control list (ACL) that defines which SIDs have permissions to interact with that resource.
Access Control Lists (ACL)
ACLs are structures that contain access control entries (ACE), where each ACE specifies a SID and the permissions associated with that SID. Permissions can include:
- Read: Allows the SID to read the resource.
- Writing: Allows the SID to modify the resource.
- Run: Allows the SID to execute the resource if it is a program.
Types of ACL
- DACL (Discretionary Access Control List): Controla el acceso a recursos y permite definir qué SIDs tienen derechos sobre el objeto.
- SACL (System Access Control List): Se utiliza para registrar el acceso a un recurso, y permite a los administradores realizar auditorías sobre quién accede a qué recursos.
Evaluación de Acceso
Cuando un usuario o proceso intenta acceder a un recurso, el sistema operativo evalúa la ACL del recurso consultando los SIDs del solicitante. El proceso de evaluación se realiza de la siguiente manera:
- Identificación del Usuario: El sistema obtiene el SID del usuario que intenta acceder al recurso.
- Consulta de ACL: Se revisa la DACL del recurso para identificar si el SID del usuario está presente.
- Determinación de Permisos: Si se encuentra el SID en la DACL, se evalúan sus permisos para determinar si se permite o se deniega el acceso.
Migración y Renombramiento de SIDs
La migración y el renombramiento de objetos de seguridad pueden presentar desafíos debido a la existencia de SIDs.
Migración
Cuando un objeto se migra de un sistema a otro, el SID también debe ser migrado, pero esto puede resultar complejo si el nuevo sistema no tiene la misma autoridad de seguridad. Las herramientas como Active Directory Migration Tool (ADMT) pueden ser utilizadas para manejar la migración de usuarios y grupos, así como para mantener la correspondencia entre los SIDs del antiguo y del nuevo sistema.
Renombramiento
El renombramiento de objetos como usuarios o grupos no cambia su SID. Esto es ventajoso, ya que asegura que los permisos asociados al SID se mantengan intactos. However, es crucial que los administradores comprendan que cualquier referencia a los nombres de los objetos no se verá afectada por el SID.
Herramientas para Gestionar SIDs
Existen diversas herramientas que permiten a los administradores de sistemas trabajar con SIDs en un entorno Windows. Algunas de estas herramientas incluyen:
whoami
The command whoami /user permite listar el SID del usuario actual en la consola de comandos.
PsGetSid
Esta herramienta de Sysinternals, PsGetSid, permite recuperar el SID de un usuario o de un grupo específico.
PowerShellPowerShell es una herramienta de automatización y gestión de configuraciones desarrollada por Microsoft. Permite a los administradores de sistemas y desarrolladores ejecutar comandos y scripts para realizar tareas de administración en sistemas operativos Windows y otros entornos. Su sintaxis basada en objetos facilita la manipulación de datos, lo que lo convierte en una opción poderosa para la gestión de sistemas. Además, PowerShell cuenta con una amplia biblioteca de cmdlets, así...
PowerShell proporciona cmdlets como Get-LocalUser Y Get-LocalGroup que permiten recuperar información sobre los usuarios y grupos locales, incluyendo sus SIDs.
Active Directory Users and Computers
Esta herramienta gráfica permite a los administradores gestionar usuarios y grupos en un entorno de Active Directory, incluyendo la visualización de sus SIDs.
Conclution
The Security Identifier (SID) es un componente vital dentro del ecosistema de seguridad de Windows, proporcionando un mecanismo robusto y flexible para la gestión de usuarios y permisos. Su diseño permite que los objetos de seguridad sean identificados de manera única y persistente, lo que es crucial para mantener la integridad y la seguridad de los sistemas. Comprender la estructura, creación y uso de los SIDs es esencial para los profesionales de IT que operan en entornos Windows, ya que facilita la implementación de políticas de seguridad y el control de acceso a recursos. La correcta gestión de SIDs no solo ayuda en la administración de la seguridad, sino que también es fundamental para la auditoría y el cumplimiento de normativas en entornos empresariales.



