1 CSE 380 Computer Operating Systems Instructor: Insup Lee and Dianna Xu University of Pennsylvania Fall 2003 Lecture Note: Protection Mechanisms.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Protection Goals of Protection Domain of Protection Access Matrix
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 14: Protection.
CMSC 414 Computer (and Network) Security Lecture 13 Jonathan Katz.
Chapter 6 User Protections in OS. csci5233 computer security & integrity (Chap. 6) 2 Outline User-level protections 1.Memory protection 2.Control of access.
CMSC 414 Computer and Network Security Lecture 13 Jonathan Katz.
Protection and Security. Policy & Mechanism Protection mechanisms are tools used to implement security policies –Authentication –Authorization –Cryptography.
Protection. Goals of Protection Operating system consists of a collection of objects, hardware or software Each object has a unique name and can be accessed.
Bilkent University Department of Computer Engineering
CSE331: Introduction to Networks and Security Lecture 28 Fall 2002.
Reasons for Protection n Prevent users from accessing information they shouldn’t have access to. n Ensure that each program component uses system resources.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 14: Protection.
CS-550 (M.Soneru): Protection and Security - 1 [SaS] 1 Protection and Security.
CMSC 414 Computer and Network Security Lecture 10 Jonathan Katz.
CSE331: Introduction to Networks and Security Lecture 29 Fall 2002.
Chapter 14: Protection.
Lecture 7 Access Control
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 4 “Overview”.
CMSC 414 Computer and Network Security Lecture 18 Jonathan Katz.
CS-550 (M.Soneru): Protection and Security - 2 [SaS] 1 Protection and Security - 2.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 14: Protection.
Dr. Kalpakis CMSC 421, Operating Systems. Fall 2008 URL: Protection.
Page 19/4/2015 CSE 30341: Operating Systems Principles Raid storage  Raid – 0: Striping  Good I/O performance if spread across disks (equivalent to n.
Systems Security & Audit Operating Systems security.
Lecture 18 Page 1 CS 111 Online Access Control Security could be easy – If we didn’t want anyone to get access to anything The trick is giving access to.
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
14.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 14: Protection Goals of Protection Principles of Protection Domain of Protection.
Announcements Assignment 3 due. Invite friends, co-workers to your presentations. Course evaluations on Friday.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 14: Protection.
Chapter 14: Protection Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 14: Protection Goals of Protection Principles of Protection Domain.
G53SEC 1 Access Control principals, objects and their operations.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 18: Protection Goals of Protection Objects and Domains Access Matrix Implementation.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 14: Protection.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Protection (Chapter 14)
Cosc 4740 Chapter 13: Protection. Goals of Protection Operating system consists of a collection of objects, hardware or software Each object has a unique.
Protection Nadeem Majeed Choudhary
CE Operating Systems Lecture 21 Operating Systems Protection with examples from Linux & Windows.
G53SEC 1 Reference Monitors Enforcement of Access Control.
UNIX System Protection. Unix History Developed by Dennis Ritchie and Ken Thompson at AT&T Bell Labs Adapted some ideas from the Multics project in 1969.
Chapter 14: Protection Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Apr 11, 2005 Chapter 14: Protection Goals.
11.1 CSE Department MAITSandeep Tayal 11: Protection Goals of Protection Domain of Protection Access Matrix Implementation of Access Matrix Revocation.
Protection & Security Greg Bilodeau CS 5204 October 13, 2009.
Lecture 14 Page 1 CS 111 Summer 2013 Security in Operating Systems: Basics CS 111 Operating Systems Peter Reiher.
Lecture9 Page 1 CS 236 Online Operating System Security, Con’t CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
CSE Operating System Principles Protection.
ACCESS MATRIX IMPLEMENTATION AND COMPARISON By: Rushabh Dharwadkar Roll no: TE COMP.
18.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 18: Protection Goals of Protection Domain of Protection Access Matrix.
Company LOGO Security in Linux PhiHDN - VuongNQ. Contents Introduction 1 Fundamental Concepts 2 Security System Calls in Linux 3 Implementation of Security.
Saurav Karmakar. Chapter 14: Protection  Goals of Protection  Principles of Protection  Domain of Protection  Access Matrix  Implementation of Access.
PROTECTION.
Introduction to Operating Systems
Protection and Security
Chapter 14: Protection Modified by Dr. Neerja Mhaskar for CS 3SH3.
Chapter 14: System Protection
Operating System Concepts
Chapter 14: Protection.
Chapter 14: Protection.
Chapter 14: Protection.
CE Operating Systems Lecture 21
Chapter 14: Protection.
Chapter 14: Protection.
UNIX System Protection
Chapter 14: Protection.
Chapter 14: Protection.
Chapter 14: Protection.
Chapter 14: Protection.
Chapter 14: Protection.
Preventing Privilege Escalation
Access Control and Audit
Presentation transcript:

1 CSE 380 Computer Operating Systems Instructor: Insup Lee and Dianna Xu University of Pennsylvania Fall 2003 Lecture Note: Protection Mechanisms

2 Policy vs. Mechanism  Access control policy is a specification  Given in terms of a model of the system  Subjects: do things (i.e. a process writes to files)  Objects: are passive (i.e. the file itself)  Actions: what the subjects do (i.e. read a string from a file)  Rights: describe authority (i.e. read or write permission)  Mechanisms are used to implement a policy  Example: access control bits in Unix file system & OS checks  Mechanism should be general; ideally should not constrain the possible policies.  Complete mediation: every access must be checked

3 Reference Monitors Subject Monitor (Action, Object) Request Granted Denied?

4 Example Reference Monitors  Operating Systems  File system  Memory (virtual memory, separate address spaces)  Firewalls  Regulate network access  Java Virtual Machine  Regulates Java programs’ resource usage

5 Access Control Matrix A[s][o]Obj 1 Obj 2 …Obj N Subj 1 {r,w,x}{r,w}…{} Subj 2 {w,x}{}…… …………… Subj M {x}{r,w,x}… Each entry contains a set of rights.

6 Access Control Checks  Suppose subject s wants to perform action that requires right r on object o:  If (r  A[s][o]) then perform action else access is denied

7 Model for resource Protection  A Protection System is composed of  set of subjects: processes executing in a specific protection domain  set of objects: all the passive elements of the system plus all the subjects  set of rules specifying the protection policy  Protection Domain: Set of rights a process has at any given time  Protection state is checked for each access of an object, X, by a subject, S  Protection state can be conceptualized as an access matrix.  A[S,X] is a set that describes the access rights held by subject S to object X.

8 Rights and Actions  Besides read, write, execute actions there are many others:  Ownership  Creation  New subjects (i.e. in Unix add a user)  New objects (i.e. create a new file)  New rights: Grant right r to subject s with respect to object o (sometimes called delegation)  Deletion of  Subjects  Objects  Rights (sometimes called revocation)

9 Protecting the Reference Monitor  It must not be possible to circumvent the reference monitor by corrupting it  Mechanisms  Type checking  Software fault isolation: rewrite memory access instructions to perform bounds checking  User/Kernel modes  Segmentation of memory (OS resources aren’t part of virtual memory system)

10 Storing the Access Control Matrix  Subjects >> # users  A row can correspond to a protection domain  Each subject runs within a protection domain  Example: User-ID and Group-ID in Unix determine domain  Objects >> # files  Potentially could have permissions on any resource  The matrix is typically sparse  Store only non-empty entries

11 Access Control Lists A[s][o]Obj 1 Obj 2 …Obj N Subj 1 {r,w,x}{r,w}…{} Subj 2 {w,x}{}…{r} …………… Subj M {x}{r,w,x}… For each object, store a list of (Subject, Rights) pairs.

12 Access Control Lists  Resolving queries is linear in length of the list  Revocation w.r.t. a single object is easy  “Who can access this object?” is easy  Useful for auditing  Lists could be long  Factor into groups (lists of subjects)  Give permissions based on group  Introduces consistency question w.r.t. groups  Authentication critical  When does it take place? Every access would be expensive.

13 Capabilities Lists A[s][o]Obj 1 Obj 2 …Obj N Subj 1 {r,w,x}{r,w}…{} Subj 2 {w,x}{}…{r} …………… Subj M {x}{r,w,x}… For each subject, store a list of (Object, Rights) pairs.

14 Capabilities  A capability is a (Object, Rights) pair  Must be protected from tampering  Otherwise, subjects could get illegal access  Authentication takes place when the capabilities are granted (not needed at use)  Harder to carry out revocation (must find all entries where the object appears)  Easy to audit a subject, hard to audit an object

15 Storing Capabilities Securely  Special hardware: tagged words in memory  Can’t copy/modify tagged words  Store the capabilities in protected address space  Could use static scoping mechanism of safe programming languages.  Java’s “private” fields  Could use cryptographic techniques  OS kernel could sign (Object, Rights) pairs using a private key  Any process can verify the capability

16 Unix Security  Each user has a unique 16-bit UID  UID of root/superuser is 0  Each user can belong to a group, each group has a unique 16-bit GID  Protection domain of a process is determined by the (UID,GID) of the user that owns the process  Every file has  UID and GID of the owner  Protection bits that can be set/changed by the owner  Devices handled as files (e.g. /dev/tty, /dev/lp)  9 bits specifying allowed read(r)/write(w)/execute(x) access for the owner, group, and everyone else  E.g. rw-r----- means owner can read/write and group can read

17 SETUID  How to give temporary access to privileged resources?  E.g. /dev/lp is owned by printer daemon (or by root), other processes need to write to it to send jobs to printer, but you do not want to set permission to rwxrwxrwx  Solution: Each file/device has a SETUID bit  When an executable program P with SETUID bit set to 1 is executed by a process Q, the protection domain of Q is changed to (UID,GID) of P (i.e. the owner of P)  If P’s SETUID bit is 0, then protection domain of Q does not change

18 Sample Scenario  /dev/lp is owned by root with protection rw  This is used to access the printer  /bin/lp is owned by root with --x--x--x with SETUID=1  User A issues a print command  Shell (running with A’s UID and GID) interprets the command and forks off a child process, say, P  Process P has the same UID/GID as user A  Child process P executes exec(“/bin/lp”,…)  Now P’s domain changes to root’s UID  Consequently, /dev/lp can be accessed to print  When /bin/lp terminates so does P  Parent shell never got the access to /dev/lp