SlideShare a Scribd company logo
1 of 30
Silberschatz, Galvin and Gagne ©2013
Operating System Concepts– 9th Edition
Chapter 14: System
Protection
14.2 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Chapter 14: System Protection
 Goals of Protection
 Principles of Protection
 Domain of Protection
 Access Matrix
 Implementation of Access Matrix
 Access Control
 Revocation of Access Rights
 Capability-Based Systems
 Language-Based Protection
14.3 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Objectives
 Discuss the goals and principles of protection in a modern computer system
 Explain how protection domains combined with an access matrix are used to specify the resources a
process may access
 Examine capability and language-based protection systems
14.4 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Goals of Protection
 In one protection model, computer consists of a collection of objects, hardware or software
 Each object has a unique name and can be accessed through a well-defined set of operations
 Protection problem - ensure that each object is accessed correctly and only by those processes that are
allowed to do so
 To ensure that only processes that have gained proper authorization from OS can operate on
 Files
 Memory segments
 Cpu
 Other resources
14.5 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Principles of Protection
 Guiding principle – principle of least privilege
 Programs, users and systems should be given just enough privileges to perform their tasks
 Limits damage if entity has a bug, gets abused
 Can be static (fixed during life of system, during life of process)
 Or dynamic (changed by process as needed) – domain switching, privilege escalation
 “Need to know” a similar concept regarding access to data
 Must consider “grain” aspect
 Rough-grained privilege management easier, simpler, but least privilege now done in large chunks
 For example, traditional Unix processes either have abilities of the associated user, or of root
 Fine-grained management more complex, more overhead, but more protective
 File ACL lists, RBAC (role-based access control)
 Provides mechanisms to enable privileges when they are needed & disable them when they are
not needed
 Domain can be user, process, procedure
14.6 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Domain Structure
 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
 A collection of access right, each of which is an considered pair <object-name, rights-set>
 Each domain define a set of objects and the types of operation that maybe invoked on each object.
 Domain do not need to be disjoint, they may share access rights.
 Figure shows 3 domain: D1 , D2 , D3
 Access right < O4, {print}> is shared by D2 & D3 implying that a process executing in either of these two
domain can print object O4.
14.7 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Domain Implementation (UNIX)
 Domain = user-id
 Domain switch accomplished via file system
 Each file has associated with it a domain bit (known as setuid bit)
 When file is executed and setuid = on, then user-id is set to owner of the file being executed
 When execution completes user-id is reset
 Domain switch accomplished via passwords
 su command temporarily switches to another user’s domain when other domain’s password
provided
 Domain switching via commands
 sudo command prefix executes specified command in another domain (if original domain has
privilege or password given)
14.8 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Domain Implementation (MULTICS)
 In MULTICS system, protection domains are organized hierarchically into a ring structure
 Each ring corresponds to a single domain
 Let Di and Dj be any two domain rings
 If j < I  Di  Dj If j < I then Di is a subset of Dj
 Process executing in domain Dj has more privileges than does a process executing on domain Di
 A process executing in domain D0 has the most privileges
14.9 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Multics Benefits and Limits
 Ring / hierarchical structure provided more than the basic kernel / user or root / normal user design
 Fairly complex -> more overhead
 Disadvantages: does not allow strict need-to-know
 Object accessible in Dj but not in Di, then j must be < i
 But then every segment accessible in Di also accessible in Dj
14.10 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Access Matrix
 Our model of protection can be viewed 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
14.11 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Access Matrix
 4 domains 4 objects 1 laser printer
 A process executing in domain D1 can read files F1 and F3
 A process executing in domain D4 has the same privileges as one in executing in domain D1 but in
addition can write onto files F1 and F3
14.12 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
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
 User who creates object can define access column for that object
 Can be expanded to dynamic protection
 Operations to add, delete access rights
 Special access rights:
 owner of Oi
 copy op from Oi to Oj (denoted by “*”)
 control – Di can modify Dj access rights
 transfer – switch from domain Di to Dj
 Copy and Owner applicable to an object
 Control applicable to domain object
14.13 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Use of Access Matrix (Cont.)
 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
 But doesn’t solve the general confinement problem
14.14 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Access Matrix of Figure A
with Domains as Objects
 Processes should be able to switch from one domain to another domain
 DA process executing in domain D2 can switch to domain D3 or D4
14.15 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Access Matrix with Copy Rights
 The ability to copy and access right from one domain (or row) of the access matrix to another is denoted
by an asterisk (*) appended to the access right
 A process executing in domain D2 can copy the read operation into any entry associated with F2
14.16 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Access Matrix With Owner Rights
 Copy and owner rights allow process to change the entries in a column
 Control right in access (D2 ,D4) control right in access (D2 ,D4)
14.17 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Modified Access Matrix of Figure B
 A process executing in domain D2 could modify domain D4
14.18 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Implementation of Access Matrix
 Generally, a sparse matrix
 Option 1 – Global table
 Store ordered triples < domain, object, rights-set > in table
 A requested operation M on object Oj within domain Di -> search table for < Di, Oj, Rk >
 with M ∈ Rk
 But table could be large -> won’t fit in main memory
 Difficult to group objects (consider an object that all domains can read)
 Option 2 – Access lists for objects
 Each column implemented as an access list for one object
 Resulting per-object list consists of ordered pairs < domain, rights-set > defining all domains
with non-empty set of access rights for the object
 Easily extended to contain default set -> If M ∈ default set, also allow access
14.19 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
 Each column = Access-control list for one object
Defines who can perform what operation
Domain 1 = Read, Write
Domain 2 = Read
Domain 3 = Read
 Each Row = Capability List (like a key)
For each domain, what operations allowed on what objects
Object F1 – Read
Object F4 – Read, Write, Execute
Object F5 – Read, Write, Delete, Copy
14.20 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Implementation of Access Matrix (Cont.)
 Option 3 – Capability list for domains
 Instead of object-based, list is domain based
 Capability list for domain is list of objects together with operations allows on them
 Object represented by its name or address, called a capability
 Execute operation M on object Oj, process requests operation and specifies capability as parameter
 Possession of capability means access is allowed
 Capability list associated with domain but never directly accessible by domain
 Rather, protected object, maintained by OS and accessed indirectly
 Like a “secure pointer”
 Idea can be extended up to applications
 Option 4 – Lock-key
 Compromise between access lists and capability lists
 Each object has list of unique bit patterns, called locks
 Each domain as list of unique bit patterns called keys
 Process in a domain can only access object if domain has key that matches one of the locks
14.21 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Comparison of Implementations
 Many trade-offs to consider
 Global table is simple, but can be large
 Access lists correspond to needs of users
 Determining set of access rights for domain non-localized so difficult
 Every access to an object must be checked
– Many objects and access rights -> slow
 Capability lists useful for localizing information for a given process
 But revocation capabilities can be inefficient
 Lock-key effective and flexible, keys can be passed freely from domain to domain, easy revocation
 Most systems use combination of access lists and capabilities
 First access to an object -> access list searched
 If allowed, capability created and attached to process
– Additional accesses need not be checked
 After last access, capability destroyed
 Consider file system with ACLs per file
14.22 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
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
 Enable role via password to gain its privileges
 Similar to access matrix
14.23 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Role-based Access Control in Solaris 10
 This implementation of privileges decrease the security risk associated with superuser and
setuid programs
14.24 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Revocation of Access Rights
 Various options to remove the access right of a domain to an object (page 606)
 Immediate vs. delayed
 Selective vs. general
 Partial vs. total
 Temporary vs. permanent
 Access List – Delete access rights from access list
 Simple – search access list and remove entry
 Immediate, general or selective, total or partial, permanent or temporary
14.25 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Revocation of Access Rights
 Capability List – Scheme required to locate capability in the system before capability can be
revoked
 Reacquisition – periodic delete, with require and denial if revoked
 Back-pointers – set of pointers from each object to all capabilities of that object (Multics)
 Indirection – capability points to global table entry which points to object – delete entry
from global table, not selective (CAL)
 Keys – unique bits associated with capability, generated when capability created
 Master key associated with object, key matches master key for access
 Revocation – create new master key
 Policy decision of who can create and modify keys – object owner or others?
14.26 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Capability-Based Systems
 Two capability-based protection system
1) Hydra: is a capability-based protection system
 Fixed set of access rights known to and interpreted by the system
 i.e. read, write, or execute each memory segment
 User can declare other auxiliary rights and register those with protection system
 Accessing process must hold capability and know name of operation
 Rights amplification allowed by trustworthy procedures for a specific type
 Interpretation of user-defined rights performed solely by user's program; system provides
access protection for use of these rights
 Operations on objects defined procedurally – procedures are objects accessed indirectly
by capabilities
 Solves the problem of mutually suspicious subsystems
 Includes library of prewritten security routines
14.27 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Capability-Based Systems
2) Cambridge CAP System
 Simpler but powerful
 Data capability - provides standard read, write, execute of individual storage segments
associated with object – implemented in microcode
 Software capability -interpretation left to the subsystem, through its protected
procedures
 Only has access to its own subsystem
 Programmers must learn principles and techniques of protection
14.28 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
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
14.29 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Protection in Java 2
 Protection is handled by the Java Virtual Machine (JVM)
 A class is assigned a protection domain when it is loaded by the JVM
 The protection domain indicates what operations the class can (and cannot) perform
 If a library method is invoked that performs a privileged operation, the stack is inspected to ensure the
operation can be performed by the library
14.30 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Stack Inspection

More Related Content

Similar to system protection.ppt

Similar to system protection.ppt (20)

ch2.ppt
ch2.pptch2.ppt
ch2.ppt
 
ch2.ppt
ch2.pptch2.ppt
ch2.ppt
 
Operating-System Structures
Operating-System StructuresOperating-System Structures
Operating-System Structures
 
ch2.ppt
ch2.pptch2.ppt
ch2.ppt
 
ch2.ppt
ch2.pptch2.ppt
ch2.ppt
 
ch2.ppt
ch2.pptch2.ppt
ch2.ppt
 
Unit 1 ppt
Unit 1 pptUnit 1 ppt
Unit 1 ppt
 
MODULE 2.ppt
MODULE 2.pptMODULE 2.ppt
MODULE 2.ppt
 
Chapter 14 - Protection
Chapter 14 - ProtectionChapter 14 - Protection
Chapter 14 - Protection
 
ch2- os.pptx
ch2- os.pptxch2- os.pptx
ch2- os.pptx
 
Operating System basics Introduction
Operating System basics IntroductionOperating System basics Introduction
Operating System basics Introduction
 
ch2.ppt
ch2.pptch2.ppt
ch2.ppt
 
ch2.ppt
ch2.pptch2.ppt
ch2.ppt
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System Structures
 
Unix SVR4/OpenSolaris and allumos Access Control
Unix SVR4/OpenSolaris and allumos Access ControlUnix SVR4/OpenSolaris and allumos Access Control
Unix SVR4/OpenSolaris and allumos Access Control
 
2 os structure
2 os structure2 os structure
2 os structure
 
windows 7 .ppt
windows 7 .pptwindows 7 .ppt
windows 7 .ppt
 
ch19.ppt, windows 7,History Design Principles System Components Environmental...
ch19.ppt, windows 7,History Design Principles System Components Environmental...ch19.ppt, windows 7,History Design Principles System Components Environmental...
ch19.ppt, windows 7,History Design Principles System Components Environmental...
 
Distributed Computing
Distributed ComputingDistributed Computing
Distributed Computing
 
Chapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.pptChapter 2 Operating System Structures.ppt
Chapter 2 Operating System Structures.ppt
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

system protection.ppt

  • 1. Silberschatz, Galvin and Gagne ©2013 Operating System Concepts– 9th Edition Chapter 14: System Protection
  • 2. 14.2 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Chapter 14: System Protection  Goals of Protection  Principles of Protection  Domain of Protection  Access Matrix  Implementation of Access Matrix  Access Control  Revocation of Access Rights  Capability-Based Systems  Language-Based Protection
  • 3. 14.3 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Objectives  Discuss the goals and principles of protection in a modern computer system  Explain how protection domains combined with an access matrix are used to specify the resources a process may access  Examine capability and language-based protection systems
  • 4. 14.4 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Goals of Protection  In one protection model, computer consists of a collection of objects, hardware or software  Each object has a unique name and can be accessed through a well-defined set of operations  Protection problem - ensure that each object is accessed correctly and only by those processes that are allowed to do so  To ensure that only processes that have gained proper authorization from OS can operate on  Files  Memory segments  Cpu  Other resources
  • 5. 14.5 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Principles of Protection  Guiding principle – principle of least privilege  Programs, users and systems should be given just enough privileges to perform their tasks  Limits damage if entity has a bug, gets abused  Can be static (fixed during life of system, during life of process)  Or dynamic (changed by process as needed) – domain switching, privilege escalation  “Need to know” a similar concept regarding access to data  Must consider “grain” aspect  Rough-grained privilege management easier, simpler, but least privilege now done in large chunks  For example, traditional Unix processes either have abilities of the associated user, or of root  Fine-grained management more complex, more overhead, but more protective  File ACL lists, RBAC (role-based access control)  Provides mechanisms to enable privileges when they are needed & disable them when they are not needed  Domain can be user, process, procedure
  • 6. 14.6 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Domain Structure  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  A collection of access right, each of which is an considered pair <object-name, rights-set>  Each domain define a set of objects and the types of operation that maybe invoked on each object.  Domain do not need to be disjoint, they may share access rights.  Figure shows 3 domain: D1 , D2 , D3  Access right < O4, {print}> is shared by D2 & D3 implying that a process executing in either of these two domain can print object O4.
  • 7. 14.7 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Domain Implementation (UNIX)  Domain = user-id  Domain switch accomplished via file system  Each file has associated with it a domain bit (known as setuid bit)  When file is executed and setuid = on, then user-id is set to owner of the file being executed  When execution completes user-id is reset  Domain switch accomplished via passwords  su command temporarily switches to another user’s domain when other domain’s password provided  Domain switching via commands  sudo command prefix executes specified command in another domain (if original domain has privilege or password given)
  • 8. 14.8 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Domain Implementation (MULTICS)  In MULTICS system, protection domains are organized hierarchically into a ring structure  Each ring corresponds to a single domain  Let Di and Dj be any two domain rings  If j < I  Di  Dj If j < I then Di is a subset of Dj  Process executing in domain Dj has more privileges than does a process executing on domain Di  A process executing in domain D0 has the most privileges
  • 9. 14.9 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Multics Benefits and Limits  Ring / hierarchical structure provided more than the basic kernel / user or root / normal user design  Fairly complex -> more overhead  Disadvantages: does not allow strict need-to-know  Object accessible in Dj but not in Di, then j must be < i  But then every segment accessible in Di also accessible in Dj
  • 10. 14.10 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Access Matrix  Our model of protection can be viewed 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
  • 11. 14.11 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Access Matrix  4 domains 4 objects 1 laser printer  A process executing in domain D1 can read files F1 and F3  A process executing in domain D4 has the same privileges as one in executing in domain D1 but in addition can write onto files F1 and F3
  • 12. 14.12 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition 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  User who creates object can define access column for that object  Can be expanded to dynamic protection  Operations to add, delete access rights  Special access rights:  owner of Oi  copy op from Oi to Oj (denoted by “*”)  control – Di can modify Dj access rights  transfer – switch from domain Di to Dj  Copy and Owner applicable to an object  Control applicable to domain object
  • 13. 14.13 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Use of Access Matrix (Cont.)  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  But doesn’t solve the general confinement problem
  • 14. 14.14 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Access Matrix of Figure A with Domains as Objects  Processes should be able to switch from one domain to another domain  DA process executing in domain D2 can switch to domain D3 or D4
  • 15. 14.15 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Access Matrix with Copy Rights  The ability to copy and access right from one domain (or row) of the access matrix to another is denoted by an asterisk (*) appended to the access right  A process executing in domain D2 can copy the read operation into any entry associated with F2
  • 16. 14.16 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Access Matrix With Owner Rights  Copy and owner rights allow process to change the entries in a column  Control right in access (D2 ,D4) control right in access (D2 ,D4)
  • 17. 14.17 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Modified Access Matrix of Figure B  A process executing in domain D2 could modify domain D4
  • 18. 14.18 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Implementation of Access Matrix  Generally, a sparse matrix  Option 1 – Global table  Store ordered triples < domain, object, rights-set > in table  A requested operation M on object Oj within domain Di -> search table for < Di, Oj, Rk >  with M ∈ Rk  But table could be large -> won’t fit in main memory  Difficult to group objects (consider an object that all domains can read)  Option 2 – Access lists for objects  Each column implemented as an access list for one object  Resulting per-object list consists of ordered pairs < domain, rights-set > defining all domains with non-empty set of access rights for the object  Easily extended to contain default set -> If M ∈ default set, also allow access
  • 19. 14.19 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition  Each column = Access-control list for one object Defines who can perform what operation Domain 1 = Read, Write Domain 2 = Read Domain 3 = Read  Each Row = Capability List (like a key) For each domain, what operations allowed on what objects Object F1 – Read Object F4 – Read, Write, Execute Object F5 – Read, Write, Delete, Copy
  • 20. 14.20 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Implementation of Access Matrix (Cont.)  Option 3 – Capability list for domains  Instead of object-based, list is domain based  Capability list for domain is list of objects together with operations allows on them  Object represented by its name or address, called a capability  Execute operation M on object Oj, process requests operation and specifies capability as parameter  Possession of capability means access is allowed  Capability list associated with domain but never directly accessible by domain  Rather, protected object, maintained by OS and accessed indirectly  Like a “secure pointer”  Idea can be extended up to applications  Option 4 – Lock-key  Compromise between access lists and capability lists  Each object has list of unique bit patterns, called locks  Each domain as list of unique bit patterns called keys  Process in a domain can only access object if domain has key that matches one of the locks
  • 21. 14.21 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Comparison of Implementations  Many trade-offs to consider  Global table is simple, but can be large  Access lists correspond to needs of users  Determining set of access rights for domain non-localized so difficult  Every access to an object must be checked – Many objects and access rights -> slow  Capability lists useful for localizing information for a given process  But revocation capabilities can be inefficient  Lock-key effective and flexible, keys can be passed freely from domain to domain, easy revocation  Most systems use combination of access lists and capabilities  First access to an object -> access list searched  If allowed, capability created and attached to process – Additional accesses need not be checked  After last access, capability destroyed  Consider file system with ACLs per file
  • 22. 14.22 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition 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  Enable role via password to gain its privileges  Similar to access matrix
  • 23. 14.23 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Role-based Access Control in Solaris 10  This implementation of privileges decrease the security risk associated with superuser and setuid programs
  • 24. 14.24 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Revocation of Access Rights  Various options to remove the access right of a domain to an object (page 606)  Immediate vs. delayed  Selective vs. general  Partial vs. total  Temporary vs. permanent  Access List – Delete access rights from access list  Simple – search access list and remove entry  Immediate, general or selective, total or partial, permanent or temporary
  • 25. 14.25 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Revocation of Access Rights  Capability List – Scheme required to locate capability in the system before capability can be revoked  Reacquisition – periodic delete, with require and denial if revoked  Back-pointers – set of pointers from each object to all capabilities of that object (Multics)  Indirection – capability points to global table entry which points to object – delete entry from global table, not selective (CAL)  Keys – unique bits associated with capability, generated when capability created  Master key associated with object, key matches master key for access  Revocation – create new master key  Policy decision of who can create and modify keys – object owner or others?
  • 26. 14.26 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Capability-Based Systems  Two capability-based protection system 1) Hydra: is a capability-based protection system  Fixed set of access rights known to and interpreted by the system  i.e. read, write, or execute each memory segment  User can declare other auxiliary rights and register those with protection system  Accessing process must hold capability and know name of operation  Rights amplification allowed by trustworthy procedures for a specific type  Interpretation of user-defined rights performed solely by user's program; system provides access protection for use of these rights  Operations on objects defined procedurally – procedures are objects accessed indirectly by capabilities  Solves the problem of mutually suspicious subsystems  Includes library of prewritten security routines
  • 27. 14.27 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Capability-Based Systems 2) Cambridge CAP System  Simpler but powerful  Data capability - provides standard read, write, execute of individual storage segments associated with object – implemented in microcode  Software capability -interpretation left to the subsystem, through its protected procedures  Only has access to its own subsystem  Programmers must learn principles and techniques of protection
  • 28. 14.28 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition 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
  • 29. 14.29 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Protection in Java 2  Protection is handled by the Java Virtual Machine (JVM)  A class is assigned a protection domain when it is loaded by the JVM  The protection domain indicates what operations the class can (and cannot) perform  If a library method is invoked that performs a privileged operation, the stack is inspected to ensure the operation can be performed by the library
  • 30. 14.30 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Stack Inspection