0% found this document useful (0 votes)
78 views9 pages

OS Security Principles and Mechanisms

The document contains exam questions and answers related to operating system security, covering concepts for designing secure systems, types of objects in an OS, the setuid bit, access matrices, principles of protection, SELinux, and file permissions. Key concepts include the principle of least privilege, the definition of protection domains, and the functionality of SELinux in enhancing Linux security. Additionally, it provides examples of user access rights based on file ownership and permissions.

Uploaded by

albsrawys686
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views9 pages

OS Security Principles and Mechanisms

The document contains exam questions and answers related to operating system security, covering concepts for designing secure systems, types of objects in an OS, the setuid bit, access matrices, principles of protection, SELinux, and file permissions. Key concepts include the principle of least privilege, the definition of protection domains, and the functionality of SELinux in enhancing Linux security. Additionally, it provides examples of user access rights based on file ownership and permissions.

Uploaded by

albsrawys686
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Operating

system
security
Exam_1
Q&A From The First Four Lectures

‫من السنوات السابقة‬


]\

Sample A
Q1/ List five concepts that used for designing secure systems.

Answer:

1.​ Economy of mechanism: Keep the system as small and


simple as possible to reduce bugs and improve
understanding.
2.​ Fail-safe defaults: Default settings should prioritize security,
not insecurity.
3.​ Complete mediation: Check security policies every time an
action is taken.
4.​ Open design: Assume the attacker knows every detail of the
design. Security shouldn't rely on secrecy of the design itself.
5.​ Separation of privilege: Require separate credentials or
parties for critical actions (e.g., two-factor authentication).
6.​ Least privilege: Grant only the minimum necessary
privileges to users or processes.
7.​ Least common mechanism: Use separate data structures
and mechanisms for different users or processes.

Q2/ How many types of objects in OS? explain with example.

Answer:

1.​ Hardware objects: These are physical components of the


system. Examples include the CPU, memory segments,
printers, disks, and tape drives.
2.​ Software objects: These are logical constructs within the
system. Examples include files, programs, and semaphores.

1
]\

Q3/ what is setuid bit? and what is the benefit from it?

Answer:

●​ What it is: It's a special permission bit that can be set on an


executable file.
●​ Benefit: When a file with the setuid bit set is executed, the
process that runs it temporarily gains the privileges of the
file's owner (usually based on the owner's UID), rather than
the privileges of the user who executed the file. This allows
ordinary users to perform specific tasks that require elevated
privileges, which they wouldn't normally have.

Q4/ if you have the following domains and objects with the
following permissions, write the Access matrix for them.

{D1, D2, D3, D4, D5} , {F1, F2, F3, F4, printer 1, printer 2}

D1 → {F1, read}, {F3, read}, {F4, write}

D2 → {F2, write}, {F3, read}

D3 → {F1, read}, {F2, write}

D4 → {F4, read}, {printer 1, print}

D5 → {printer 2, print}

2
]\

Answer:

Domain F1 F2 F3 F4 printer 1 printer 2

D1 read read write

D2 write read

D3 read write

D4 read print

D5 print

3
]\

Sample B
Q1/ List the principles of protection.

Answer:

●​ The principle of least privilege: This dictates that programs,


users, and systems should be given only the minimum
privileges necessary to perform their tasks. This minimizes
the potential damage from failures or compromises.

Q2/ Explain the domain of protection, and explain the ways of


realizing a domain.

Answer:

●​ Domain of Protection: A computer system consists of


processes and objects (both hardware and software). A
protection domain specifies the resources that a process may
access. Each domain defines a set of objects and the types of
operations that can be invoked on each object. The ability to
execute an operation on an object is called an access right. A
domain, therefore, is a collection of access rights, represented
as ordered pairs: <object-name, rights-set>.

●​ Ways of Realizing a Domain:

1.​ Each user may be a domain: In this case, the accessible


objects depend on the user's identity. Domain switching
happens when users log in or out.
2.​ Each process may be a domain: The accessible objects

4
]\

depend on the process's identity. Domain switching


occurs when processes communicate (e.g., sending
messages).
3.​ Each procedure may be a domain: Accessible objects
correspond to the local variables of the procedure.
Domain switching happens during procedure calls.

Q3/ What is SELinux? and how does it provide security for


linux?

Answer:

●​ What it is: SELinux (Security-Enhanced Linux) is a mandatory


access control (MAC) mechanism integrated into the Linux
kernel.
●​ How it provides security: It adds an extra layer of security by
enforcing security policies at the kernel level. SELinux defines
rules that govern the interactions between processes and
resources. This helps prevent unauthorized access and
maintains the confidentiality of sensitive data by controlling
the actions that processes can perform. SELinux help to
protect privileged processes from executing malicious codes,
also it prevents transition to the administrator role and
domain to prevent unauthenticated users.

5
]\

Q4: Suppose a set of files have the following owners, groups,


and other mode bits as described below.

Name Owner Group Mode bits

F1 User 1 Group 3 rwxr- -r--

F2 User 2 Group 1 rw-rw-r--

F3 User 3 Group 3 rwxr- --r--

F4 User 4 Group 1 r--rw----

what can the following users operate on these resources


according to the following accesses? explain with authentication.

user1 → F3, user 1 → F2, user 2 → F4, user 2 → F1

Answer:

●​ user1 → F3:
○​ F3 Owner: User 3, Group: Group 3, Mode Bits: rwxr- --r--
○​ User 1 is not the owner (User 3).
○​ User 1 is in Group 3. The group permissions are --- (no
access).
○​ Conclusion: User 1 has no permissions on this file.

●​ user1 → F2:
○​ F2 Owner: User 2, Group: Group 1, Mode Bits: rw-rw-r--
○​ User 1 is not the owner (User 2).

6
]\

○​ User 1 is not in Group 1.


○​ "Others" permissions are r-- (read-only).
○​ Conclusion: User 1 can read F2 (as "other").

●​ user2 → F4:
○​ F4 Owner: User 4, Group: Group 1, Mode Bits: r--rw----
○​ User 2 is not the owner (User 4).
○​ User 2 is in Group 1. The group permissions are rw-
(read-write).
○​ "Others" permissions are --- (no access).
○​ Conclusion: User 2 can read and write to F4 (as a
member of Group 1).

●​ user2 → F1:
○​ F1 Owner: User 1, Group: Group 3, Mode Bits: rwxr--r--
○​ User 2 is not the owner (User 1).
○​ User 2 is not in Group 3.
○​ "Others" permissions are r-- (read-only).
○​ Conclusion: User 2 can read F1 (as "other").

Summary Table:

User File Access Granted Reason

User 1 F3 Read "Others" permissions

User 1 F2 Read "Others" permissions

7
]\

User 2 F4 Read, Write Member of F4's group


(Group 1)

User 2 F1 Read "Others" permissions

Common questions

Powered by AI

To mitigate the security risks associated with the least common mechanism principle, systems can use isolated, dedicated resources for different users or processes . This can be achieved through virtualization or containerization, where each user or process operates in its own isolated environment. These technologies ensure separation between users' data and processes, reducing the potential for unintended data leaks or access caused by shared usage of common resources. Additionally, implementing robust access controls and monitoring can further enhance security.

If the principle of least privilege is not properly implemented, users or processes may have access to more resources than necessary, increasing the potential attack surface . This can lead to unauthorized data access, data corruption, or privilege escalation attacks. For example, a compromised user account with elevated privileges could lead to more extensive damage within the organization’s systems. Implementing least privilege limits these risks by ensuring that access is granted only to resources essential for performing legitimate tasks.

Separation of privilege in an organizational context can involve requiring multiple stakeholders to approve significant transactions before they proceed. For instance, a company might require both a manager and a financial officer to approve expenses over a certain threshold. This reduces the risk of fraud and errors, similar to how requiring multiple credentials in system design minimizes the risk of security breaches. This principle ensures that no single individual has the ability to perform critical actions unilaterally .

Misuse of the setuid bit could compromise system security by allowing users to execute programs with elevated privileges they otherwise would not possess . If an executable with the setuid bit is vulnerable or misconfigured, it might be exploited to grant attackers unauthorized access or control over the system. For instance, a setuid program with a buffer overflow vulnerability could be exploited to execute arbitrary code with root privileges. Proper auditing and restriction to trusted, secure binaries are essential to mitigate this risk.

Fail-safe defaults contribute to system security by ensuring that access is denied by default, unless explicitly granted, thereby minimizing the risk of unauthorized access . For example, a firewall might deny all network traffic by default and only allow traffic from known, trusted IP addresses via explicit rules. This principle ensures that errors in the configuration or deployment do not automatically lead to security breaches.

SELinux enhances security in Linux environments by enforcing mandatory access control (MAC) policies that define strict rules on how processes can interact with each other and with system resources . Unlike traditional DAC systems where users have more control over access permissions, SELinux policies cannot be overridden by users. This reduces the potential for privilege escalation and unauthorized access by maintaining strict, centrally-defined access rules. These controls are enforced at the kernel level, protecting critical system components and sensitive data from being accessed by unauthorized processes or users.

Domain switching in a multi-user system allows different processes, users, or procedures to operate within specific domains, each with defined access rights . This imposes a hierarchical structure where users' privileges can vary based on their current domain. Such switching can enhance security by ensuring that tasks requiring higher privileges run in isolated environments, but it also necessitates careful management to ensure that domain transitions do not inadvertently grant users or processes excessive rights. This methodical control effectively separates and limits access, reducing potential security risks.

The open design principle assumes that system security does not depend on secrecy of design details but rather on robustness and correctness of implementation . While transparency can lead to broader scrutiny and potentially stronger security, it also challenges organizations that may rely on proprietary information for competitive advantage. Moreover, open design requires time-consuming and thorough peer reviews to identify vulnerabilities, which might not be feasible for rapid development cycles. Balancing openness with protectiveness of business interests, along with maintaining security while encouraging comprehensive analysis, represents a significant challenge in applying this principle effectively.

The complete mediation principle affects system performance because it requires that every access to a resource involves a security check, which can be resource-intensive . This overhead can lead to performance bottlenecks, especially in high-transaction environments. To manage this, systems can implement caching of access decisions, optimize authentication processes, or use efficient, lightweight security checks that minimize the performance impact while maintaining security integrity.

The economy of mechanism principle in secure system design advocates keeping the system as small and simple as possible. This approach has multiple advantages: it reduces the potential for bugs, which can be security vulnerabilities . A smaller, simpler system is also easier to understand and manage, allowing for more effective security auditing and testing. Additionally, complexity increases the difficulty of verifying a system's security properties, so simplicity inherently supports better security outcomes.

You might also like