Unit5 Part 1
Unit5 Part 1
Principles of Protection
Programs, users and systems should be given just enough privileges to perform their
tasks
The principle of least privilege dictates that programs, users, and systems be
given just enough privileges to perform their tasks.
This ensures that failures do the least amount of harm and allow the least of
harm to be done.
For example, if a program needs special privileges to perform a task, it is better
to make it a SGID program with group ownership of "network" or "backup" or
some other pseudo group, rather than SUID with root ownership. This limits the
amount of damage that can occur if something goes wrong.
Typically each user is given their own account, and has only enough privilege to
modify their own files.
The root account should not be used for normal day to day activities - The
System Administrator should also have an ordinary account, and reserve use of
the root account for only those tasks which need the root privileges
Domain Structure
A computer can be viewed as a collection of processes and objects ( both HW &
SW ).
The need to know principle states that a process should only have access to
those objects it needs to accomplish its task, and furthermore only in the modes
for which it needs access and only during the time frame when it needs access.
The modes available for a particular object may depend upon its type.
Access-right = <object-name, rights-set>
where rights-set is a subset of all valid operations that can be performed on the object.
Domain = set of access-rights
Rings are numbered from 0 to 7, with outer rings having a subset of the privileges
of the inner rings.
Each file is a memory segment, and each segment description includes an entry
that indicates the ring number associated with that segment, as well as read, write,
and execute privileges.
Each process runs in a ring, according to the current-ring-number, a counter
associated with each process.
A process operating in one ring can only access segments associated with higher
( farther out ) rings, and then only according to the access bits. Processes cannot
access segments associated with lower rings.
Domain switching is achieved by a process in one ring calling upon a process
operating in a lower ring, which is controlled by several factors stored with each
segment descriptor:
o An access bracket, defined by integers b1 <= b2.
o A limit b3 > b2
o A list of gates, identifying the entry points at which the segments may be
called.
If a process operating in ring i calls a segment whose bracket is such that b1 <= i
<= b2, then the call succeeds and the process remains in ring i.
Otherwise a trap to the OS occurs, and is handled as follows:
o If i < b1, then the call is allowed, because we are transferring to a
procedure with fewer privileges. However if any of the parameters being
passed are of segments below b1, then they must be copied to an area
accessible by the called procedure.
o If i > b2, then the call is allowed only if i <= b3 and the call is directed to
one of the entries on the list of gates.
Overall this approach is more complex and less efficient than other protection
schemes.
Access Matrix
The model of protection that we have been discussing can be viewed as an access
matrix, in which columns represent different system resources and rows represent
different protection domains. Entries within the matrix indicate what access that
domain has to that resource.
View protection as a matrix (access matrix)
Rows represent domains
Columns represent objects
Access (i, j) is the set of operations that a process executing in Domaini can invoke on
Objectj
Use of Access Matrix
If a process in Domain Di tries to do “op” on object Oj, then “op” must be in the access
matrix Can be expanded to dynamic protection Operations to add, delete access rights
Special access rights:
Owner of Oi copy op from Oi to Oj
Control – Di can modify Dj access rights
Transfer – switch from domain Di to Dj
ACCESS MATRIX DESIGN SEPARATES MECHANISM FROM POLICY
Mechanism
Operating system provides access-matrix + rules
If ensures that the matrix is only manipulated by authorized agents and that
rules are strictly enforced
Policy
User dictates policy
Who can access what object and in what mode
Implementation of Access Matrix
Each column = Access-control list for one object
Defines who can perform what operation.
Access Control
Protection can be applied to non-file resources
Solaris 10 provides role-based access control (RBAC) to implement least privilege
Privilege is right to execute system call or use an option within a system call
Can be assigned to processes
Users assigned roles granting access to privileges and programs
Role-based Access Control in Solaris 10
Language-Based Protection
Specification of protection in a programming language allows the high-level description
of policies for the allocation and use of resources Language implementation can provide
software for protection enforcement when automatic hardware-supported checking is
unavailable Interpret protection specifications to generate calls on whatever protection
system is provided by the hardware and the operating system
Protection in Java 2
Stack Inspection