🔑 Chapter 9 — Access Control (Authorization) Cheat Sheet
🗺️ Big Picture
Access Control = Who can do What to Which resource
│
├── Core Concepts → Subjects, Objects, Access Rights
├── 4 Policy Types → DAC → MAC → RBAC → ABAC
│ ├── DAC → Owner decides (Access Matrix, ACL, Capability List)
│ ├── MAC → Security labels + clearances (Read Down / Write Up)
│ ├── RBAC → Job roles (RBAC₀ → RBAC₃, SSD, DSD)
│ └── ABAC → Attributes of user + resource + environment (XACML)
├── UNIX → inodes, 12 protection bits
├── Least Privilege → PoLP, Zero-Standing Privilege (ZSP)
└── ICAM → Identity + Credential + Access Mgmt + Federation
1. Access Control Flow
User ──► Authentication Function ──► Access Control Function ──► System Resources
▲
Security Administrator ◄──► Authorization Database
▲
Auditing
RFC 4949: Security = measures that implement and assure access control service.
2. Subjects, Objects, and Access Rights
| Term | Definition | Examples |
|---|---|---|
| Subject | Entity capable of accessing objects | Owner, Group, World |
| Object | Resource to which access is controlled | File, DB table, process |
| Access Right | How a subject may access an object | Read, Write, Execute, Delete, Create, Search |
Every access control decision involves these three: Subject → Access Right → Object
3. The Four Access Control Policies
| Policy | Basis for Decision | Granularity | Best For |
|---|---|---|---|
| DAC | Identity of the requestor | Medium | File systems, shared resources |
| MAC | Security labels + clearances | Low (rigid) | Military, government, classified data |
| RBAC | Assigned job role | Coarse | Enterprise, most org environments |
| ABAC | Attributes of user + resource + environment | Fine | Cloud, complex conditional access |
4. Discretionary Access Control (DAC)
- Owner of a resource decides who can access it
- The owner is usually the creator of the resource
🗂️ Analogy: Like Google Drive — the file creator decides who can view or edit it.
Access Matrix
Two-dimensional table: rows = subjects, columns = objects, cells = permissions
| Subjects | File 1 | File 2 | File 3 | File 4 |
|---|---|---|---|---|
| User A | Own, R, W | — | Own, R, W | — |
| User B | R | Own, R, W | W | R |
| User C | R, W | R | — | Own, R, W |
Three Representations of the Same Data ⭐ Exam Note
อาจารย์ให้ Access Matrix มา อยากให้วาดเป็น ACL, Cap List ใน Final Exam!
(a) Access Control List (ACL) — per FILE, lists users with permissions
File 1 → A: Own/R/W, B: R, C: R/W
File 2 → B: Own/R/W, C: R
File 3 → A: Own/R/W, B: W
File 4 → B: R, C: Own/R/W
🗃️ Analogy: A sign on the door listing who can enter and what they can do.
(b) Capability List — per USER, lists objects with permissions
User A → File 1: Own/R/W, File 3: Own/R/W
User B → File 1: R, File 2: Own/R/W, File 3: W, File 4: R
User C → File 1: R/W, File 2: R, File 4: Own/R/W
🎫 Analogy: A keychain — each user holds their own set of keys to specific files.
(c) Authorization Table — flat list of (Subject, Access Mode, Object) tuples
Every single permission is a row: e.g., A | Own | File 1, A | Read | File 1, B | Read | File 1 …
Extended Access Matrix
- Subjects can also be objects (e.g., has control over )
- Adds process operations: wakeup, stop, execute
- Adds device operations: seek
- Copy flag (
*) — permission marked with*can be transferred to others
5. Protection Domains
- A set of objects + access rights to those objects
- One row of the access matrix = one protection domain
- User can spawn processes with a subset of their own access rights
| Mode | What's accessible |
|---|---|
| User mode | Certain memory areas protected; certain instructions cannot run |
| Kernel mode | Privileged instructions (I/O) + protected memory accessible |
🏢 Analogy: Employee badge lets you into the lobby. Only IT badge opens the server room. Even with the server room access, you can't use equipment reserved for the sysadmin.
6. UNIX File Access Control
Inodes (Index Nodes)
- Every UNIX file has an inode storing: file attributes, permissions, control info
- Multiple file names can point to the same inode
- When a file is opened → inode loaded into main memory
- Directories = hierarchical tree containing file names + pointers to inodes
UNIX Permission Format — 12 Protection Bits
rw- r-- ---
[Owner] [Group] [Other]
| Bit | Meaning |
|---|---|
r | Read |
w | Write |
x | Execute |
- | No permission |
Three classes: Owner / Group / Other (World)
Example: rw-r-----
- Owner: Read + Write
- Group: Read only
- Other: No access
📚 Analogy: Library card system — owner can borrow and return books, group can only read in-library, others have no access.
7. Mandatory Access Control (MAC)
- Assigns a security level to all information
- Assigns a security clearance to each user
- Enforces access based on label vs. clearance comparison
- More secure than DAC — owner cannot override the policy
Read Down / Write Up Rules
| Action | Rule | Reason |
|---|---|---|
| Read Down | Top Secret can read Secret or below | High-clearance user can see lower data |
| Write Up | Top Secret cannot write to Unclassified | Prevents data leaking downward |
🎖️ Analogy: A "Top Secret" cleared officer can read "Secret" documents, but cannot write to a "Classified" file — otherwise they'd be leaking data down the classification chain.
Security levels (example): Unclassified → Confidential → Secret → Top Secret
8. Role-Based Access Control (RBAC)
- Access based on assigned job role, not individual identity
- Roles defined by job functions: Accountant, IT Manager, CEO, Programmer, Tester, etc.
- Permissions defined by job authority and responsibilities
🏥 Analogy: Hospital — nurse can administer medication, doctor can prescribe, janitor cannot access patient records. When someone leaves their role → permissions automatically gone.
Key Advantage
→ Assign users to roles, not permissions directly → massive reduction in admin overhead.
RBAC Model Family (RBAC₀ → RBAC₃)
| Model | = | What it adds |
|---|---|---|
| Core | Users, Roles, Sessions, Permissions (minimum required) | |
| Core + Hierarchy | Role inheritance (e.g., Senior Doctor inherits Doctor permissions) | |
| Core + Constraints | SSD/DSD — conflict-of-interest prevention | |
| Core + Hierarchy + Constraints | Full consolidated model |
— Core RBAC
Entities:
| Entity | Description |
|---|---|
| USERS | Human or system principals |
| ROLES | Job functions |
| SESSIONS | A user's active context |
| OPS | Operations (read, write, execute, insert, delete…) |
| OBS | Objects (files, DB records) |
| PRMS | Permissions = (OPS × OBS) pairs |
Relationships:
- UA (User Assignment): many-to-many (user ↔ role)
- PA (Permission Assignment): many-to-many (role ↔ permission)
- user_session: one user → many sessions
- session_roles: roles activated in a session
— Role Hierarchy
- Roles can inherit permissions from other roles
- General hierarchy — multiple inheritance (role can inherit from multiple parents)
- Limited hierarchy — one immediate descendant only
Cardiologist
↑ inherits from
Specialist
↑ inherits from
Doctor Intern
— Constraints (SSD & DSD)
Static Separation of Duty (SSD)
- User cannot be authorized for both conflicting roles — permanently
- Prevents conflict of interest at the authorization level
Example: A bank employee cannot hold both Teller AND Auditor roles.
Dynamic Separation of Duty (DSD)
- User cannot activate both conflicting roles in the same session
- Constraint enforced at runtime, not assignment level
- More operationally flexible than SSD
Example: A user can hold both Teller and Account Holder roles, but cannot act as both in the same session.
SSD vs. DSD Comparison
| Aspect | SSD | DSD |
|---|---|---|
| Constraint scope | Authorization level (permanent) | Session level (runtime) |
| Example | Teller ≠ Auditor (cannot hold both) | Teller ≠ Account Holder (cannot activate simultaneously) |
| Flexibility | Less flexible | More flexible |
🚗 Analogy: SSD = You can never hold both a driver's license and a taxi permit. DSD = You can hold both, but can't use them at the same time.
RBAC Constraints
| Constraint Type | Rule | Example |
|---|---|---|
| Mutually Exclusive Roles | User assigned to only one role in the set | Cannot be both Maker and Approver |
| Cardinality | Max number of users per role | Approver: max 3, Maker: max 10 |
| Prerequisite Roles | Must hold role X before getting role Y | TA role requires being a graduate student first |
9. Least Privilege Principle (PoLP) ⭐ Exam Note
- Roles contain the minimum permissions to perform their function
- Users assigned to roles that allow only what's required
- No single role given more permission than necessary
Examples:
- A database retrieval account should NOT have admin rights
- A code developer should NOT have access to financial data
Zero-Standing Privilege (ZSP) ⭐⭐ Exam Note — Very Important!
| Aspect | Detail |
|---|---|
| Core Goal | Remove ALL persistent privileged access to minimize attack surface |
| How it works | User requests access for a specific task → automatically revoked after set time |
| Benefits | Reduces cyber risk, aids GDPR/HIPAA compliance, mitigates insider threats |
| Implementation | Requires PAM (Privileged Access Management) solution to manage, monitor, audit |
| Challenges | Reduced productivity, complex implementation, needs robust automated workflows |
🏦 Analogy: Instead of giving a bank teller a permanent key to the vault, they request access before each shift → key expires when the shift ends → nobody can steal a key that doesn't exist.
10. Attribute-Based Access Control (ABAC)
- Access decisions based on attributes of user + resource + environment
- Fine-grained (individual level) vs. RBAC's coarse-grained (role level)
- Implemented via XACML (eXtensible Access Control Markup Language)
- Can enforce DAC, RBAC, and MAC concepts all in one system
🎯 Analogy: Instead of "nurses can access all patient records," ABAC says "a nurse from Ward-A can access records of patients in Ward-A only, during working hours, from a hospital device."
Four Attribute Types
| Attribute | What it describes | Examples |
|---|---|---|
| Subject | The user making the request | Username, Job Title, Department, Clearance |
| Object | The resource being accessed | Type, Owner, Classification, Date Created |
| Environment | Context of the request | Location, Time, Device, Day of week |
| Action | What is being done | Read, Write, View, Transfer, Delete |
How ABAC Works
Subject makes request
↓
Access Control Mechanism evaluates:
├── Access Control Policy (rules)
├── Subject Attributes
├── Object Attributes
└── Environmental Conditions
↓
Decision: GRANT ✅ or DENY ❌
↓
Enforced on the Object
ABAC Policy Examples
Example 1 — Access Granted ✅
- Object: Type = "US Sales data"
- Subject: Department = "US Marketing"
- Environment: Location = "New York, US"
- Policy: "US Sales data accessible by US Marketing from a US location"
- → All attributes match → Access Granted
Example 2 — Access Denied ❌
- Object: Type = "US Sales data"
- Subject: Department = "US Marketing"
- Environment: Location = "London, UK"
- Policy: Same as above
- → Location doesn't match → Access Denied
RBAC vs. ABAC Comparison
| Aspect | RBAC | ABAC |
|---|---|---|
| Granularity | Coarse-grained (role level) | Fine-grained (individual user level) |
| Implementation | Easy — just assign roles | More difficult — rules + attribute evaluation |
| Flexibility | Less flexible | Very flexible |
| Policy format | Role-based rules, DB | Rules engine, XACML |
| Use case | Standard enterprise permissions | Cloud, conditional access, complex orgs |
11. ICAM — Identity, Credential, and Access Management
A comprehensive US government framework for managing digital identities, credentials, and access control.
Three Core Components
1. Identity Management
- Assigns attributes to a digital identity and connects it to an individual / NPE (Non-Person Entity)
- Goal: Establish a trustworthy digital identity independent of any specific application
- Lifecycle management includes:
- Protecting personal identity information
- Controlling access to identity data
- Sharing authoritative identity data with applications
- Revoking enterprise identities
2. Credential Management
A credential = object that authoritatively binds an identity to a token (e.g., smart card, private key, digital certificate)
5 Logical Components:
① Specify need for credential
② Credential Enrollment
③ Credential Generation
④ Credential Issuance
⑤ Maintenance
3. Access Management
- Manages how entities are granted access to resources (logical + physical)
- Three support elements:
| Element | Role |
|---|---|
| Resource management | Define rules for what credential/conditions are required for a resource |
| Privilege management | Establish and maintain entitlement attributes tied to a digital identity |
| Policy management | Govern what is allowable/unallowable in access transactions |
Identity Federation
Technology, standards, policies, and processes allowing an organization to trust digital identities created by another organization.
🎓 Analogy: A university student ID accepted at a partner university library — you trust the other institution's verification process.
Flow:
User → Service Provider (SP) → Redirect Auth → Identity Provider (IdP)
↓
ID Token issued
↓
Token used to access multiple services ✅
Real-World Examples:
- AWS IAM Federation
- Azure AD Federation
- Google Cloud Identity
Zero Trust Identity
Access decisions depend on: Identity + Device + Location + Behavior
Federation Attacks & Prevention
| Attack | Prevention |
|---|---|
| Token replay attacks | Short token lifetime + Nonce (prevent reuse) |
| Man-in-the-middle | TLS everywhere + Strict Certificate Validation |
| Assertion/Token forgery | Sign token + Encrypted token payload + Token binding (to device/TLS session) |
Future Directions of Identity Federation
- DID (Decentralized Identity)
- SSI (Self-Sovereign Identity)
- Blockchain-based identity systems
⚡ Key Facts to Remember
| Fact | Detail |
|---|---|
| DAC | Owner decides access — owner can grant to others |
| MAC | Security labels vs. clearances — policy cannot be overridden by owner |
| MAC Read Down | clearance ≥ classification → can read |
| MAC Write Up | clearance ≤ classification → can write (prevents leakage down) |
| RBAC key advantage | Users change, roles don't — reduces admin overhead |
| ACL | Keyed by file/object — lists users with permissions |
| Capability List | Keyed by user — lists files with permissions |
| Core — Users, Roles, Sessions, Permissions | |
| + Role Hierarchy (inheritance) | |
| + Constraints (SSD/DSD) | |
| Everything — Hierarchy + Constraints | |
| SSD | Permanent — user cannot hold both conflicting roles |
| DSD | Runtime — user cannot activate both in same session |
| PoLP ⭐ | Give ONLY minimum permissions needed — do not over-privilege |
| ZSP ⭐⭐ | No permanent admin rights — request → grant → auto-revoke |
| ABAC granularity | Fine-grained (individual level) vs. RBAC coarse-grained (role level) |
| ABAC = | Subject attrs + Object attrs + Environment attrs + Action attrs |
| XACML | XML-based policy language for ABAC |
| ICAM | Identity Mgmt + Credential Mgmt + Access Mgmt |
| Identity Federation | Trust identity from another org; get token from IdP → access services |
| Zero Trust | Never trust, always verify — identity + device + location + behavior |
| inode | UNIX file control structure — stores permissions for Owner/Group/Other |
| UNIX 12 protection bits | r/w/x for Owner, Group, Other = 9 bits + 3 special bits |