7.3. Windows Security Descriptors

Slides:



Advertisements
Similar presentations
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS1: Overview of Operating Systems 1.1. Windows.
Advertisements

1 Chapter Overview Understanding NTFS Permissions Assigning NTFS Permissions Assigning Special Permissions.
© Neeraj Suri EU-NSF ICT March 2006 Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Zoltán Micskei
Chapter 9 Chapter 9: Managing Groups, Folders, Files, and Object Security.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 5: Managing File Access.
3.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 3: Introducing Active Directory.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 5: Managing File Access.
12.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft® Windows® Server 2003 Active Directory Infrastructure.
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
Administering Active Directory
Hands-On Microsoft Windows Server 2003 Administration Chapter 3 Administering Active Directory.
70-270, MCSE/MCSA Guide to Installing and Managing Microsoft Windows XP Professional and Windows Server 2003 Chapter Nine Managing File System Access.
11 SHARING FILE SYSTEM RESOURCES Chapter 9. Chapter 9: SHARING FILE SYSTEM RESOURCES2 CHAPTER OVERVIEW  Create and manage file system shares and work.
Lesson 4: Configuring File and Share Access
7.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 7: Introducing Group Accounts.
Module 8: Implementing Administrative Templates and Audit Policy.
Event Viewer Was of getting to event viewer Go to –Start –Control Panel, –Administrative Tools –Event Viewer Go to –Start.
11 SHARING FILE SYSTEM RESOURCES Chapter 9. Chapter 9: SHARING FILE SYSTEM RESOURCES2 CHAPTER OVERVIEW Create and manage file system shares and work with.
Windows Security Mechanisms Al Bento - University of Baltimore.
Chapter 5 File and Printer Services
Access Control Lists and NTFS Permissions INFO333 – Lecture Mariusz Nowostawski Noria Foukia.
 Name: Hatem elbuhaisi  Name no:  University of Palestine  Miss : yasmen elboboo  Chairing Information Technology Hands-On Microsoft Windows.
Users and Groups Security Architecture Editing Security Policies The Registry File Security Auditing/Logging Network Issues (client firewall, IPSec, Active.
Security Aspects Of Directory Enabled Applications Praerit Garg Program Manager Windows NT Security Microsoft Corporation.
Security features of Windows What is computer security ? Computer security refers to the protection of all components—hardware, software, and stored.
70-294: MCSE Guide to Microsoft Windows Server 2003 Active Directory Chapter 9: Active Directory Authentication and Security.
Sharing Resources Lesson 6. Objectives Manage NTFS and share permissions Determine effective permissions Configure Windows printing.
Computer Security 3e Dieter Gollmann
Operating System Security CS460 Cyber Security Spring 2010.
Module 10: Configuring Windows XP Professional to Operate in Microsoft Networks.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 5: Managing File Access.
Section 7: Implementing Security Using Group Policy Exploring the Windows Security Architecture Securing User Accounts Exploring Security Policies Hardening.
Designing Group Security Designing security groups Designing user rights.
Module 4 Managing Access to Resources in Active Directory ® Domain Services.
Managing Groups, Folders, Files and Security Local Domain local Global Universal Objects Folders Permissions Inheritance Access Control List NTFS Permissions.
© Wiley Inc All Rights Reserved. MCSE: Windows Server 2003 Active Directory Planning, Implementation, and Maintenance Study Guide, Second Edition.
Active Directory. Computers in organizations Computers are linked together for communication and sharing of resources There is always a need to administer.
Chapter 9: SHARING FILE SYSTEM RESOURCES1 CHAPTER OVERVIEW  Create and manage file system shares and work with share permissions.  Use NTFS file system.
Unit OS8: File System 8.6. Lab Manual. 2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows Operating.
CE Operating Systems Lecture 21 Operating Systems Protection with examples from Linux & Windows.
MCDST : Supporting Users and Troubleshooting a Microsoft Windows XP Operating System Chapter 11: Managing Access to File System Resources.
Unit OS A: Windows Networking A.4. Lab Manual. 2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS8: File System 8.1. Background: File System.
Unit OS12: Scripting Lab Manual. 2 Copyright Notice © David A. Solomon and Mark Russinovich These materials are part of the Windows Operating.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS7: Security 7.1. The Security Problem.
1 Chapter Overview Managing Object and Container Permissions Locating and Moving Active Directory Objects Delegating Control Troubleshooting Active Directory.
Access Control  privilege How does your code manage who has access to what?  authorization  permission Two OS models: Unix Windows.
MA194Using WindowsNT1 Topics for the day… WindowsNT Security WindowsNT File System (NTFS) Viewing/Setting Document and Folder Permissions Access Control.
CN1260 Client Operating System Kemtis Kunanuraksapong MSIS with Distinction MCT, MCITP, MCTS, MCDST, MCP, A+
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS7: Security 7.4. Lab Manual.
Module 10: Implementing Administrative Templates and Audit Policy.
Understand Audit Policies LESSON Security Fundamentals.
Privilege Management Chapter 22.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.3. Advanced Windows Synchronization.
Review on Active Directory. Aim Enable users to find network resources easily Central and easy administration of users and resources in a domain Improve.
Chapter 7 Server Management Policies –User accounts –Groups Rights and permissions Examples.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS1: Overview of Operating Systems 1.1. Windows.
Configuring and Managing Resource Access Lecture 5.
Windows Server 2003 檔案分享管理 林寶森
Windows 2003 Architecture, Active Directory & DNS Lecture # 3 Hassan Shuja 02/14/2006.
Sharing Resources Lesson 6. Objectives Manage NTFS and share permissions Determine effective permissions Configure Windows printing.
Windows Active Directory – What is it? Definition - Active Directory is a centralized and standardized system that automates network management of user.
Lesson 14: Configuring File and Folder Access MOAC : Configuring Windows 8.1.
19 Copyright © 2008, Oracle. All rights reserved. Security.
Windows 2000 Security I will give a high-level overview on W2K Security, which is complex I am not an expert on Windows Security Probably some of you know.
Unit OS7: Security 7.4. Quiz Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze.
Unit OS A: Windows Networking
Unit OS2: Operating System Principles
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Presentation transcript:

7.3. Windows Security Descriptors Unit OS7: Security 7.3. Windows Security Descriptors Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze

Copyright Notice © 2000-2005 David A. Solomon and Mark Russinovich These materials are part of the Windows Operating System Internals Curriculum Development Kit, developed by David A. Solomon and Mark E. Russinovich with Andreas Polze Microsoft has licensed these materials from David Solomon Expert Seminars, Inc. for distribution to academic organizations solely for use in academic environments (and not for commercial use)

Roadmap for Section 7.3. Protecting Objects Security Descriptors and Access Control Lists Auditing and Impersonation Privileges Nearly any object created with a Create() 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. The important element in the SECURITY_ATTRIBUTES structure is the pointer to a security descriptor, which describes who owns the object and 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 OS kernel can determine the process‘s identity using the token and then can decide from the information in the security descriptor whether or not the process has the required rights to access the objects.

Protecting Objects Access to an object is gated by the Security Reference Monitor (SRM), performs access validation at the time that an object is opened by a process Access validation is a security equation that consists of the following components: Desired Access: the type of access that is being requested. must be specified up front, include all accesses that will be performed on the object as a result of the validation. Token: identifies the user that owns the process, as well as the privileges of the user. Threads can adopt a special type of token called an “impersonation token” that contains the identify of another account. The object’s Security Descriptor contains a Discretionary Access Control List (DACL), describes the types of access to the object users are allowed.

Handles and Security If the validation succeeds, a handle is created in the process requesting access and through which the process accesses the resource Changing security on an object only affects subsequent opens Processes that have existing handles can continue to access objects with the accesses they were granted E.g. changing permissions on a share won’t affect currently connected users Lab: View process handles and corresponding granted accesses with Process Explorer

Tokens The main components of a token are: SID of the user SIDs of groups the user account belongs to Privileges assigned to the user (described in next section) Group 1 SID Group n SID Privilege 1 Account SID

Security Identifiers - SIDs Windows uses Security Identifers (SIDs) to identify security principles: Users, Groups of users, Computers, Domains SIDs consist of: A revision level e.g. 1 An identifier-authority value e.g. 5 (SECURITY_NT_AUTHORITY) One or more subauthority values SIDs are generally long enough to be globally statistically unique Setup assigns a computer a SID Users and groups on the local machine are assigned SIDs that are rooted with the computer SID, with a Relative Identifier (RID) at the end Some local users and groups have pre-defined SIDs (eg. World = S-1-1-0) RIDs start at 1000 (built-in account RIDs are pre-defined)

Security Descriptors Descriptors are associated with objects: e.g. files, Registry keys, application-defined Descriptors are variable length Owner SID Defined for POSIX Primary Group DACL pointer SACL pointer DACL SACL

Constructing a Security Descriptor Process Object InitializeSecurityDescriptor() SetSecurityDescriptorOwner() SetSecurityDescriptorGroup() InitializeAcl() AddAccessDeniedAce() ... AddAccessAllowedAce() ... SetSecurityDescriptorDacl() Security Descriptor Access Token User SID Group SID Owner SID Group SID Discretionary ACL Access Control Entry (Denied) ... Access Control Entry (Allowed)

Discretionary Access Control Lists DACLs DACLs consist of zero or more Access Control Entries A security descriptor with no DACL allows all access A security descriptor with an empty (0-entry) DACL denies everybody all access An ACE is either “allow” or “deny” ACE Type SID Read, Write, Delete, ... Access Mask

Access Check ACEs in the DACL are examined in order Does the ACE have a SID matching a SID in the token? If so, do any of the access bits match any remaining desired accesses? If so, what type of ACE is it? Deny: return ACCESS_DENIED Allow: grant the specified accesses and if there are no remaining accesses to grant, return ACCESS_ALLOWED If we get to the end of the DACL and there are remaining desired accesses, return ACCESS_DENIED The Security Reference Monitor (SRM) implements an explicit allow model Exposed to apps through Windows API AccessCheck(), AccessCheckByType(), TrusteeAccessToObject())

Example: Access granted Security Token Used ID: FredMgr Group Ids: Users Mgrs Everyone Privileges: None Desired access read/write File object AccessAllowed FredMgr Read (RX) AccessAllowed Mgrs Special Access(RW) AccessAllowed Everyone Special Access(X) Security descriptor ACE ACE ACE Discretionary Access Control List

Example: Access denied Security Token Used ID: FredMgr Group Ids: Users Mgrs Everyone Privileges: None Desired access read/write File object AccessDenied Mgrs (No Access) AccessAllowed FredMgr Read(RX) AccessAllowed Everyone Write(W) Security descriptor ACE ACE ACE Discretionary Access Control List

Access Check Quiz Is Mark allowed write access? yes Object Token Mark Access Request Authors Write Developers Privilege 1 Privilege n DACL Authors Read Deny Object The first ACE does not apply to the access check since Mark is requesting WRITE access, but the ACE controls READ access. The second ACE does apply since WRITE is a subset of ALL. Note that WRITE does not imply READ. The security system does not understand the semantics of different access types, just their bit representations. Allow Mark Is Mark allowed write access? All yes

ACE Ordering The order of ACEs is important! Example: Low-level security APIs allow the creation of DACLs with ACEs in any order All security editor interfaces and higher-level APIs order ACEs with denies before allows Example: Token Mark Authors Developers DACL Privilege 1 DACL If you consider the access check with the security descriptor on the left access is denied since the first ACE denies read access to members of the Authors group and Mark is a member of the Authors group. The access check for the security descriptor on the right Mark is allowed access because the first ACE allows Mark all access – the system never even looks at the second ACE since it satisfies the access with the first ACE. Authors Read Deny Privilege n Allow Mark All Access Request Allow Authors Read Deny Read Mark All

Access Special Cases An object’s owner can always open an object with WRITE_DACL and READ_DACL permission An account with “take ownership” privilege can claim ownership of any object An account with backup privilege can open any file for reading An account with restore privilege can open any file for write access

Object-specific ACEs Object-specific ACEs can be applied to Directory Services (DS) objects They are just like ACES, but have two GUID fields The GUIDs allow the ACE to: Control access to a property sheet or set on the object Specify the type of child object that can inherit the ACE Specify the type of child object for which the ACE grants or denies creation rights

Controllable Inheritance In NT 4.0, objects only inherit ACEs from a parent container (e.g. Registry key or directory) when they are created No distinction made between inherited and non-inherited ACES No prevention of inheritance In Windows 2000 and higher inheritance is controllable SetNamedSecurityInfoEx and SetSecurityInfoEx Will apply new inheritable ACEs to all child objects (subkeys, files) Directly applied ACEs take precedence over inherited ACEs

Auditing Provides for monitoring of accesses to objects Even if you specify auditing information for an object, it won’t result in audit records unless Auditing is enabled An administrator can enable it with the Local Security Policy Editor (secpol.msc) The security log can be viewed with the Event Log Viewer Like for DACLs, SACL check is made on open after access check Audit check is performed only if system auditing for access check result is on Only ACEs that match access check result are processed Test is similar to DACL test, but a record is written if there is any match Demo: Explorer file auditing settings Owner SID Primary Group DACL pointer SACL pointer DACL SACL

Impersonation Lets an application adopt the security profile another user Used by server applications Impersonation is implemented at the thread level The process token is the “primary token” and is always accessible Each thread can be impersonating a different client Can impersonate with a number of client/server networking APIs – named pipes, RPC, DCOM Client Process Server Server Threads Object

Process and Thread Security Structures Security descriptor Security descriptor Process Access token Access token Security descriptor Security descriptor Security descriptor Thread 1 Thread 2 Access token Access token Process/thread/access token objects have security descriptors Thread 2 has an impersonation token Thread 1 defaults to process access token Lab: Run pview.exe (in \sysint\reskit folder) Select process (explorer.exe) Watch process/thread/p-token/t-token security descriptors Watch process/thread access token (gray button – no thread specific token existent)

Privileges Specify which system actions a process (or thread) can perform Privileges are associated with groups and user accounts There are sets of pre-defined privileges associated with built-in groups (e.g. System, Administrators) Examples include: Backup/Restore Shutdown Debug Take ownership Privileges are disabled by default and must be programmatically turned on with a system call

Powerful Privileges There are several privileges that gives an account that has them full control of a computer: Debug: can open any process, including System processes to Inject code Modify code Read sensitive data Take Ownership: can access any object on the system Replace system files Change security Restore: can replace any file Load Driver Drivers bypass all security Create Token Can spoof any user (locally) Requires use of undocumented Windows API Trusted Computer Base (Act as Part of Operating System) Can create a new logon session with arbitrary SIDs in the token

Further Reading Mark E. Russinovich and David A. Solomon, Microsoft Windows Internals, 4th Edition, Microsoft Press, 2004. Chapter 8, Security Security Descriptors and Access Control (from pp. 506) Account Rights and Privileges (from pp. 516) Johnson M. Hart, Win32 System Programming: A Windows® 2000 Application Developer's Guide, 2nd Edition, Addison-Wesley, 2000. Chapter 5, Securing Win32 objects (from pp. 111)