CH 15-Securing Windows Objects
CH 15-Securing Windows Objects
Objects
• Security Attributes
• Security Overview: The Security Descriptor
– Access Control Lists
• Security Descriptor Control Flags
• Security Identifiers
• Managing ACLs
• Example: UNIX-Style Permission for NTFS Files
• Example: Initializing Security Attributes
• Reading and Changing Security Descriptors
• Example: Reading File Permissions
• Example: Changing File Permissions
• Securing Kernel and Communication Objects
• Example: Securing a Process and Its Threads
• Overview of Additional Security Features
• Windows supports a comprehensive security
model that prevents unauthorized access to
objects such as files, processes, and file mappings.
• Nearly all sharable objects can be protected, and
the programmer has a fine granularity of control
over access rights.
• Windows has Common Criteria Certification at
Evaluation Assurance Level 4 (EAL-4), an
internationally recognized criteria.
Security Attributes
• Explores Windows access control by proceeding from
the top down to show how to construct an object’s
security.
• In the case of files, it is also possible to use Windows
Explorer to examine and manage some file security
attributes.
• Any object created with a system call has a security
attributes parameter.
• Therefore, programs can secure files, processes,
threads, events, semaphores, named pipes, and so on.
• The first step is to include a
SECURITY_ATTRIBUTES structure in the Create
call.
• In order to implement security, the important
element in the SECURITY_ATTRIBUTES structure
is lpSecurityDescriptor, the the pointer to a
security descriptor, which describes the object’s
owner and determines which users are allowed
or denied various rights.
• An individual process is identified by its access
token, which specifies the owning user and
group membership.
• When a process attempts to access an object,
the Windows kernel can determine the
process’s identity using the token and can then
decide from the information in the security
descriptor whether or not the process has the
required rights to access the object.
• Set nLength to sizeof (SECURITY_ATTRIBUTES).
bInheritHandle indicates whether or not the
handle is inheritable by other processes.
Notes
• Using a standard install on a clean system,
inspect the permissions and access controls
placed on all resources owned by the system,
including files and registry keys.
• The permissions granted by the system's
default install should exactly match those put
forth by the resource specifier in the security
requirements, or from the global security
policy.
Security Overview: The Security Descriptor
• Analyzing the security descriptor gives a good overview of
essential Windows security elements.
• Security descriptor is initialized with the function
InitializeSecurityDescriptor and it contains the following:
– The owner security identifier (SID)
– The group SID
– A discretionary access control list (DACL)—a list of entries explicitly
grantingand denying access rights.
– A system ACL (SACL), sometimes called an “audit access ACL,”
controls audit message generation when programs access securable
objects; you need to have system administrator rights to set the
SACL.
• SetSecurityDescriptorOwner and
SetSecurityDescriptor Group associate SID
with security descriptor.
• ACL are initialized using the InitalizedAcl
function and are then associated with security
descriptor using SetSecurityDescriptorDacl or
SetSecurityDescriptorSacl.
The Security Descriptor
• Access Control List
• Each ACL is a set (list) of access control entries (ACEs). There are two types of
ACEs: one for access allowed and one for access denied.
• Using Windows Object Security
• Object Rights and Object Access
– An object, such as a file, gets its security descriptor at creation time,
although the program can change the security descriptor at a later
time.
• Security Descriptor Initialization
– The first step is to initialize the security descriptor using the
InitializeSecurityDescriptor function. Set the pSecurityDescriptor
parameter to the address of a valid SECURITY_DESCRIPTOR structure.
Security Identifiers
• Windows uses SIDs to identify users and
groups.
• The program can look up a SID from the
account name, which can be a user, group,
domain, and so on. The account can be on a
remote system.
Managing ACLs
• This section shows how to manage ACLs, how
to associate an ACL with a security descriptor,
and how to add ACEs. Figure 15–1 shows the
relationships between these objects and
functions.
Example: UNIX-Style Permission for NTFS Files
• Program 15.5
• Function ChangeFilePermissions, replaces the
existing security descriptor with a new one,
preserving the user and group SIDs but
creating a new discretionary ACL.
Securing Kernel and Communication Objects