Operating System Security John Mitchell. Operating System Functions uOS is a resource allocator Manages resources, decides between conflicting requests.

Slides:



Advertisements
Similar presentations
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 14: Protection.
Advertisements

Chapter 3 Multics. Chapter Overview Multics contribution to technology Multics History Multics System – Fundamentals – Security Fundamentals – Protection.
Access Control Chapter 3 Part 3 Pages 209 to 227.
CMSC 414 Computer (and Network) Security Lecture 13 Jonathan Katz.
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
Access Control and Operating System Security John Mitchell.
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.
Access Control and Operating System Security
CMSC 414 Computer and Network Security Lecture 10 Jonathan Katz.
Outline uAccess Control Concepts Matrix, ACL, Capabilities uOS Mechanisms Amoeba –Distributed, capabilities Unix –File system, Setuid Windows –File system,
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
CMSC 414 Computer and Network Security Lecture 11 Jonathan Katz.
Secure Architecture Principles Isolation and Least Privilege
Lecture 7 Access Control
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 4 “Overview”.
ADVANCED LINUX SECURITY. Abstract : Using mandatory access control greatly increases the security of an operating system. SELinux, which is an implementation.
CMSC 414 Computer and Network Security Lecture 19 Jonathan Katz.
1 Introduction to Information Security , Spring 2015 Lecture 3: Access control (2/2) Eran Tromer Slides credit: John Mitchell, Stanford Max Krohn,
CS-550 (M.Soneru): Protection and Security - 2 [SaS] 1 Protection and Security - 2.
Guide to Operating System Security Chapter 5 File, Directory, and Shared Resource Security.
John Mitchell Secure OS Principles and Security Policies by John Mitchell (Modified by Vijay Ganesh)
1 Information Security – Theory vs. Reality , Winter 2011 Lecture 4: Access Control Eran Tromer Slides credit: John Mitchell, Stanford course.
70-294: MCSE Guide to Microsoft Windows Server 2003 Active Directory Chapter 9: Active Directory Authentication and Security.
Sharing Resources Lesson 6. Objectives Manage NTFS and share permissions Determine effective permissions Configure Windows printing.
7.3. Windows Security Descriptors
14.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 14: Protection Goals of Protection Principles of Protection Domain of Protection.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 14: Protection.
CS426Fall 2010/Lecture 91 Computer Security CS 426 Lecture 9 Unix Access Control.
Chapter 5 Network Security
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 4 – Access Control.
G53SEC 1 Access Control principals, objects and their operations.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Protection (Chapter 14)
Protection Nadeem Majeed Choudhary
CE Operating Systems Lecture 21 Operating Systems Protection with examples from Linux & Windows.
Linux Security. Authors:- Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of CodeSourcery LLC published by New Riders Publishing.
John Mitchell Announcement Thursday lecture: Alex Stamos, Yahoo! VP of Information Security (CISO) – Alex has been busy with Heartbleed – He is taking.
IS2150/TEL2810: Introduction of Computer Security1 October 18, 2005 Introduction to Computer Security Lecture 6 Windows/Unix/Solaris 10 Design Principles.
1 Chapter Overview Managing Object and Container Permissions Locating and Moving Active Directory Objects Delegating Control Troubleshooting Active Directory.
COEN 350: Network Security Authorization. Fundamental Mechanisms: Access Matrix Subjects Objects (Subjects can be objects, too.) Access Rights Example:
Chapter 14: Protection Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Apr 11, 2005 Chapter 14: Protection Goals.
Privilege Management Chapter 22.
Computer Security: Principles and Practice
Lecture 14 Page 1 CS 111 Summer 2013 Security in Operating Systems: Basics CS 111 Operating Systems Peter Reiher.
CSE Operating System Principles Protection.
Access Controls Mandatory Access Control by Sean Dalton December 5 th 2008.
Lecture 2 Page 1 CS 236 Online Security Policies Security policies describe how a secure system should behave Policy says what should happen, not how you.
CS703 - Advanced Operating Systems
Access Control Model SAM-5.
Access Control CSE 465 – Information Assurance Fall 2017 Adam Doupé
Chapter 14: System Protection
Introduction to Information Security , Spring 2016 Lecture 9: Secure Architecture Principles, Access Control Avishai Wool Slides credit: Eran.
Secure Architecture Principles Isolation and Least Privilege
Chapter 14: Protection.
Chapter 14: Protection.
Access Control and Operating System Security
Chapter 14: Protection.
CE Operating Systems Lecture 21
Chapter 14: Protection.
Chapter 14: Protection.
UNIX System Protection
Chapter 14: Protection.
OS Access Control Mauricio Sifontes.
Chapter 14: Protection.
Chapter 14: Protection.
Chapter 14: Protection.
CS703 - Advanced Operating Systems
Designing IIS Security (IIS – Internet Information Service)
Presentation transcript:

Operating System Security John Mitchell

Operating System Functions uOS is a resource allocator Manages resources, decides between conflicting requests uOS is a control program Controls execution of programs to prevent errors and improper use of the system

Security issues uIsolation Separate processes execute in separate memory space Process can only manipulate allocated pages uAccess control When can process create or access a file? Create or read/write to socket? Make a specific system call? uProtection problem Ensure that each object is accessed correctly and only by those processes that are allowed to do so uComparison between different operating systems Compare protection models: which model supports least privilege most effectively? Which system best enforces its protection model?

Outline uAccess Control Concepts Matrix, ACL, Capabilities Multi-level security (MLS) uOS Mechanisms Multics –Ring structure Amoeba –Distributed, capabilities Unix –File system, Setuid Windows –File system, Tokens, EFS SE Linux –Role-based, Domain type enforcement u Topics for next lecture Secure OS –Methods for resisting stronger attacks Cryptographic file systems Assurance –Orange Book, TCSEC –Common Criteria –Windows 2000 certification Some Limitations –Information flow –Covert channels

Access control uContext System knows who the user is –User has entered a name and password, or other info Access requests pass through gatekeeper –OS must be designed so monitor cannot be bypassed ? Resource User process Decide whether user can apply operation to resource Reference monitor

Access control matrix [Lampson] File 1File 2File 3…File n User 1readwrite--read User 2write -- User 3---read … User mreadwritereadwriteread Subjects Objects

Two implementation concepts uAccess control list (ACL) Store column of matrix with the resource uCapability User holds a “ticket” for each resource Two variations –store row of matrix with user, under OS control –unforgeable ticket in user space File 1File 2… User 1readwrite- User 2write - User 3--read … User mreadwrite Access control lists are widely used, often with groups Some aspects of capability concept are used in Kerberos, …

Capabilities uOperating system concept “… of the future and always will be …” uExamples Dennis and van Horn, MIT PDP-1 Timesharing Hydra, StarOS, Intel iAPX 432, Eros, … Amoeba: distributed, unforgeable tickets uReferences Henry Levy, Capability-based Computer Systems Tanenbaum, Amoeba papers

ACL vs Capabilities uAccess control list Associate list with each object Check user/group against list Relies on authentication: need to know user uCapabilities Capability is unforgeable ticket –Random bit sequence, or managed by OS –Can be passed from one process to another Reference monitor checks ticket –Does not need to know identify of user/process

ACL vs Capabilities Process P User U Process Q User U Process R User U Process P Capabilty c,d Process Q Process R Capabilty c

ACL vs Capabilities uDelegation Cap: Process can pass capability at run time ACL: Try to get owner to add permission to list uRevocation ACL: Remove user or group from list Cap: Try to get capability back from process? –Possible in some systems if appropriate bookkeeping OS knows what data is capability If capability is used for multiple resources, have to revoke all or none … Other details …

Roles (also called Groups) uRole = set of users Administrator, PowerUser, User, Guest Assign permissions to roles; each user gets permission uRole hierarchy Partial order of roles Each role gets permissions of roles below List only new permissions given to each role Administrator Guest PowerUser User

Groups for resources, rights uPermission =  right, resource  uPermission hierarchies If user has right r, and r>s, then user has right s If user has read access to directory, user has read access to every file in directory uBig problem in access control Complex mechanisms require complex input Difficult to configure and maintain Roles, other organizing ideas try to simplify problem

Multi-Level Security (MLS) Concepts uMilitary security policy –Classification involves sensitivity levels, compartments –Do not let classified information leak to unclassified files uGroup individuals and resources Use some form of hierarchy to organize policy uOther policy concepts Separation of duty “Chinese Wall” Policy

Military security policy uSensitivity levels Top Secret Secret Confidential Restricted Unclassified uCompartments Satellite data Afghanistan Middle East Israel

Military security policy uClassification of personnel and data Class =  rank, compartment  uDominance relation D 1  D 2 iff rank 1  rank 2 and compartment 1  compartment 2 Example:  Restricted, Israel    Secret, Middle East  uApplies to Subjects – users or processes Objects – documents or resources

Commercial version Internal Proprietary Public Product specifications In production OEM Discontinued

Bell-LaPadula Confidentiality Model uWhen is it OK to release information? uTwo Properties (with silly names) Simple security property –A subject S may read object O only if C(O)  C(S) *-Property –A subject S with read access to O may write object P only if C(O)  C(P) uIn words, You may only read below your classification and only write above your classification

Picture: Confidentiality S Public Proprietary Read below, write above S Public Proprietary Read above, write below

Biba Integrity Model uRules that preserve integrity of information uTwo Properties (with silly names) Simple integrity property –A subject S may write object O only if C(S)  C(O) (Only trust S to modify O if S has higher rank …) *-Property –A subject S with read access to O may write object P only if C(O)  C(P) (Only move info from O to P if O is more trusted than P) uIn words, You may only write below your classification and only read above your classification

Picture: Integrity S Public Proprietary Read above, write below S Public Proprietary Read below, write above

Problem: Models appear contradictory uBell-LaPadula Confidentiality Read down, write up uBiba Integrity Read up, write down uWant both confidentiality and integrity Contradiction is partly an illusion May use Bell-LaPadula for some classification of personnel and data, Biba for another –Otherwise, only way to satisfy both models is only allow read and write at same classification In reality: Bell-LaPadula used more than Biba model, e.g., Common Criteria

Other policy concepts uSeparation of duty If amount is over $10,000, check is only valid if signed by two authorized people Two people must be different Policy involves role membership and  uChinese Wall Policy Lawyers L1, L2 in Firm F are experts in banking If bank B1 sues bank B2, –L1 and L2 can each work for either B1 or B2 –No lawyer can work for opposite sides in any case Permission depends on use of other permissions These policies cannot be represented using access matrix

Example OS Mechanisms uMultics uAmoeba uUnix uWindows uSE Linux (briefly)

Multics uOperating System Designed –MIT Project MAC, Bell Labs, GE At peak, ~100 Multics sites Last system, Canadian Department of Defense, Nova Scotia, shut down October, 2000 u Extensive Security Mechanisms Influenced many subsequent systems E.I. Organick, The Multics System: An Examination of Its Structure, MIT Press, 1972

Multics time period uTimesharing was new concept Serve Boston area with one 386-based PC F.J. Corbato

Multics Innovations uSegmented, Virtual memory Hardware translates virtual address to real address uHigh-level language implementation Written in PL/1, only small part in assembly lang uShared memory multiprocessor Multiple CPUs share same physical memory uRelational database Multics Relational Data Store (MRDS) in 1978 uSecurity Designed to be secure from the beginning First B2 security rating (1980s), only one for years

Multics Access Model uRing structure A ring is a domain in which a process executes Numbered 0, 1, 2, … ; Kernel is ring 0 Graduated privileges –Processes at ring i have privileges of every ring j > i uSegments Each data area or procedure is called a segment Segment protection  b1, b2, b3  with b1  b2  b3 –Process/data can be accessed from rings b1 … b2 –A process from rings b2 … b3 can only call segment at restricted entry points

Multics process uMultiple segments Segments are dynamically linked Linking process uses file system to find segment A segment may be shared by several processes uMultiple rings Procedure, data segments each in specific ring Access depends on two mechanisms –Per-Segment Access Control File author specifies the users that have access to it –Concentric Rings of Protection Call or read/write segments in outer rings To access inner ring, go through a “gatekeeper” uInterprocess communication through “channels”

Amoeba uDistributed system Multiple processors, connected by network Process on A can start a new process on B Location of processes designed to be transparent uCapability-based system Each object resides on server Invoke operation through message to server –Send message with capability and parameters –Sever uses object # to indentify object –Sever checks rights field to see if operation is allowed –Check field prevents processes from forging capabilities Server portCheck field Obj # Rights

Capabilities uOwner capability When server creates object, returns owner cap. –All rights bits are set to 1 (= allow operation) –Check field contains 48-bit rand number stored by server uDerived capability Owner can set some rights bits to 0 Calculate new check field –XOR rights field with random number from check field –Apply one-way function to calculate new check field Server can verify rights and check field –Without owner capability, cannot forge derived capability Server portCheck field Obj # Rights Protection by user-process at server; no special OS support needed

Unix file security uEach file has owner and group uPermissions set by owner Read, write, execute Owner, group, other Represented by vector of four octal values uOnly owner, root can change permissions This privilege cannot be delegated or shared uSetid bits – Discuss in a few slides rwx - ownrgrpothr setid

Question uOwner can have fewer privileges than other What happens? –Owner gets access? –Owner does not? uPrioritized resolution of differences if user = owner then owner permission else if user in group then group permission else other permission

Effective user id (EUID) uEach process has three Ids (+ more under Linux) Real user ID (RUID) –same as the user ID of parent (unless changed) –used to determine which user started the process Effective user ID (EUID) –from set user ID bit on the file being executed, or sys call –determines the permissions for process file access and port binding Saved user ID (SUID) –So previous EUID can be restored uReal group ID, effective group ID, used similarly

Process Operations and IDs uRoot ID=0 for superuser root; can access any file uFork and Exec Inherit three IDs, except exec of file with setuid bit uSetuid system calls seteuid(newid) can set EUID to –Real ID or saved ID, regardless of current EUID –Any ID, if EUID=0 uDetails are actually more complicated Several different calls: setuid, seteuid, setreuid

Setid bits on executable Unix file uThree setid bits Setuid – set EUID of process to ID of file owner Setgid – set EGID of process to GID of file Sticky –Off: if user has write permission on directory, can rename or remove files, even if not owner –On: only file owner, directory owner, and root can rename or remove file in the directory

Example …; exec( ); RUID 25 SetUID program …; i=getruid() setuid(i); …; RUID 25 EUID 18 RUID 25 EUID 25 -rw-r--r-- file -rw-r--r-- file Owner 18 Owner 25 read/write Owner 18

Compare to stack inspection uCareful with Setuid ! Can do anything that owner of file is allowed to do Be sure not to –Take action for untrusted user –Return secret data to untrusted user A1 B1 C1 Note: anything possible if root; no middle ground between user and root

Setuid programming uWe talked about this before … uBe Careful! Root can do anything; don’ t get tricked Principle of least privilege – change EUID when root privileges no longer needed uSetuid scripts This is a bad idea Historically, race conditions –Begin executing setuid program; change contents of program before it loads and is executed

Unix summary uMany of you may be used to this … So probably seems pretty good We overlook ways it might be better uGood things Some protection from most users Flexible enough to make things possible uMain bad thing Too tempting to use root privileges No way to assume some root privileges without all root privileges

Access control in Windows (NTFS) uSome basic functionality similar to Unix Specify access for groups and users –Read, modify, change owner, delete uSome additional concepts Tokens Security attributes uGenerally More flexibility than Unix –Can define new permissions –Can give some but not all administrator privileges

Sample permission options uSecurity ID (SID) Identity (replaces UID) –SID revision number – 48-bit authority value –variable number of Relative Identifiers (RIDs), for uniqueness Users, groups, computers, domains, domain members all have SIDs

Permission Inheritance uStatic permission inheritance (Win NT) Initially, subfolders inherit permissions of folder Folder, subfolder changed independently Replace Permissions on Subdirectories command –Eliminates any differences in permissions uDynamic permission inheritance (Win 2000) Child inherits parent permission, remains linked Parent changes are inherited, except explicit settings Inherited and explicitly-set permissions may conflict – Resolution rules Positive permissions are additive Negative permission (deny access) takes priority

Tokens uSecurity Reference Monitor uses tokens to identify the security context of a process or thread uSecurity context privileges, accounts, and groups associated with the process or thread uImpersonation token thread uses temporarily to adopt a different security context, usually of another user

Security Descriptor uInformation associated with an object who can perform what actions on the object uSeveral fields Header –Descriptor revision number –Control flags, attributes of the descriptor E.g., memory layout of the descriptor SID of the object's owner SID of the primary group of the object Two attached optional lists: –Discretionary Access Control List (DACL) – users, groups, … –System Access Control List (SACL) – system logs,..

Example access request User: Mark Group1: Administrators Group2: Writers Control flags Group SID DACL Pointer SACL Pointer Deny Writers Read, Write Allow Mark Read, Write Owner SID Revision Number Access token Security descriptor Access request: write Action: denied User Mark requests write permission Descriptor denies permission to group Reference Monitor denies request

Impersonation Tokens (setuid?) uProcess uses security attributes of another Client passes impersonation token to server uClient specifies impersonation level of server Anonymous –Token has no information about the client Identification –server obtain the SIDs of client and client's privileges, but server cannot impersonate the client Impersonation –server identify and impersonate the client Delegation –lets server impersonate client on local, remote systems

SELinux Security Policy Abstractions uType enforcement Each process has an associated domain Each object has an associated type Configuration files specify –How domains are allowed to access types –Allowable interactions and transitions between domains uRole-based access control Each process has an associated role –Separate system and user processes configuration files specify –Set of domains that may be entered by each role

Outline uAccess Control Concepts Matrix, ACL, Capabilities Multi-level security (MLS) uOS Mechanisms Multics –Ring structure Amoeba –Distributed, capabilities Unix –File system, Setuid Windows –File system, Tokens, EFS SE Linux –Role-based, Domain type enforcement u Topics for next lecture Secure OS –Methods for resisting stronger attacks Cryptographic file systems Assurance –Orange Book, TCSEC –Common Criteria –Windows 2000 certification Some Limitations –Information flow –Covert channels