Protection and OS security
Admin
http://www.cs.berkeley.edu/ daw/cs261/
Definitions
Techniques for computing in the presence of adversaries.
Cryptography:
Techniques for communicating in the presence of adversaries.
Definitions
The subset of computer security which deals with controlling access to information stored locally.
Traditionally excludes issues arising from networks.
Traditionally associated with operating systems, and in particular with centralized mechanisms. Note that the typical role of an OS is to manage multiplexed access to resources; protection is about access control, but not more general resource management issues.
Protection
Protection
Access control
Can be conceptually divided into two steps
Policy
Subjects and objects
A subject is an entity making a request. (An executing program, a user sitting at a terminal, etc.) Also called a principal. In Unix, this is just a user-id.
An object is an item to which access is requested. (A byte in memory, a file on disk, a printer, etc.)
Subjects and objects, cont.
The rows of the matrix are labelled by the subjects, and the columns by the objects. The entry at row S and column O specifies whether S may access O.
In this language, we see that authentication is the problem of identifying the subject making the request, and checking authorization just comes down to checking a matrix entry.
Access control, cont.
In this case, we may establish a set of permissions. (For example: read, write, execute, etc.) Then, the matrix entry at location (S,O) is filled with the set of permissions which S may acquire on O.
This provides a way to view the system which is convenient for analysis. For instance, suppose we want to find whether there is any way which a subject S may send a message to another subject S'. Then we may simply search for all objects O which S has write permission to, and check whether S' has read access to them.
Mandatory access control
Mandatory access control (or MAC): system administrator gets some control over the access controls on every object. Usually found in military systems (e.g. anything marked ``classified'' may not be sent to a printer in an unclassified facility). We'll discuss this in detail next week.
Objects, cont.
Some examples: pages of memory, files on a storage system, I/O devices, communications channels to other subjects.
Access control lists
In this approach, each object is tagged with an ACL. The ACL identifies a list of subjects S which may access the object. For each subject S, the ACL lists the permissions S has on the object.
An example:
allow read,write Alice,Jim allow read John,Jim,Bob allow delete Alice deny read Eric
Capabilities
Example: [ (O,read) ] means the holder of this capability has read permissions on object O.
Permissions may be further restricted, e.g. by including an expiration date, etc.
Capabilities, cont.
Comparing ACLs and capabilities
Passing privileges to another subject:
Comparing ACLs and capabilities, cont.
It's clear that all of the interesting tradeoffs come in the dynamic behavior of the system.
ACLs and capabilities
When an ACL is too slow, inflexible, or unwieldy, grant access to a capability by checking an ACL and then grant access to objects according to the capability.This is known as a hybrid approach.
For example, in Unix, when you open() a file, it checks the file's ACL. The open() returns a file descriptor, which is just a capability to access the file; the file descriptor may be passed around at will.
Address spaces
Element of protection is a memory page.
Enforcement is provided by the combined effort of the OS kernel and the hardware memory management subsystem.
The main idea is to use virtual memory for protection: authorization is checked by OS when you load a page of memory into your virtual address space, and hardware ensures that memory accesses are restricted to valid pages.
You can think of the set of the virtual memory map loaded into the hardware as capabilities granting access to physical memory; the OS kernel enforces an ACL on physical pages of memory.
Dynamics
A useful permission (like read, write, etc.) in this context is the permission to modify the ACL for the object in question.
But note how difficult it becomes to analyze the system. For instance, suppose we want to find whether there is any way which a subject S may affect an object O in any way. Then it is not enough to just check whether S has write permission on O; one must also check whether S has permission to modify the permissions for O, or whether S can modify anything which can modify O, etc.
Groups
Examples: graduate-students, cs261-students, developers.
Then an ACL for this course's syllabus might look like
allow read,write Eric Brewer, Ian Goldberg, David Wagner allow read cs261-students, graduate-students
Warning: be careful with dynamics of group membership!
Authentication
A few categories:
Password authentication
Disadvantage: the sys-admin knows your password. Fix: when the account is created, apply a non-invertible one-way hash function to the secret password and store the result. Then a login request may be validated by hashing the password provided and comparing it to the value stored earlier.
Passwords, cont.
CERT's advice? Every Internet user should change their password.
Secure authentication
The only known solution is cryptography; wait two weeks.
Enforcement
In practice, hardware provides very simple mechanisms, which are used to bootstrap an OS kernel. Then the security policy is refined by trusted programs run under the OS.
Hardware architectures
Upgrading privileges
Saltzer/Schroeder paper
This document was generated using the LaTeX2HTML translator Version 96.1 (Feb 5, 1996) Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
The command line arguments were:
latex2html l-www.
The translation was initiated by David Wagner on Fri Sep 18 16:30:30 PDT 1998