Security descriptor

Security descriptors are data structures of security information for securable Windows objects, that is objects that can be identified by a unique name. Security descriptors can be associated with any named objects, including files, folders, shares, registry keys, processes, threads, named pipes, services, job objects and other resources.

Security descriptors contain discretionary access control lists (DACLs) that contain access control entries (ACEs) that grant and deny access to trustees such as users or groups. They also contain a system access control list (SACLs) that control auditing of object access. ACEs may be explicitly applied to an object or inherited from a parent object. The order of ACEs in an ACL is important, with access denied ACEs appearing higher in the order than ACEs that grant access. Security descriptors also contain the object owner.

Mandatory Integrity Control is implemented through a new type of ACE on a security descriptor.

Files and folder permissions can be edited by various tools including Windows Explorer, WMI, command line tools like Cacls, XCacls, ICacls, SubInACL, the freeware Win32 console FILEACL, the free software utility SetACL, and other utilities. To edit a security descriptor, a user needs WRITE_DAC permissions to the object, a permission that is usually delegated by default to administrators and the object's owner.

Permissions in NTFS

The following table summarizes NTFS permissions and their roles (in individual rows.) The table exposes the following information:

Permission
code
Meaning Included in Alias
For files For folders R E W A M In SDDL In icacls In cacls
0x01Read dataList folder contents YesYesYesYesCCRDFILE_READ_DATA
0x80Read attributes YesYesYesYesDCRAFILE_READ_ATTRIBUTES
0x08Read extended attributes YesYesYesYesSWREAFILE_READ_EA
0x20Execute fileTraverse folder YesYesYesWPXFILE_EXECUTE
0x20000Read permissions YesYesYesYesYesRCRCREAD_CONTROL
0x100000Synchronize YesYesYesYesYesSSYNCHRONIZE
0x02Write dataCreate files YesYesYesDCWDFILE_WRITE_DATA
0x04Append dataCreate folders YesYesYesLCADFILE_APPEND_D
0x100Write attributes YesYesYesCRWAFILE_WRITE_ATTRIBUTES
0x10Write extended attributes YesYesYesRPWEAFILE_WRITE_EA
0x10000Delete (or rename) YesYesSDDEDELETE
0x40000Change permissions YesWDWDACWRITE_DAC
0x80000Take ownership YesWOWOWRITE_OWNER
0x40Delete subfolders and files YesDTDCFILE_DELETE_CHILD

Most of these permissions are self-explanatory, except the following:

  1. Renaming a file requires the "Delete" permission.
  2. File Explorer doesn't show "Synchronize" and always sets it. Multi-threaded apps like File Explorer and Windows Command Prompt need the "Synchronize" permission to be able to work with files and folders.

See also