Windows ACL Model 基本概述
基本概念
- SID:Secure Identifier(安全辨別符),每個使用者和賬戶組都有一個唯一的SID(通常情況下唯一)。它是辨別使用者、使用者組和計算機賬戶唯一的号碼,
- Access Token:與特定的windows賬戶關聯,賬戶環境下啟動的所有程序都會獲得該令牌的副本,程序中的線程預設獲得這個令牌。由關聯賬戶的SID、目前登入賬戶所屬組的SID清單、受限制的SID清單、目前登入賬戶與所屬組的Privilege清單組成。
- Account SID
- Group SID
- logon SID
- privileges administrator 授權給user的特權,
- Account SID
- Security Descriptor:安全描述符,與被通路對象關聯。由對象所有者的SID、group SID、DACL、SACL組成。DACL描述允許或拒絕特定使用者或組的某些通路權限,它包含零個或多個通路控制實體(ACE,Access Control Entry)
- owner SID
- primary group SID
-
DACL
discretionary access control list.
- SACL
- system ACL (SACL). SACL 主要包括為通路嘗試生成系統監控報告的權限。每個SACE都包括一個trustee,一個權限集合, 以及一個flag結合來表示通路成功和通路失事件,哪些需要被記錄,或者全部記錄。所有的監聽消息最終都寫入event-log
The system writes audit messages to the security event log. For information about accessing the records in a security event log, see Event Logging.
- ACE 通路控制實體,用于指定特定使用者/組的通路權限
- user or group SID
- Access Mask object 通路權限
- ACE Flag 是否讓子目錄繼承
- ACE Type Allow or Deny
Windows ACL簡析
windows 通路控制的基本流程
- 當使用者登入系統成功後, 系統會為使用者生成一個accessToken。該使用者調用的每一個程序都會有一個AccessToken copy。當程序要通路某個securable object 時,系統會比對accessToken擁有的權限(previlages 是否能通路securable object)
- 如果安全描述符中不存在DACL,則系統會允許線程進行通路。如果存在DACL,系統會順序周遊DACL中的每個ACE,檢查ACE中的SID線上程的AccessTkoen中是否存在。以通路者中的User SID或Group SID作為關鍵字查詢被通路對象中的DACL。順序:先查詢類型為DENY的ACE,若命中且權限符合則通路拒絕;未命中再在ALLOWED類型的ACE中查詢,若命中且類型符合則可以通路;以上兩步後還沒命中那麼通路拒絕
Windows ACL簡析
ACE
order of ACE
The following steps describe the preferred order:
- 顯式ACE在繼承ACE之前
- 對于顯式ACE denyACE 在 allowACE 之前
- 繼承的ACE按照繼承樹的倒序排列。先父節點ACE,再祖先節點ACE。
- 對于同一層的ACE,denyACE在AllowACE 之前
Automatic Propagation of Inheritable ACEs
The system uses the following rules when propagating inherited ACEs to child objects:
- 如果子對象沒有DACL,子對象直接繼承ACE
- 如果子對象有空DACL, 子對象直接繼承ACE
- 如果從父對象删除可繼承ACE, 删除自對象繼承的該ACE副本
- 如果自動删除造成自對象的DACL為空, 保留白DACL
空DACL和沒有DACL的差別在于,空DACL沒有任何權限, 沒有DACL表示允許任何操作。
ACE inheritance flag(待分析)
父 ACE flag | 對子ACL 的影響 | |
---|---|---|
OBJECT_INHERIT_ACE | 隻有子檔案繼承 | |
CONTAINER_INHERIT_ACE | 隻有子目錄繼承 | |
CONTAINER_INHERIT_ACE and OBJECT_INHERIT_ACE | 子目錄和自檔案都繼承 | |
No inheritance flags | 不繼承 | . |
Access mask
- access mask 和權限的對應關系
Windows ACL簡析
- Generic Access Rights, 所有securable object 通用權限
Constant | Generic meaning |
---|---|
GENERIC_ALL All | possible access rights |
GENERIC_EXECUTE | Execute access |
GENERIC_READ | Read access |
GENERIC_WRITE | Write access |
- Standard Access right,大多數securable object 通用權限
Meaning | |
---|---|
DELETE | The right to delete the object. |
READ_CONTROL | The right to read the information in the object's security descriptor, not including the information in the system access control list (SACL). |
SYNCHRONIZE | The right to use the object for synchronization. This enables a thread to wait until the object is in the signaled state. Some object types do not support this access right. |
WRITE_DAC | The right to modify the discretionary access control list (DACL) in the object's security descriptor. |
WRITE_OWNER | The right to change the owner in the object's security descriptor. |