Explicit Information Flow in the HiStar OS Nickolai Zeldovich, Silas Boyd-Wickizer, Eddie Kohler, David Mazières.

Slides:



Advertisements
Similar presentations
More on File Management
Advertisements

Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
CMSC 414 Computer (and Network) Security Lecture 13 Jonathan Katz.
PlanetLab Operating System support* *a work in progress.
CSE331: Introduction to Networks and Security Lecture 28 Fall 2002.
1 Emulab Security. 2 Current Security Model Threat model: No malicious authenticated users, Bad Guys are all “outside” –Protect against accidents on the.
Virtual Memory Virtual Memory Management in Mach Labels and Event Processes in Asbestos Ingar Arntzen.
Building Secure Software Chapter 9 Race Conditions.
1 CSE 380 Computer Operating Systems Instructor: Insup Lee and Dianna Xu University of Pennsylvania Fall 2003 Lecture Note: Protection Mechanisms.
1 Course Outline Processes & Threads CPU Scheduling Synchronization & Deadlock Memory Management File Systems & I/O Networks, Protection and Security.
Operating System Organization
G Robert Grimm New York University Protection and the Control of Information Sharing in Multics.
Highly Available ACID Memory Vijayshankar Raman. Introduction §Why ACID memory? l non-database apps: want updates to critical data to be atomic and persistent.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
M i SMob i S Mob i Store - Mobile i nternet File Storage Platform Chetna Kaur.
Controlling Files Richard Newman based on Smith “Elementary Information Security”
CMSC 414 Computer (and Network) Security Lecture 14 Jonathan Katz.
Cosc 4010 Sandboxing. Last lecture Last time, we covered chroot, which is a method to "sandbox" a problem. –Not full proof by any means. Many simple mistakes.
4P13 Week 1 Talking Points. Kernel Organization Basic kernel facilities: timer and system-clock handling, descriptor management, and process Management.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
Privilege separation in Condor Bruce Beckles University of Cambridge Computing Service.
Information Flow Language and System Level 1Dennis Kafura – CS5204 – Operating Systems.
CE Operating Systems Lecture 21 Operating Systems Protection with examples from Linux & Windows.
(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.
Zeldovich et al. (both papers) Reading Group by Theo.
Linux Security. Authors:- Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of CodeSourcery LLC published by New Riders Publishing.
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.
CS 346 – Chapter 11 File system –Files –Access –Directories –Mounting –Sharing –Protection.
Operating Systems Security
COEN 350: Network Security Authorization. Fundamental Mechanisms: Access Matrix Subjects Objects (Subjects can be objects, too.) Access Rights Example:
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Fall, Privacy&Security - Virginia Tech – Computer Science Click to edit Master title style Securing Distributed Systems with Information Flow Control.
Race conditions and synchronization issues Exploiting UNIX.
Implementing Remote Procedure Call Landon Cox February 12, 2016.
4P13 Week 5 Talking Points 1. Security Provided by BSD a self-protecting Trusted Computing Base (TCB) spanning kernel and userspace; kernel isolation.
Security-Enhanced Linux Stephanie Stelling Center for Information Security Department of Computer Science University of Tulsa, Tulsa, OK
W4118 Operating Systems Instructor: Junfeng Yang.
Securing Untrustworthy Software Using Information Flow Control
Disk Cache Main memory buffer contains most recently accessed disk sectors Cache is organized by blocks, block size = sector’s A hash table is used to.
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.
Introduction to Operating Systems
Understanding Android Security
Chapter 14: System Protection
Chapter 1: Introduction
Outline What does the OS protect? Authentication for operating systems
Operating System Structure
CS490 Windows Internals Quiz 2 09/27/2013.
Tutorial on Creating Certificates SSH Kerberos
Outline What does the OS protect? Authentication for operating systems
KERNEL ARCHITECTURE.
Introduction to Operating Systems
CE Operating Systems Lecture 21
Making Information Flow Explicit in HiStar Lecture 25, cs262a
UNIX System Protection
Lecture Topics: 11/1 General Operating System Concepts Processes
Chapter 2: Operating-System Structures
Chapter 2: The Linux System Part 5
Chapter 14: Protection.
Introduction to Operating Systems
EXOKERNEL Gabriel Beltran John Blackman David Martin Kurt Rohrbacher
Operating Systems : Overview
Operating Systems: A Modern Perspective, Chapter 3
Operating Systems : Overview
OS Components and Structure
Understanding Android Security
Chapter 2: Operating-System Structures
Preventing Privilege Escalation
Lecture 4: File-System Interface
CS703 - Advanced Operating Systems
Least-Privilege Isolation: The OKWS Web Server
Presentation transcript:

Explicit Information Flow in the HiStar OS Nickolai Zeldovich, Silas Boyd-Wickizer, Eddie Kohler, David Mazières

Too much trusted software ● Untrustworthy code a huge problem ● Users willingly run malicious software – Malware, spyware,... ● Even legitimate software is often vulnerable – Symantec remote vulnerability ● No sign that this problem is going away ● Can an OS make untrustworthy code secure?

Example: Virus Scanner Private User Files Virus Scanner /tmp Update Process Virus Database Network ● Goal: private files cannot go onto the network Symantec ™

Information Flow Control Private User Files Virus Scanner /tmp Update Process Virus Database Network ● Goal: private files cannot go onto the network

Buggy scanner leaks private data Private User Files Virus Scanner /tmp Update Process Virus Database Network ● Must restrict sockets to protect private data

Buggy scanner leaks private data Update Process Virus Database Network Private User Files Virus Scanner /tmp ● Must restrict scanner's ability to use IPC

Buggy scanner leaks private data Update Process Virus Database Network Private User Files Virus Scanner /tmp ● Must run scanner in chroot jail

Buggy scanner leaks private data Update Process Virus Database Network User Shel l ptrace Private User Files Virus Scanner /tmp ● Must run scanner with different UID

Buggy scanner leaks private data setproctitl e: 0x6e371b c2 Update Process Virus Database Network ps Private User Files /tmp ● Must restrict access to /proc,...

Buggy scanner leaks private data Update Process Virus Database Network disk usage Private User Files Private User Files Virus Scanner /tmp ● Must restrict FS'es that virus scanner can write

Buggy scanner leaks private data Update Process Virus Database Network fcntl locking Private User Files Virus Scanner /tmp ● List goes on – is there any hope?

What's going on? P1 Unix Kernel Unix P2P3 Hardware ● Kernel not designed to enforce these policies ● Retrofitting difficult – Need to track potentially any memory observed or modified by a system call! – Hard to even enumerate

What's going on? P1 Unix Kernel Unix P2P3 Hardware ● Kernel not designed to enforce these policies ● Retrofitting difficult – Need to track potentially any memory observed or modified by a system call! – Hard to even enumerate

HiStar Solution HiStar Kernel Unix HiStar Unix Library P1P2P3 U1U2U3 Hardware P1 Unix Kernel P2P3 Hardware ● Make all state explicit, track all communication

HiStar: Contributions ● Narrow kernel interface, few comm. channels – Minimal mechanism: enough for a Unix library – Strong control over information flow ● Unix support implemented as user-level library – Unix communication channels are made explicit, in terms of HiStar's mechanisms – Provides control over the gamut of Unix channels

HiStar kernel objects Segment (Data) Address Space Thread Gate (IPC) Container (Directory) Device (Network)

HiStar kernel objects Segment (Data) Address Space Thread Gate (IPC) Container (Directory) Device (Network) Label Think of labels as a “tainted” bit

HiStar: Unix process Code Segment Address Space Thread Process Container Data Segment

Unix File Descriptors Process AProcess B File Descriptor (O_RDONLY) Kernel State

Unix File Descriptors Process AProcess B File Descriptor (O_RDONLY) Kernel State ● Tainted process only talks to other tainted procs

Unix File Descriptors Process AProcess B File Descriptor (O_RDONLY) Seek pointer: 0xa32f Kernel State ● Lots of shared state in kernel, easy to miss

HiStar File Descriptors Address Space A Thread A File Descriptor Segment (O_RDONLY) Seek pointer: 0xa32f Address Space B Thread B

HiStar File Descriptors Address Space A Thread A File Descriptor Segment (O_RDONLY) Seek pointer: 0xa32f Address Space B Thread B ● All shared state is now explicitly labeled ● Just need segment read/write checks

Taint Tracking Strawman Tainted Thread A FileThread B write(File)

Taint Tracking Strawman Tainted Thread A Thread B write(File) File ● Propagate taint when writing to file

Taint Tracking Strawman Thread B read(File) ● Propagate taint when writing to file ● What happens when reading? Tainted Thread A File

Taint Tracking Strawman Thread B read(File) Tainted Thread A File

Strawman has Covert Channel Tainted Thread A File 0 File 1 Thread B Network Secret = 1 X

Strawman has Covert Channel Tainted Thread A Thread B File 0 File 1 Network write(File 1) Secret = 1

Strawman has Covert Channel Tainted Thread A Thread B File 0 File 1 Network read(File 0) read(File 1) Secret = 1

Strawman has Covert Channel Tainted Thread A Thread B File 0 File 1 Network send “secret=1” Secret = 1

Strawman has Covert Channel Tainted Thread A Thread B File 0 File 1 Network Secret = 1 read(File 0) read(File 1) ● What if we taint B when it reads File 1?

Strawman has Covert Channel Tainted Thread A Thread 0File 0 File 1Thread 1 Network Secret = 1 read(File 0) read(File 1) ● What if we taint B when it reads File 1?

Strawman has Covert Channel Tainted Thread A Thread 0File 0 File 1Thread 1 Network Secret = 1 send “secret=1” send “secret=0” ● What if we taint B when it reads File 1?

HiStar: Immutable File Labels Tainted Thread A Thread B read(...) Untainted File Tainted File write(...) ● Label (taint level) is state that must be tracked ● Immutable labels solve this problem!

Who creates tainted files? Tainted Thread A Untainted File Thread B DirectoryCreate Tainted File Tainted File ● Tainted thread can't modify untainted directory to place the new file there...

Thread B Tainted File Directory Tainted Thread A Create Tainted File Thread C HiStar: Untainted thread pre-creates tainted file ● Existence and label of tainted file provide no information about A Untainted File

Reading a tainted file Tainted Thread A Untainted File Thread B Tainted File Directory ● Existence and label of tainted file provide no information about A Thread C

Reading a tainted file Tainted Thread A Untainted File Thread B Tainted File Directory readdir(): T. File's label ● Existence and label of tainted file provide no information about A Thread C

Reading a tainted file Tainted Thread A Untainted File Thread B Tainted File Directory Taint self ● Existence and label of tainted file provide no information about A ● Neither does B's decision to taint Thread C

HiStar avoids file covert channels ● Immutable labels prevent covert channels that communicate through label state ● Untainted threads pre-allocate tainted files – File existence or label provides no secret information ● Threads taint themselves to read tainted files – Tainted file's label accessible via parent directory

Problems with IPC IP C Po rt DB Serve r Client Threa d Time ● IPC with tainted client – Taint server thread during request SELECT... Server Threads Create

Problems with IPC IP C Po rt IPC Ret urn DB Serve r Client Threa d Time ● IPC with tainted client – Taint server thread during request SELECT... Server Threads Create

Problems with IPC IP C Po rt IPC Ret urn DB Serve r Client Threa d Time ● IPC with tainted client – Taint server thread during request Results Server Threads Create

Problems with IPC IP C Po rt IPC Ret urn DB Serve r Client Threa d Time ● IPC with tainted client – Taint server thread during request – Secrecy preserved? Results Server Threads Create

Problems with IPC IP C Po rt IPC Ret urn DB Serve r Client Threa d Time ● IPC with tainted client – Taint server thread during request – Secrecy preserved? ● Lots of client calls – Limit server threads? Leaks information... – Otherwise, no control over resources! Create Results Server Threads

Gates make resources explicit ● Client donates initial resources (thread) Time Ga te DB Serve r Client Threa d SELECT... Server Threads Create

Gates make resources explicit ● Client donates initial resources (thread) ● Client thread runs in server address space, executing server code Time Ga te DB Serve r Client Threa d SELECT... Server Threads Create Server Code Re tur n Ga te

Gates make resources explicit ● Client donates initial resources (thread) ● Client thread runs in server address space, executing server code Time Ga te DB Serve r Client Threa d Results Server Threads Create Server Code Re tur n Ga te

Gates make resources explicit ● Client donates initial resources (thread) ● Client thread runs in server address space, executing server code ● No implicit resource allocation – no leaks Time Ga te DB Serve r Client Threa d Server Threads Create Server Code Re tur n Ga te Results

How do we get anything out? Network Virus Scanner Alice's Files

“Owner” privilege Alice's shell Network Virus Scanner Alice's Files ● Yellow objects can only interact with other yellow objects, or objects with yellow star ● Small, trusted shell can isolate a large, frequently-changing virus scanner

Multiple categories of taint Alice's shell Network Virus Scanner Alice's Files Bob's shell Bob's Files Virus Scanner ● Owner privilege and information flow control are the only access control mechanism ● Anyone can allocate a new category, gets star

What about “root”? ● Huge security hole for information flow control – Observe/modify anything – violate any security policy ● Make it explicit – Can be controlled as necessary

HiStar root privileges are explicit Alice's shell Bob's shell root's shell Alice's Files Bob's Files ● Kernel gives no special treatment to root

HiStar root privileges are explicit Bob's Secret Files Alice's shell Bob's shell root's shell Alice's Files Bob's Files ● Users can keep secret data inaccessible to root

What about inaccessible files? Bob's Secret Files Alice's shell Bob's shell root's shell Alice's Files Bob's Files ● Noone has privilege to access Bob's Secret Files

HiStar resource allocation Bob's Container Bob's Files Bob's shell

HiStar resource allocation Bob's Secret Container Bob's Container Bob's Files Bob's Secret Files Bob's shell ● Create a new sub-container for secret files

HiStar resource allocation Bob's Secret Container Bob's Container Bob's Files Bob's Secret Files Bob's shell ● Create a new sub-container for secret files

HiStar resource allocation Unlink ● Create a new sub-container for secret files ● Bob can delete sub-container even if he cannot otherwise access it! Bob's Secret Container Bob's Container Bob's Files Bob's Secret Files Bob's shell

HiStar resource allocation ● Create a new sub-container for secret files ● Bob can delete sub-container even if he cannot otherwise access it! Bob's Secret Container Bob's Container Bob's Files Bob's Secret Files Bob's shell

HiStar resource allocation ● Create a new sub-container for secret files ● Bob can delete sub-container even if he cannot otherwise access it! Bob's Container Bob's Files Bob's shell

HiStar resource allocation Bob's Container Bob's Files Bob's shell Root Container root's shell ● Root has control over all resources, via the root container

Persistent Storage ● Unix: file system implemented in the kernel – Many potential pitfalls leading to covert channels: mtime, atime, link counts,... – Would be great to implement it in user-space as well ● HiStar: Single-level store (ala Multics / EROS) – All kernel objects stored on disk – memory is a cache – No difference between disk & memory objects

File System Segment /tmp/one Container /tmp/two Filename Segment one two Container /tmp... ● Implemented at user-level, using same objects ● Security checks separate from FS implementation

HiStar kernel design ● Kernel operations make information flow explicit – Explicit operation for thread to taint itself ● Kernel never implicitly changes labels – Explicit resource allocation: gates, pre-created files ● Kernel never implicitly allocates resources ● Kernel has no concept of superuser – Users can explicitly grant their privileges to root – Root owns the top-level container

Applications ● Many Unix applications – gcc, gdb, openssh,... ● High-security applications alongside with Unix – Untrusted virus scanners (already described) – VPN/Internet data separation (see paper) – login with user-supplied authentication code (next)

Login on Unix ● Login must run as root – Only root can setuid() to grant user privileges ● Why is this bad? – Login is complicated (Kerberos, PAM,...) – Bugs lead to complete system compromise

Login on HiStar Login Process Alice's Auth. Service Bob's Auth. Service User: Bob Pass: 1bob PW: H(alic3) PW: H(1bob) ● Each user can provide their own auth. service

Login on HiStar Login Process Pass: 1bob Alice's Auth. Service Bob's Auth. Service PW: H(alic3) PW: H(1bob) ● Each user can provide their own auth. service

Login on HiStar Login Process OK Pass: 1bob Alice's Auth. Service Bob's Auth. Service PW: H(alic3) PW: H(1bob)

Password disclosure Login Process Pass: 1bob Alice's Auth. Service Bob's Auth. Service PW: H(alic3) PW: H(1bob) ● What if Bob mistypes his username as “alice”?

Password disclosure Login Process Pass: 1bob Alice's Auth. Service Bob's Auth. Service PW: H(alic3) PW: H(1bob) ● What if Bob mistypes his username as “alice”? Network

Avoiding password disclosure ● It's all about information flow – HiStar enforces: – “Password cannot go out onto the network” ● Details in the paper

Reducing trusted code ● HiStar allows developers to reduce trusted code – No code with every user's privilege during login – No trusted code needed to initiate authentication – 110-line trusted wrapper for complex virus scanner ● Small kernel: 16,000 lines of code

HiStar Conclusion ● HiStar reduces amount of trusted code – Enforce security properties on untrusted code using strict information flow control ● Kernel interface eliminates covert channels – Make everything explicit: labels, resources ● Unix library makes Unix information flow explicit – Superuser by convention, not by design

What about Asbestos? ● Different goal: Unix vs. specialized web server – HiStar closes covert channels inherent in the Asbestos design (mutable labels, IPC,...) – Lower-level kernel interface ● Process vs Container+Thread+AS+Segments+Gates ● 2 times less kernel code than Asbestos ● Generality shown by the user-space Unix library – System-wide support for persistent storage ● Asbestos uses trusted user-space file server – Resources are manageable ● In Asbestos, reboot to kill runaway process

How is this different from EROS? ● To isolate in EROS, must strictly partition the capabilities between isolated applications ● Labels enforce policy without affecting structure – Can impose policies on existing code (see paper)

Benchmarks, relative to Linux Comparable performance to Linux and OpenBSD Application-level benchmarks and disk benchmarks

Benchmarks, relative to Linux 217x faster! Synchronous creation of 10,000 files HiStar allows use of group sync. Application either runs to completion, or appears to never start (single-level store)

Benchmarks, relative to Linux 7.5x slower Linux: 9 syscalls per iteration HiStar: 317 syscalls per iteration