Protection and Access Control
In an operating system, protection defines the boundaries and policies that regulate how programs, processes, and users access system resources like memory, files, and CPU time. Access control is the practical implementation of these boundaries, deciding whether a specific request to read, write, or execute an object should be granted. Working hand-in-hand, mechanisms enforce the rules (the how), while policies decide what rules to enforce (the what), preventing faulty or malicious code from crashing the system or compromising confidential data.
<h3>Definitions & Key Points</h3><h4>1. Protection</h4><h2><!--StartFragment--><ul><li><p><b>Definition:</b> A built-in operating system facility that controls how active entities (processes, threads, users) access physical or logical system resources (files, I/O devices, memory addresses).</p></li><li><p><b>Key Points:</b></p><ul><li><p>Ensures that only processes holding explicit authorization can operate on an object.</p></li><li><p>Enforces the <b>Principle of Least Privilege</b>, granting processes only the minimal permissions needed to complete their task.</p></li><li><p>Separates hardware execution levels using supervisor/kernel mode and user mode.</p></li></ul></li></ul></h2><h4>2. Access Control</h4><h2><ul><li><p><b>Definition:</b> The security discipline and framework within the OS that determines, verifies, and mediates the rights of specific users or processes to interact with target resources.</p></li><li><p><b>Key Points:</b></p><ul><li><p>Operates across three primary stages: <b>Authentication</b> (verifying identity), <b>Authorization</b> (checking permissions), and <b>Auditing</b> (logging actions).</p></li><li><p>Implemented through models such as:</p><ul><li><p><b>Discretionary Access Control (DAC):</b> Resource owners set permissions (e.g., standard Unix/Linux <code data-path-to-node="7,1,1,1,1,0,0" data-index-in-node="95">chmod</code> permissions).</p></li><li><p><b>Mandatory Access Control (MAC):</b> Central security policy dictates access based on system-assigned sensitivity labels (e.g., SELinux).</p></li><li><p><b>Role-Based Access Control (RBAC):</b> Permissions are assigned to predefined organizational roles rather than individual users.</p></li></ul></li></ul></li></ul></h2><h4>3. Mechanism vs. Policy</h4><h2><ul><li><p><b>Definition:</b> A fundamental design rule in OS security that separates <i>how</i> a security feature is implemented from <i>what</i> security decisions are made.</p></li><li><p><b>Key Points:</b></p><ul><li><p><b>Mechanism:</b> The underlying technical framework used to enforce rules (e.g., Access Control Lists (ACLs), Capability Lists, memory protection keys, page table permission bits).</p></li><li><p><b>Policy:</b> The actual choice of rules applied in a given environment (e.g., "User A cannot read File X", "Only root can modify network settings").</p></li><li><p>Decoupling mechanism from policy allows system administrators to adjust security rules dynamically without rewriting kernel code.</p></li></ul></li></ul></h2><h3>Significance</h3><h2><ul><li><p><b>System Stability:</b> Keeps a buggy or crashing user program isolated inside its own address space, preventing kernel panics or blue-screen crashes.</p></li><li><p><b>Multi-User Confidentiality:</b> Allows multiple users to safely share the same physical server or workstation without viewing or corrupting each other's files.</p></li><li><p><b>Integrity & Trust:</b> Protects critical kernel structures, system binaries, and runtime memory from unauthorized tampering or malware injection.</p></li><li><p><b>Resource Fair-Sharing:</b> Prevents rogue processes from starving other programs of system components like CPU time, swap space, or network bandwidth.</p></li></ul></h2><h3>Advantages</h3><h2><ul><li><p><b>Fault Isolation:</b> Errors in one application are contained to that application and do not affect the rest of the OS.</p></li><li><p><b>Granular Security:</b> Administrators can fine-tune read, write, execute, and append permissions down to specific users, groups, or system daemons.</p></li><li><p><b>Compliance & Forensics:</b> Built-in logging and access mediation generate audit trails needed for legal compliance and security investigations.</p></li><li><p><b>Flexibility:</b> Clear separation of mechanism and policy makes it straightforward to update access rules as organizational needs evolve.</p></li></ul></h2><h3>Disadvantages</h3><h2><ul><li><p><b>Performance Overhead:</b> Every privileged system call, memory reference, and file access must be checked, adding CPU and latency overhead.</p></li><li><p><b>Configuration Complexity:</b> Misconfigured permissions can silently create major security vulnerabilities.</p></li><li><p><b>Usability Friction:</b> Strict policies can disrupt legitimate workflows, requiring repeated privilege escalation prompts or complex administrative overrides.</p></li><li><p><b>System Footprint:</b> Storing security metadata (such as large ACLs, capability tokens, and user permission matrices) consumes memory and storage.</p></li></ul></h2>
