[IT-Security-2] 存取控制 Access Control

Access Control


Notes from RWTH Aachen University course 
“IT security 2” Wintersemester 2019/20
professor: Meyer, Ulrike Michaela

  • :droplet: 定義
    • 取得或終止requests的過程
      1. 使用或獲得資訊或服務
      2. 進入physical facilities
    • 根據security policy取得官方的准許以使用系統資源
  • Function of Access Control
    • subject: 獲得資源的個體 eg. 人, processes, machines
    • object: 資源 eg. files, programs, processes
    • right: 如何使用 eg. read, write, execute
    • 越靠近application越複雜(complexity)
    • 越靠近硬體越可靠(reliability)


    • :apple: Application level
      • 較複雜且豐富的security policy
    • :apple: Middleware level
      • 如database, bookkeeping packages
      • 提供機制加強(enforce) access control
    • :apple: Operating System level
      • Middleware會用OS的資源
      • files, programs, communication ports
    • :apple: Hardware level
      • processors, memory management software

:cactus: Access Control Model

  • PrincipleDo operationReference monitorObject [ACL]
    SourceRequestGuardResource
  • Access Control包含
    • Authentication priciple
    • Authorization determines who

:cactus: Access Operations

  • :droplet: Example 1: only two access operations
    • Observe: 看object有什麼內容
    • Alter: 修改object
  • :droplet: Example 2: Bell-LaPadula Model
    • Execute
    • Append 只寫不讀
      • log files
    • Write 有讀 (observe和alter結合)

:cactus: Type of Access Control

  • :droplet: Discretionary(全權委託) Access Control (DAC)
    • 定義一個owner
    • owner決定誰可以取得object或定義access right
  • :droplet: Mandatory(強制性) Access Control (MAC)
    • 一個 system-wide policy 規定object的access
  • :droplet: Role Based Access Control(RBAC)
    • 定義每個使用者(subject)的roles
  • :droplet: Attribute Based Access Control(ABAC)
    • 控制每個使用者(subject)相關的attributes
  • Access control的機制:
    • 認證使用者: password, Kerberos
    • 調解(Mediate)使用者對file, ports, processes的權限

:cactus: Access Control Matrix

  • \(\text{A=a[o,s]}\)
  • file 1file 2
    proccess 1read, write, ownread
    proccess 2appendread, own

Column = 資源
Row = 使用者
Entries = 權限

  • 缺點:
    • subject跟object通常非常大量
    • 通常entries是
      • 空白的: 因為沒有權限
      • 相同的: 因為預設
    • 需要小心的storage management (creation/ deletion)

:cactus: Access Control Lists

  • 儲存Access Control Matrix的每個 Column

  • 每個list: \(\text{I=\{(s,r):s}\in S\text{,r}\subset R\text{\}}\)

  • example

  • \(\text{acl(file1)={(process 1, {read,write,own}),(process 2,{append})}}\)

  • :droplet: Abbreviations(縮減) of ACLs

    • 將使用者分成不同的群組(classes)
    • example: Unix
      • owner, group, others
      • 但較不精準(loss of granularity)
    • 解決方法:
      • 允許定義所有access,但預設是compressed版本
  • :droplet: Extended Permissions used in AIX

    • Specify 複寫(overwrite)原來的permissions
    • Permit 明確給定rights給使用者
    • Deny 明確拒絕rights給使用者
  • :droplet: Creation and Maintenance

    • 不同的實作取決於
      • 哪些使用者可以修改ACL
      • root的存在
      • 支援groups
      • 相反的權限
      • 應用程式預設
  • :droplet: Which subjects can modify ACL

    • Approach 1:
      • Creator
      • Unix
    • Approach 2:
      • anyone with paticular right
      • database management system R
      • 可以access table的人可以給別的user rights
  • :droplet: Do ACLs Apply to a Privileged user

    • 通常有限(limited fashion)
  • :droplet: Groups and Wildcards

    • 通常支援以簡化ACL
    • Group有兩個目的
      • Refine使用者的性質
      • 代表一群使用者
    • Wildcards
      • \(\text{(holly : * : r)}\) 表示 holly 可以 read 不管他在哪個group
      • \(\text{(* : sys : r)}\) 表示 group ID sys 的可以 read
  • :droplet: Resolving conflicts

    • 一個ACL給同個使用者不同的權限
    • 解法
      • 若一個允許則允許
      • 若一個拒絕則拒絕
        • AIX
      • 套用第一個entry
        • Cisco
  • :droplet: Revocation of rights

    • 若被ownership控制
      • 則owner決定revocation
    • 若被particular rights控制
      • revocation較難
        • 若A給B right,A要撤回
        • 若B又給M right
      • 要紀錄grantor(給right的人)、timestamp
  • :droplet: Capabilities

    • Access Control Matrix的 Row
    • 使用者對所有檔案的權限的list
    • 創造新的object的使用者,要創造其他使用者的capabilities
    • 當呼叫其他使用者時,傳遞此capacity給他
    • 缺點
      • 難以overview
      • 難以revocation
        • OS要handle
        • 每個使用者都要追蹤自己的capability
  • :droplet: Authorization Table

    • ACL和capability的arbitrate(協調)
    SubjectrightObject
    Aownfile1
    Areadfile1
    Awritefile1
    • sort subject可以得capability
    • sort object可以得ACL

:cactus: Unix-based Systems

  • 所有Unix的file都用 index node (inode) 被OS管理
  • inode定義file的屬性、權限和其他控制資訊
  • Directory(資料夾)
    • 檔案名稱
    • inodes的pointer
  • 每個object:
    owner, group, others
  • 權限:
    rwx = read(4), write(2), execute(1)
  • d: directory
    -: not
  • chmod 754 filename
    filename指定rwx r-x r-- 權限

    7=4+2+1
    5=4+1
    4=4

  • User ID (uid)
    • Real user ID (ruid)
      • identify the owner
    • Effective user ID (euid)
      • 用在多數 access control
      • 可以被 system call 指定 (setuid)
    • Saved user ID (suid)
      • 前一個 user ID
  • Group ID (gid)
  • Assigning user ID
    • 若 process 是被 fork: 繼承三個user ID
    • 若被其他process執行,除非設 set-user-ID ,否則為新的 process的user ID
  • Dropping Privileges
    • 取得權限:指定一個 privileged user ID 到 euid
    • 丟棄:
      • 短暫: privileged user ID不存在 euid 但存在 suid
      • 永久:三個 user ID都不存
    • :computer: setuid
      • 早期Unix只有這種
      • 如果 euid == 0,設定ruid 及 euid為特定值
      • 否則設euidruid
        \[\text{setuid(s)}=\begin{cases}\text{euid = ruid = s, if euid == 0}\\ \text{euid = s, otherwise}\end{cases}\]
      • 缺點: 沒有上述的drop機制
    • :comet: seteuid in System V
      • 可設定euid為任意user ID
      • 否則設euidruidsuid
        \[\text{seteuid(s)}=\begin{cases}\text{euid = s (any user ID), if euid == 0}\\ \text{euid = ruid / suid, otherwise}\end{cases}\]
    • :baby_bottle: setruid in BSD
      • ruideuid可以被設為任意user ID
      • 否則ruid或euid被設為另外一個
        \[\text{setruid(s)}=\begin{cases}\text{euid = ruid = s (any user ID), if euid == 0}\\ \text{euid = ruid / ruid = euid, otherwise}\end{cases}\]
  • :droplet: Inherited problem in modern system
    • 有些系統用 setresuid,可以設定三種user ID
    • 危險:
      • non-root user執行root權限,suid==euid==0
      • 攻擊者permanently drop root權限
      • 新版setuid只允許drop euid不允許drop suid
  • :droplet: Extended Access Control List
    • Example: FreeBSD
      • 9 bits ACL: owner, group, others
      • 多一個特定權限: named users/groups,多3 bits
      • owner, named user, groups, others
        most closely matching one(最多符合)允許,則取得權限

:cactus: Role-based Access Control(RBAC)

  • 定義 role
  • 資源權限設給 role,使用者被分配不同的 role (根據responsibilities)
  • RBAC Access Matrix(多一個Role維度)
User\RoleR1R2
U1X
U2X
U3X
Role\ObjectR1R2
R1control
R2w
R3Owner,r
  • :droplet: \(\text{RBAC}_0,\text{RBAC}_1,\text{RBAC}_2,\text{RBAC}_3\)

  • \(\text{RBAC}_0\)

    • User
    • Role Job function
    • Permission 允許使用某資源
    • Session 使用者和subset of roles對應到指定的使用者
      • 使用者只跟需要的role建立session
      • concept of least privilege
  • \(\text{RBAC}_1\)

    • 階層(Hierarchy)
      • subordinate(下屬)
  • \(\text{RBAC}_2\)

    • Constraints
      • 定義mutually exclusive(獨家) roles
      • 限制cardinality of a role(role的人數)
  • \(\text{RBAC}_3\)

    • \(\text{RBAC}_1\) + \(\text{RBAC}_2\)

:cactus: Attribute-based Access Control

  • 用condition表示authorizations
    • eg. creator
  • 好處:
    • 彈性
    • 有表達性(expressiveness)
  • 缺點:
    • 計算predicated(謂語)的performance影響
  • web services/ cloud computing
  • :droplet: Attributes
    • Subject attributes
      • cause information/ change
    • Object attributes
      • passive
    • Environment attributes
      • environment or context
  • :droplet: Attribute Evaluation
    • ABAC仰賴計算attribute (subject/object given environment)
    • 精細


Readings
William Stallings and Lawrie Brown, Computer Security, 2015
    § Chapter 4: Access Control
Ross Anderson: Security Engineering, 2007
    § Chapter 4: Access Control
Matt Bishop: Introduction to Computer Security, 2004
    § Chapter 2: Access Control Matrix
    § Chapter 14: Access Control Mechanisms
Further Reading:
§Dean et al: Setuid Demystified, 2002

留言

這個網誌中的熱門文章