🎓 BookMCQ
← Back to 14. Protection

📝 Principles of Protection in Operating System

Foundational Rules for Restricting Resource Access

Protection principles guide the design of operating system mechanisms that regulate access to resources. A computer system contains hardware and software objects, such as files, memory regions, devices, and processes, which must be accessed only by authorised users and programs. A protection mechanism defines how access rights are assigned, checked, and enforced, while a protection policy determines which operations should be permitted. The principle of least privilege provides the central foundation: every user, process, or system component should receive only the permissions necessary to perform its assigned work. Other established design principles include fail-safe defaults, complete mediation, separation of privilege, economy of mechanism, open design, least common mechanism, and psychological acceptability. Together, these principles help limit unauthorised access, reduce the consequences of software failures, and make protection mechanisms easier to verify and manage.

Eight Principles of Protection in Operating SystemsA diagram showing how processes use protection domains and access checks to reach protected operating system resources, followed by eight classic protection design principles.Principles of Protection in Operating SystemsControlling access through permissions, protection domains and secure design principlesHow Operating System Protection WorksUser / ProcessRequests access to a resourceProtection DomainDefines objects and allowed rightsAccess CheckAuthorised or deniedProtectedObjectsExample objects: files, memory, devices and system resourcesEight Classic Protection Design Principles1. Least PrivilegeGive each user and processonly the permissions neededto complete its task.2. Fail-Safe DefaultsDeny access unless explicitpermission has been granted.Default state: deny.3. Complete MediationCheck every protected accessto ensure authority hasnot been bypassed.4. Separation of PrivilegeRequire multiple conditionsor independent approvalsfor sensitive operations.5. Economy of MechanismKeep protection mechanismssmall, simple and easierto examine and verify.6. Open DesignDo not rely on keeping thesystem design secret tomaintain its security.7. Least Common MechanismMinimise mechanisms sharedbetween users to reduceunintended interactions.8. Psychological AcceptabilityMake protection mechanismseasy enough to use correctlyand consistently.Central Goal: Minimise Unauthorised Access and Limit the Damage of CompromiseEffective protection combines restricted permissions, reliable checks and understandable mechanisms.Operating Systems • Protection Design Principles
The eight classic protection design principles and the relationship between processes, protection domains, access decisions and system resources. The illustration rearranges vertically on mobile screens.

Why Broad and Permanent Privileges Are Dangerous

Systems that grant excessive permissions make programming errors and compromised accounts more damaging. A single unrestricted process may alter unrelated files, access confidential information, or interfere with kernel resources. The operating system therefore assigns processes to protection domains that define the objects they can access and the operations they can perform. The need-to-know principle further limits access to information required for the current task, rather than allowing a process to access every resource available to its user. Privileges may be static, remaining associated with a process or user for a defined period, or dynamic, changing through an authorised domain switch when additional permissions are temporarily required. Protection design also considers permission granularity: broad permission groups are simpler to administer, whereas fine-grained controls provide more precise restrictions but require additional management. These measures limit the damage that can result from stolen credentials, software defects, and misuse of privileged processes.

Applying Least Privilege and Complete Mediation

Least privilege gives each process only the permissions required for its current task and should also limit how long those permissions remain available. Complete mediation requires the protection mechanism to verify authority whenever a protected object is accessed, preventing an unauthorised operation from bypassing the applicable control. Fail-safe defaults establish a secure starting point by denying access unless an explicit permission allows the requested operation. Separation of privilege requires more than one condition or independent authority for particularly sensitive actions, such as approving a financial transfer through separate authentication and approval stages. Economy of mechanism keeps the protection code and its interfaces small enough to inspect and verify. Open design means that the system's security should not depend on concealing its architecture or implementation; passwords, authentication secrets, and cryptographic keys remain confidential instead. Least common mechanism reduces the amount of functionality shared between users, while psychological acceptability encourages protection controls that are understandable and practical enough for people to use correctly. These principles complement one another rather than operating as isolated rules.

Example of Limiting a Service Account

Consider a backup service that must read files from one designated source directory and write copies to a separate backup location. A least-privilege configuration grants the service read permission for the required source files and write permission for the backup destination, without automatically giving it administrator access or permission to change unrelated system settings. Fail-safe defaults deny access to other directories unless an authorised rule grants it. Complete mediation ensures that protected operations are subjected to the required access-control decision, while separation of privilege can require an independent administrator approval before the service's permissions are expanded. If the backup process is compromised, its restricted protection domain limits the resources an attacker can reach. This example shows how narrowly defined access rights reduce the possible consequences of a compromised service without preventing its legitimate backup operations.

Reducing Exposure Without Preventing Legitimate Work

Protection principles reduce the consequences of software defects, stolen credentials, and malicious activity, but their implementation also involves practical trade-offs. Coarse-grained permission management uses broad roles or groups and is relatively simple to administer, whereas fine-grained controls such as access-control lists can assign different operations to individual users and resources with greater precision. Fine-grained checks improve control but may increase policy-management complexity and processing overhead. Least common mechanism reduces unnecessary sharing between protection domains, while economy of mechanism makes critical controls easier to inspect and maintain. Psychological acceptability is equally important because confusing or excessively restrictive mechanisms can encourage users to bypass legitimate protection procedures. Open design supports independent review of security mechanisms without depending on secrecy of the implementation. A well-designed operating system therefore aims for enforceable permissions, minimal unnecessary privileges, understandable controls, and an appropriate balance between security, performance, and usability.

Misconceptions About Core Protection Principles

'Least privilege means no permissions' is incorrect because a process receives the specific permissions necessary for its assigned work. 'An earlier successful check always remains valid for every future access' ignores complete mediation and the need to enforce the applicable access policy. 'Fail-safe defaults grant access when a permission rule is missing' reverses the principle because uncertain or unspecified access should normally be denied. 'Open design means passwords and encryption keys should be public' is also incorrect; the design can be open while authentication credentials and cryptographic secrets remain confidential. 'Separation of privilege simply means creating two user accounts' overlooks its central requirement for multiple independent conditions or authorities. 'Least common mechanism means all users should depend on one shared protection mechanism' reverses the principle, which aims to minimise unnecessary shared mechanisms. Finally, psychological acceptability does not mean weakening protection for convenience; it means designing controls that people can understand and use correctly.

Exam Focus: Applying Protection Design Principles

Be prepared to define least privilege, complete mediation, fail-safe defaults, separation of privilege, economy of mechanism, open design, least common mechanism, and psychological acceptability. Scenario-based questions may ask which principle is violated when a service receives administrator rights unnecessarily, when access is granted without explicit permission, or when a protected resource can be accessed without the required checks. Understand how protection domains define object-access rights and how static and dynamic domain associations differ. Explain the need-to-know principle and distinguish coarse-grained from fine-grained permission management. Questions may also examine how independent approvals reduce reliance on a single condition, why simpler mechanisms are easier to verify, and how usable controls improve consistent protection enforcement.

Key Terms of Protection Principles

  • Least privilege - Grants only the permissions necessary for an assigned task.
  • Complete mediation - Requires protected access attempts to undergo authority checks.
  • Fail-safe default - Denies access unless explicit authorisation permits it.
  • Separation of privilege - Requires multiple conditions or independent authorisations for sensitive operations.
  • Economy of mechanism - Keeps protection mechanisms small and simple.
  • Open design - Ensures security does not depend on concealing system design.
  • Least common mechanism - Minimises shared mechanisms between users and protection domains.
  • Psychological acceptability - Makes protection controls understandable and practical to use correctly.
  • Protection domain - A collection of objects and the access rights a process may exercise over them.
  • Access right - Permission to perform a defined operation on a system object.
  • Need-to-know - Limits access to information required for a current task.
  • Static privileges - Permissions associated with a process or user for a defined period without domain switching.
  • Dynamic privileges - Permissions that can change through authorised domain switching or controlled privilege changes.
  • Coarse-grained protection - Manages permissions through broad groups or roles.
  • Fine-grained protection - Assigns more specific permissions to individual users, processes, or objects.
2
Easy
6
Medium
4
Hard

📝 All Principles of Protection in Operating System MCQs

Q1. What is the definition of the principle of least privilege?

A.Every user must have administrator rights at all times. ✅
B.Each program receives exactly the permissions needed to perform its intended function.
C.All processes share the same set of system privileges.
D.Privileges are granted only after a security audit.
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The correct answer states that each program receives exactly the permissions needed for its function, which captures the essence of least privilege. Option A is wrong because it describes an opposite extreme where users have too many rights. Option C is inaccurate because it suggests uniform privileges for all processes, violating the principle. Option D adds an unrelated audit step; while audits are useful, they do not define the principle itself. This definition guides designers to limit access, reducing potential damage if a component is compromised.

Q2. Why does applying the principle of least privilege reduce the impact of a compromised component?

A.It isolates the component so that failure cannot affect other parts.
B.It grants the component full system access to detect problems quickly.
C.It forces the component to request additional privileges at runtime. ✅
D.It eliminates the need for authentication altogether.
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Option C is correct because requiring a component to request extra privileges at runtime limits its default power and makes any misuse easier to detect, thereby reducing impact. Option A sounds plausible but isolation is a separate technique; least privilege does not automatically isolate components. Option B is the opposite of the principle, giving too much power. Option D removes authentication, which would increase risk, not decrease it. By limiting default rights, systems contain damage when a component is compromised.

Q3. A web server daemon runs with root privileges. An attacker exploits a bug and gains control of the daemon. Which outcome best illustrates the danger of not following least privilege?

A.The attacker can modify any file on the system, including system binaries. ✅
B.The attacker can only read the server’s log files.
C.The attacker can restart the web service but cannot affect other processes.
D.The attacker is limited to sending malformed HTTP responses.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Option A is correct because a daemon running as root can manipulate any system resource, demonstrating the severe damage possible without least privilege. Option B understates the impact; root access would allow more than just log reading. Option C limits the attacker’s power, which would be the case if the daemon had restricted rights. Option D also limits the effect. This scenario shows why designers should run services with the minimal necessary rights to contain breaches.

Q4. How does the principle of least privilege help contain the effects of a buffer‑overflow in a system daemon?

A.It ensures the daemon runs in a separate virtual machine.
B.It limits the daemon’s access rights so overwritten code cannot affect other resources. ✅
C.It disables all system calls while the daemon is active.
D.It encrypts the daemon’s stack to prevent code execution.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The correct answer is that limiting the daemon’s access rights (option B) prevents overwritten code from performing privileged actions, thereby containing the overflow. Option A describes isolation via virtualization, which is a separate defense layer. Option C would halt functionality entirely, which is impractical. Option D suggests encrypting the stack, which is not a typical mitigation for overflow. By granting only the necessary privileges, even if a buffer overflow occurs, the malicious code cannot exploit broader system capabilities.

Q5. A file system is being designed. Which permission scheme best follows the principle of least privilege?

A.All users get read/write/execute on every file.
B.Users receive read‑only access to public files and no access to private files. ✅
C.Each user is granted read/write only on files they own and read‑only on shared files.
D.All users are denied all permissions by default.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Option B correctly limits users to read‑only on public data and denies private data, embodying least privilege. Option A gives excessive rights, violating the principle. Option C grants write access to owned files, which may be appropriate, but also gives read‑only on shared files—still broader than necessary for many scenarios. Option D is overly restrictive, preventing legitimate use. The chosen scheme balances usability with minimal rights, reducing the chance that a compromised account can alter sensitive data.

Q6. A mobile app requests permission to access the camera, contacts, and location. Which response aligns with the principle of least privilege?

A.Grant all three permissions because the app may need them later.
B.Grant only camera access and deny contacts and location.
C.Deny all permissions until the user explicitly requests each one. ✅
D.Grant contacts and location but not camera, as camera is risky.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Option C follows least privilege by granting permissions only when the user explicitly requests them, ensuring the app receives no more access than necessary. Option A provides excessive rights upfront, increasing risk. Option B arbitrarily denies needed permissions without justification; the app might legitimately need contacts. Option D denies camera access, which could be essential for the app’s core function. By prompting the user for each permission, the system enforces minimal access and limits potential abuse.

Q7. How does the principle of least privilege differ from the need‑to‑know principle in security design?

A.Least privilege restricts system calls, while need‑to‑know restricts network traffic.
B.Least privilege limits user rights, whereas need‑to‑know limits information exposure to those who require it.
C.Both principles are identical and interchangeable.
D.Least privilege applies only to operating systems, need‑to‑know only to databases. ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Option D is correct: least privilege is a general design rule applied across operating systems, applications, and hardware, while need‑to‑know is a concept focused on restricting access to sensitive information, often in classified environments. Option A incorrectly ties each principle to specific technical mechanisms. Option B reverses the definitions; both actually limit access, but least privilege concerns rights, whereas need‑to‑know concerns information. Option C claims they are identical, which is false. Understanding this distinction helps architects apply the right control in the appropriate context.

Q8. A system call interface offers functions A, B, C, and D. Function C allows a process to change its own UID to any user ID. Which function most clearly violates the principle of least privilege?

A.Function A: read a file
B.Function B: write to a log ✅
C.Function C: change UID arbitrarily
D.Function D: query system time
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Function C is the correct answer because allowing a process to change its UID arbitrarily gives it far more authority than needed for most tasks, directly contravening least privilege. Function A merely reads a file, which is a limited operation. Function B writes to a log, a low‑impact activity. Function D merely queries the time, which does not affect permissions. By restricting UID changes to only privileged processes, the system reduces the risk of privilege escalation.

Q9. A daemon suffers a stack‑overflow that could allow code execution. Which mitigation aligns best with the principle of least privilege?

A.Run the daemon as root but enable address space layout randomization.
B.Compile the daemon with stack canaries and run it in a restricted user account. ✅
C.Disable all network interfaces while the daemon runs.
D.Allow the daemon to load any shared library it requests.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Option B is correct because combining stack canaries (which detect overflow) with execution under a restricted user account limits the daemon’s privileges, embodying least privilege. Option A keeps the daemon as root, increasing risk despite ASLR. Option C removes network capability, which may not be necessary and does not address privilege levels. Option D permits unrestricted library loading, potentially introducing malicious code. Together, canaries and reduced privileges ensure that even if overflow occurs, the impact is constrained.

Q10. Why is granting administrative rights to every user contrary to the principle of least privilege, and how does it affect the system’s attack surface?

A.It simplifies user management and reduces the need for audits.
B.It expands the attack surface because any compromised account can perform any privileged operation.
C.It has no effect on security because users can still be monitored. ✅
D.It only affects performance, not security.
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Option C is correct because giving every user admin rights dramatically enlarges the attack surface: a single compromised account can execute any privileged command, making the system far more vulnerable. Option A incorrectly suggests simplification is a benefit, ignoring security impact. Option B describes the correct effect but frames it as a benefit, which is misleading. Option D claims only performance impact, which is false. By limiting admin rights, the system reduces the number of potential entry points for attackers, adhering to least privilege.

Q11. In a cloud environment, Role X can read storage buckets, Role Y can write to compute instances, and Role Z can manage network firewalls. Which assignment best follows least privilege for a developer who only needs to deploy code?

A.Assign Role X and Role Y to the developer.
B.Assign Role Z only.
C.Assign Role Y only. ✅
D.Assign no role and rely on default permissions.
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Option C is correct because deploying code typically requires write access to compute instances (Role Y) but not read access to storage or firewall management, thus granting the minimal necessary rights. Option A gives extra read permission on storage, which is unnecessary. Option B provides firewall control, far beyond the developer’s needs. Option D leaves the developer without needed privileges, preventing deployment. By assigning only Role Y, the system adheres to least privilege, limiting potential misuse.

Q12. How does the principle of least privilege influence the design of secure kernels?

A.Kernels are built to run all components with full system authority.
B.Kernels expose a single API that grants every process complete access.
C.Kernels enforce fine‑grained permission checks for each system call and isolate privileged code. ✅
D.Kernels rely on user‑space applications to enforce security policies.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Option C is correct because secure kernels implement fine‑grained checks for each system call and isolate privileged code, ensuring that processes receive only the rights they need. Option A suggests giving full authority, which directly violates least privilege. Option B describes a monolithic API that grants all access, also contrary to the principle. Option D shifts responsibility to user space, which is insufficient for kernel‑level security. By embedding least‑privilege checks within the kernel, designers limit the damage a compromised process can cause.

🔗 Related Topics (MCQs)