Lecture 9 Page 1 CS 136, Spring 2009 Operating System Security CS 136 Computer Security Peter Reiher April 28, 2009.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

Lecture 19 Page 1 CS 111 Online Protecting Operating Systems Resources How do we use these various tools to protect actual OS resources? Memory? Files?
CMSC 414 Computer (and Network) Security Lecture 13 Jonathan Katz.
Lecture 12 Page 1 CS 111 Online Devices and Device Drivers CS 111 On-Line MS Program Operating Systems Peter Reiher.
Chapter 6 Limited Direct Execution
Lecture 2 Page 1 CS 236, Spring 2008 Security Principles and Policies CS 236 On-Line MS Program Networks and Systems Security Peter Reiher Spring, 2008.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Operating System Organization
Lecture 19 Page 1 CS 111 Online Security for Operating Systems: Cryptography, Authentication, and Protecting OS Resources CS 111 On-Line MS Program Operating.
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Programming Satan’s Computer
Lecture 7 Page 1 CS 236 Online Password Management Limit login attempts Encrypt your passwords Protecting the password file Forgotten passwords Generating.
Lecture 18 Page 1 CS 111 Online Design Principles for Secure Systems Economy Complete mediation Open design Separation of privileges Least privilege Least.
Lecture 29 Page 1 Advanced Network Security Privacy in Networking Advanced Network Security Peter Reiher August, 2014.
Lecture 19 Page 1 CS 111 Online Symmetric Cryptosystems C = E(K,P) P = D(K,C) E() and D() are not necessarily the same operations.
Lecture 8 Page 1 CS 136, Fall 2014 Operating System Security Computer Security Peter Reiher October 30, 2014.
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.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems CSCI-6140 – Computer Operating Systems David Goldschmidt, Ph.D.
Lecture 8 Page 1 CS 236, Spring 2008 Protecting Interprocess Communications Operating systems provide various kinds of interprocess communications –Messages.
1 Architectural Support for Copy and Tamper Resistant Software David Lie, Chandu Thekkath, Mark Mitchell, Patrick Lincoln, Dan Boneh, John Mitchell and.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Lecture 17 Page 1 CS 236 Online Privacy CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Lecture 7 Page 1 CS 236, Spring 2008 Challenge/Response Authentication Authentication by what questions you can answer correctly –Again, by what you know.
(a) What is the output generated by this program? In fact the output is not uniquely defined, i.e., it is not always the same. So please give three examples.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Lecture 4 Page 1 CS 111 Online Modularity and Virtualization CS 111 On-Line MS Program Operating Systems Peter Reiher.
Lecture 7 Page 1 CS 111 Online Process Communications and Concurrency CS 111 On-Line MS Program Operating Systems Peter Reiher.
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.
Lecture 12 Page 1 CS 111 Summer 2014 Security in Operating Systems: Basics CS 111 Operating Systems Peter Reiher.
Lecture 15 Page 1 CS 236 Online Evaluating Running Systems Evaluating system security requires knowing what’s going on Many steps are necessary for a full.
Lecture 7 Page 1 CS 236 Online Challenge/Response Authentication Authentication by what questions you can answer correctly –Again, by what you know The.
Lecture 8 Page 1 CS 236 Online Protecting Interprocess Communications Operating systems provide various kinds of interprocess communications –Messages.
Lecture 3 Page 1 CS 236 Online Introduction to Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Lecture 3 Page 1 CS 236 Online Security Mechanisms CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Lecture 8 Page 1 CS 236, Spring 2008 Operating System Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher Spring, 2008.
Lecture 10 Page 1 CS 111 Online Memory Management CS 111 On-Line MS Program Operating Systems Peter Reiher.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
Lecture 8 Page 1 CS 136, Fall 2012 Operating System Security CS 136 Computer Security Peter Reiher October 23, 2012.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Lecture 12 Page 1 CS 136, Spring 2009 Network Security: Firewalls CS 136 Computer Security Peter Reiher May 12, 2009.
Lecture 14 Page 1 CS 236 Online Secure Programming CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Outline What does the OS protect? Authentication for operating systems
Outline The basic authentication problem
Protecting Interprocess Communications
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
Kernel Design & Implementation
Protecting Interprocess Communications
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
Protecting Interprocess Communications
Protecting Memory What is there to protect in memory?
Password Management Limit login attempts Encrypt your passwords
Outline What does the OS protect? Authentication for operating systems
Chapter 2: System Structures
Modularity and Memory Clearly, programs must have access to memory
Outline What does the OS protect? Authentication for operating systems
Resource Management Chapter 19 9/20/2018 Crowley OS Chap. 19.
Outline What does the OS protect? Authentication for operating systems
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Outline Interprocess communications protection
Outline Interprocess communications protection
Protecting Interprocess Communications
Outline Introduction Memory protection Buffer overflows
Outline What does the OS protect? Authentication for operating systems
Presentation transcript:

Lecture 9 Page 1 CS 136, Spring 2009 Operating System Security CS 136 Computer Security Peter Reiher April 28, 2009

Lecture 9 Page 2 CS 136, Spring 2009 Outline Interprocess communications protection File protection and disk encryption Protecting other OS resources

Lecture 9 Page 3 CS 136, Spring 2009 Protecting Interprocess Communications Operating systems provide various kinds of interprocess communications –Messages –Semaphores –Shared memory –Sockets How can we be sure they’re used properly?

Lecture 9 Page 4 CS 136, Spring 2009 IPC Protection Issues How hard it is depends on what you’re worried about For the moment, let’s say we’re worried about one process improperly using IPC to get info from another –Process A wants to steal information from process B How would process A do that?

Lecture 9 Page 5 CS 136, Spring 2009 Message Security Process AProcess B Can process B use message- based IPC to steal the secret? Gimme your secret That’s probably not going to work

Lecture 9 Page 6 CS 136, Spring 2009 How Can B Get the Secret? He can convince the system he’s A –A problem for authentication He can break into A’s memory –That doesn’t use message IPC –And is handled by page tables He can forge a message from someone else to get the secret –But OS tags IPC messages with identities He can “eavesdrop” on someone else who gets the secret

Lecture 9 Page 7 CS 136, Spring 2009 Can an Attacker Really Eavesdrop on IPC Message? On a single machine, what is a message send, really? A message is copied from a process buffer to an OS buffer –Then from the OS buffer to another process’ buffer –Sometimes optimizations skip some copies If attacker can’t get at processes’ internal buffers and can’t get at OS buffers, he can’t “eavesdrop” Need to handle page reuse (discussed earlier)

Lecture 9 Page 8 CS 136, Spring 2009 Other Forms of IPC Semaphores, sockets, shared memory, RPC Pretty much all the same –Use system calls for access –Which belong to some process –Which belongs to some principal –OS can check principal against access control permissions at syscall time –Ultimately, data is held in some type of memory Which shouldn’t be improperly accessible

Lecture 9 Page 9 CS 136, Spring 2009 So When Is It Hard? 1.Always possible that there’s a bug in the operating system –Allowing masquerading, eavesdropping, etc. –Or, if the OS itself is compromised, all bets are off 2.What if the OS has to prevent cooperating processes from sharing information?

Lecture 9 Page 10 CS 136, Spring 2009 The Hard Case Process AProcess B Process A wants to tell the secret to process B But the OS has been instructed to prevent that A necessary part of Bell-La Padula, e.g. Can the OS prevent A and B from colluding to get the secret to B?

Lecture 9 Page 11 CS 136, Spring 2009 OS Control of Interactions OS can “understand” the security policy Can maintain labels on files, process, data pages, etc. Can regard any IPC or I/O as a possible leak of information –To be prohibited if labels don’t allow it

Lecture 9 Page 12 CS 136, Spring 2009 Covert Channels Tricky ways to pass information Requires cooperation of sender and receiver –Generally in active attempt to deceive system Use something not ordinarily regarded as a communications mechanism

Lecture 9 Page 13 CS 136, Spring 2009

Lecture 9 Page 14 CS 136, Spring 2009 Covert Channels in Computers Generally, one process “sends” a covert message to another –But could be computer to computer How? –Disk activity –Page swapping –Time slice behavior –Use of a peripheral device –Limited only by imagination

Lecture 9 Page 15 CS 136, Spring 2009 Handling Covert Channels Relatively easy if you know what the channel is –Put randomness/noise into channel to wash out message Hard to impossible if you don’t know what the channel is Not most people’s problem

Lecture 9 Page 16 CS 136, Spring 2009 File Protection How do we apply these access protection mechanisms to a real system resource? Files are a common example of a typically shared resource If an OS supports multiple users, it needs to address the question of file protection

Lecture 9 Page 17 CS 136, Spring 2009 Unix File Protection A model for protecting files developed in the 1970s Still in very wide use today –With relatively few modifications To review, three subjects Owner, group, other and three modes –Read, write, execute –Sometimes these have special meanings

Lecture 9 Page 18 CS 136, Spring 2009 Setuid/Setgid Programs Unix mechanisms for changing your user identity and group identity Either indefinitely or for the run of a single program Created to deal with inflexibilities of the Unix access control model But the source of endless security problems

Lecture 9 Page 19 CS 136, Spring 2009 Why Are Setuid Programs Necessary? The print queue is essentially a file Someone must own that file Can’t make it world-writable –Or people will delete each other’s jobs So how will people put stuff in the print queue? Typical Unix answer is run the printing program setuid –To the owner of the print queue –Program only allows limited manipulation of the queue

Lecture 9 Page 20 CS 136, Spring 2009 Why Are Setuid Programs Dangerous? Essentially, setuid programs expand a user’s security domain In an encapsulated way –Abilities of the program limit the operations in that domain Need to be damn sure that the program’s abilities are limited

Lecture 9 Page 21 CS 136, Spring 2009 Some Examples of Setuid Dangers Setuid programs that allow forking of a new shell Setuid programs with powerful debugging modes Setuid programs with “interesting” side effects –E.g., lpr options that allow file deletion

Lecture 9 Page 22 CS 136, Spring 2009 Encrypted File Systems Data stored on disk is subject to many risks –Improper access through OS flaws –But also somehow directly accessing the disk If the OS protections are bypassed, how can we protect data? How about if we store it in encrypted form?

Lecture 9 Page 23 CS 136, Spring 2009 An Example of an Encrypted File System Sqzmredq #099 sn lx rzuhmfr zbbntms KsKs Transfer $100 to my savings account Issues for encrypted file systems: When does the cryptography occur? Where does the key come from? What is the granularity of cryptography?

Lecture 9 Page 24 CS 136, Spring 2009 When Does Cryptography Occur? Transparently when a user opens a file? –In disk drive? –In OS? –In file system? By explicit user command? –Or always, implicitly? How long is the data decrypted? Where does it exist in decrypted form?

Lecture 9 Page 25 CS 136, Spring 2009 Where Does the Key Come From? Provided by human user? Stored somewhere in file system? Stored on a smart card? Stored in the disk hardware? Stored on another computer? Where and for how long do we store the key?

Lecture 9 Page 26 CS 136, Spring 2009 What Is the Granularity of Cryptography? An entire file system? Per file? Per block? Consider both in terms of: –How many keys? –When is a crypto operation applied?

Lecture 9 Page 27 CS 136, Spring 2009 What Are You Trying to Protect Against With Crypto File Systems? Unauthorized access by improper users? –Why not just access control? The operating system itself? –What protection are you really getting? Data transfers across a network? –Why not just encrypt while in transit? Someone who accesses the device not using the OS? –A realistic threat in your environment?

Lecture 9 Page 28 CS 136, Spring 2009 Full Disk Encryption All data on the disk is encrypted Data is encrypted/decrypted as it enters/leaves disk Primary purpose is to prevent improper access to stolen disks –Designed mostly for laptops

Lecture 9 Page 29 CS 136, Spring 2009 Hardware Vs. Software Full Disk Encryption HW advantages: –Probably faster –Totally transparent, works for any OS –Setup probably easier HW disadvantages: –Not ubiquitously available today –More expensive (not that much, though - ~$90 vs. ~$60 for 320Gbyte disk) –Might not fit into a particular machine –Backward compatibility

Lecture 9 Page 30 CS 136, Spring 2009 An Example of Hardware Full Disk Encryption Seagate’s Momentus 7200 FDE product line Hardware encryption for entire disk –Using AES Key accessed via user password, smart card, or biometric authentication –Authentication information stored internally on disk –Check performed by the disk itself, pre-boot 300 Mbytes/sec sustained transfer rate Primarily for laptops

Lecture 9 Page 31 CS 136, Spring 2009 Example of Software Full Disk Encryption Vista BitLocker Doesn’t encrypt quite the whole drive –Need unencrypted partition to hold bootstrap stuff Uses AES for cryptography Key stored either in special hardware or USB drive Microsoft claims “single digit percentage” overhead –One independent study claims 12%

Lecture 9 Page 32 CS 136, Spring 2009 Protecting Other Resources Devices The processor itself

Lecture 9 Page 33 CS 136, Spring 2009 Protecting Devices Some handled through file system protection/authentication Others by only allowing kernel to access them –User access mediated by the kernel –Assumes kernel will be careful in what it allows users to do

Lecture 9 Page 34 CS 136, Spring 2009 Protecting the Processor Mostly about protecting processes from each other But also about ensuring user-level processes can’t execute privileged instructions –Most typically, instructions OS needs to do its work –Syscalls used to explicitly change mode

Lecture 9 Page 35 CS 136, Spring 2009 Presumptions for Processor Protection Assume context switch code clears out all info from old process –Registers, etc. Model is that processor is clean and devoted only to current user Switch to privileged mode is explicit –Don’t allow arbitrary user code to run in this mode