Any Windows securable object, which can be represented by a handle to it, has securityinformation attached to it, and it is protected using standard Windows securitymechanisms. The Windows security model uses three security concepts:■ The discretionary access control list (DACL): Describes what principal can usethe object and how■ The identity of the user: Also known as principal■ The Security Reference Monitor (SRM): Uses the information available torestrict the access to the object protected by itDACLs associated with Windows securable objects are managed by the object creatoritself. The DACL is a component within another structure known as the securitydescriptor, which is a small piece of information stored along with the object in thesecured store. The security descriptor is retrieved from the secured store, and it isused every time the object is accessed by a new principal. For example, the files securitydescriptors are stored in the NTFS file system, the registry keys security descriptorsare stored in the registry hives, whereas the kernel objects have the securitydescriptors stored in the kernel address space.The Windows SRM runs in the kernel address space, isolated from the user modecode. Most securable objects are created and managed by kernel components thatuse the address separation to protect the associated security descriptor from the usermode components. Because user mode components cannot use the kernel for implementingtheir own secure object brokers, several components in Windows implementcustom security models using ideas similar to the Windows security mechanisms.A custom object broker must enforce the mechanism for accessing its object. Inother words, when designing a securable objects broker, you must ensure that thisobject cannot be accessed by using any other mechanism. In those cases, the objectbroker takes the SRM role and manages the object security descriptors in its proprietaryways. To ensure functional consistency with the rest of the operating system anduse the same user interface controls in security settings, the object broker will mostlikely use the same data structures as Windows SRM.The other essential component in access control is the security principal, createdand certified by the operating system. The security principal is stored in an accesstoken that aggregates the list of group security principals having the principal as amember, the list of special privileges granted by the operating system, plus otherinformation used by the various components in the system.The access to an object is represented by a collection of bits, each bit representinga right (specific to the object’s nature) that can be granted or denied to a principal.
The next section describes all the security structures relevant to debugging Windowsapplications, and it presents various methods for inspecting them. Readers familiar withthose concepts can skip this section. All examples use three new extension commands:!sd, !token, and !sid, available in the default extension loaded by debuggers. Thisuses the 07sample.exe with the source code and binary located in the followingfolders:Source code: C:\AWD\popBinary: C:\AWDBIN\WinXP.x86.chk\07sample.exeBecause the security errors are often encountered in distributed applications.consisting of a client application 08cli.exe, a library, 08comps.dll that contains theproxy-stub code, and a server application 08comsrv.exe. The 08comsrv.exe must beregistered using the 08comsrv.exe /RegServer command line, and 08comps.dll mustbe registered using the regsvr32 08comps.dll command line. The source code and thebinary files are located in the following folders:Source code: C:\AWD\popBinaries: C:\AWDBIN\WinXP.x86.chk\08cli.exe, 08comps.dll, and08comsrv.exe