42
Department of Computer Science Institute for System Architecture, Operating Systems Group CARSTEN WEINHOLD SECURITY ARCHITECTURES

SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

Department of Computer Science Institute for System Architecture, Operating Systems Group

CARSTEN WEINHOLD

SECURITY ARCHITECTURES

Page 2: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Motivation

2

■ Not very new news:

■ Users are plagued by malware

■ Companies and government agencies are high value targets

■ Critical data gets stolen

■ ...

■ Sad truth: threats won‘t go away

Page 3: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Classical Architectures

3

Page 4: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Isolation■ Isolation in commodity OSes based

on user accounts

■ Problems:

■ Same privileges for all apps

■ Permissive Interfaces (e.g., ptrace to manipulate other address spaces)

■ Malware is dangerous and real

■ Efforts to restrict privileges:

■ SELinux, AppArmor, Seatbelt, ...4

Page 5: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Physical Isolation■ Separate computers

■ Applications and data physically isolated

■ Effective, but ...

■ High costs

■ Needs more space

■ Inconvenient

■ Exposure to network may pose threat

5

OS

Hardware

App

Hardware

OS

App

PC 1 PC 2

Page 6: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Virtual Machines■ Multiple VMs, OSes

■ Isolation enforced by virtualization layer

■ Saves space, energy, maintenance effort

■ But still ...

■ Switching between VMs is inconvenient

■ Even more code6

OS

Virtualization Layer

App

Hardware

OS

App

VM 1 VM 2

Page 7: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

So far ...

■ Huge code bases remain

■ Many targets to attack:

■ Application, Commodity OS

■ Virus scanner, firewall, ...

■ Expensive communication via (virtual) Ethernet

■ High resource consumption even for small applications

7

Page 8: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Microkernel & Multi-server OS

8

Page 9: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Loader

Nizza Architecture

9

Microkernel

GUINames UserAuth

SecureStorage

I/OSupport

Legacy OS

LegacyApp

SigningApp

E-CommerceApp

BankingApp

Page 10: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Nizza Key Principles

10

■ Nizza architecture based on basic design concepts:

■ Strong isolation

■ Application-specific TCBs

■ Legacy reuse

■ Trusted wrapper

■ Trusted Computing

Page 11: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

App-specific TCBs

11

Loader

Microkernel

GUINames UserAuth

SecureStorage

I/OSupport

Key Mgt

IP Stack SigningApp

VirtualEthernet

NetworkApp

Legacy OS

LegacyApp

Page 12: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

App-specific TCBs

■ Reflects principle of least privilege

■ TCB of an application includes only components its security relies upon

■ TCB does not include unrelated applications or services

■ Mechanisms:

■ Address spaces for strong isolation

■ Well-defined interfaces

12

Page 13: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Legacy Reuse

■ New OS? Do not reinvent the wheel!

■ Existing software can be reused:

■ Applications (e.g., e-mail clients, ...)

■ Protocol stacks (e.g., TCP/IP)

■ Commodity OSes (e.g., Linux)

■ Virtualization is important enabler

■ Legacy code often does not need to be trusted

13

Page 14: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Easy Reuse

■ Run OS in VM to reuse unmodified applications

■ Useful for applications that are not security critical

■ Also improves isolation:

■ Use VM to sandbox applications and OS

■ Isolation at VM granularity

14

Basic Services

Legacy OS

LegacyApp

Microkernel

Page 15: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

TCB--; Security++;■ To further improve security:

■ Reduce size of attack surface

■ Reduce size of TCB

■ First idea:

■ Port application to microkernel-based multi-server OS

■ Removes huge legacy OS from TCB

■ Possible approaches discussed in lecture on „Legacy Containers“

15

Page 16: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Splitting Components

16

Page 17: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Split Applications■ Problems with porting applications:

■ Dependencies need to be satisfied

■ Can be complex, even infeasible

■ Stripped down applications may lack functionality / usability

■ Better idea: split application

■ Make only security-critical parts run on microkernel-based OS

■ Reduces size of TCB even further17

Page 18: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Split App Example

18

■ Critical functionality to support digitally signed e-mails:

■ Handling of signature keys

■ Requesting passphrase to unlock secret signature key

■ Presenting e-mail message:■ Before sending: „What You See Is What

You Sign“■ After receiving: verify signature, identify

sender

Page 19: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Signing E-Mails

19

Loader

Microkernel

GUINames UserAuth

SecureStorage

I/OSupport

Legacy OS

LegacyApp

SigningApp

Page 20: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Benefit of Splitting

20

■ >1,500,000 SLOC no longer in TCB:

■ Linux kernel, drivers, X-Server

■ C and GUI libraries, Thunderbird

■ TCB size reduced to ~150,000 SLOC:

■ GNU Privacy Guard, e-mail viewer

■ Basic L4 system

■ At least 10 times less code in TCB

■ Method not restricted to applications

Page 21: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Reuse OS Services?■ Network and file system stacks are

virtually essential subsystems

■ Generally well tested

■ Ready for production use

■ ... but not bug free:

■ Month of Kernel Bugs 2006 [1,2]:■ 14 exploitable flaws in file systems:

UFS, ISO 9660, Ext3, SquashFS, ...■ WiFi drivers: remotely exploitable bugs

21

Page 22: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Trusted Wrappers

■ Complex protocol stacks should not be part of TCB

■ Reuse untrusted infrastructure through trusted wrapper:

■ Add security measures around existing APIs■ Cryptography■ Redundancy

■ Similar approaches: SSL, VPN22

Page 23: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Loader

Apps Need Storage

23

Microkernel

GUINames UserAuth

SecureStorage

I/OSupport

Legacy OS

LegacyApp

SigningApp

E-CommerceApp

BankingApp

How to provide secure and reliable storage for trusted applications?

Page 24: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Loader

Split File System

24

Microkernel

GUINames UserAuth

SecureStorage

I/OSupport

Legacy OS

UntrustedStorage Proxy

SigningApp

Page 25: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Protection Goals

25

■ Confidentiality: only authorized applications can access file system, all untrusted software cannot get any useful information

■ Integrity: all data and meta data is correct, complete, and up to date; otherwise report integrity error

■ Recoverability: damaged data in untrusted file system can be recovered from trusted backup

Page 26: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Design Space

26

Protection

Disk Driver

Block Layer

File System

VFS

App

Buffer Cache

■ First end of design space: Protect whole file system at block layer:

■ Common solution (e.g., dm_crypt in Linux)

■ Easy protection for all data

■ A lot of code in TCB

■ Little flexibility

Page 27: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Design Space

■ Second end of design space: Protect individual files near VFS / API layer:

■ Stacked file system (e.g., ecryptfs in Linux)

■ Flexible protection policies

■ Most parts of file system stack not part of TCB

■ Ideal for trusted wrapper

27

Protection

Disk Driver

Block Layer

File System

VFS

App

Buffer Cache

Page 28: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

VPFS Architecture

28

Wrapper

Disk Driver

Block Layer

File System

VFS

Trusted App

Buffer Cache

Crypto Layer

Proxy Stub

Buffer Cache

FS Proxy

Untrusted Trusted

Page 29: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

File Encryption

29

■ Files in untrusted legacy file system are arrays of encrypted blocks

■ VPFS Server takes care of on the fly encryption / decryption

■ Only buffer cache contains plaintext

Page 30: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

File Integrity

30

0 1 2 3 4 5 6 7 8

■ Hash tree embedded in files

■ Parents authenticate child nodes

Page 31: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Meta Data Integrity

31

Master Hash File

File

„Small SecureStorage“

File File File

Dir

Dir

Dir

Page 32: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Validity Checks

32

■ How to trust untrusted meta data?

■ „File exists“ / „File does not exist“:■ Validated inside TCB using cryptographic

proof and hash tree■ Efficient solution possible

■ Directory listings:■ Efficient solution requires functionality to

be implemented in TCB

■ Details in [3]

Page 33: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

VPFS Summary

33

■ Trusted wrapper shown to work for file systems

■ VPFS is general purpose file system

■ Significant reduction in code size:

■ VPFS adds 4,000 to 4,600 SLOC to application TCB

■ Standard Linux file system stack comprises >50,000 SLOC

■ More details in [3]

Page 34: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Security & Usability

34

Page 35: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Sharing The Screen

35

■ Isolated applications run in different domains of trust, but separate screens are inconvenient

■ The Nitpicker solution [4]:

■ Let all windows share the same screen

■ ... but securely:■ Make windows & applications identifiable■ Prevent them to spy on each other:

route input securely, no screenshots

Page 36: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Concepts

36

Buffers

Views

Page 37: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

How It Works

37

Buffers

Views

Page 38: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Nitpicker In Action

38

Page 39: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Demo

39

Page 40: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Open Questions

40

■ A few things not discussed today:

■ Where does VPFS store its secrets?

■ How does VPFS detect corrupt data?

■ How can a remote server be trusted?

■ How can we trust in what we see on the screen?

■ Missing element: Root of Trust

■ Discussed next week

Page 41: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

Next Week

41

■ January 27, 2009

■ Lecture „Trusted Computing“

■ no exercise (but complex lab)

■ February 3, 2009:

■ Lecture „Secure Programming“

■ Paper Reading Exercise

Page 42: SECURITY ARCHITECTURES - TU Dresdenos.inf.tu-dresden.de/Studium/KMB/WS2008/11-Security-Architectures.pdfTU Dresden Security Architectures Design Space Second end of design space: Protect

TU Dresden Security Architectures

References■ [1] http://www.heise.de/newsticker/Month-of-Kernel-Bugs-Ein-Zwischenstand--/meldung/81454

■ [2] http://projects.info-pull.com/mokb/

■ [3] Carsten Weinhold and Hermann Härtig, „VPFS: Building a Virtual Private File System with a Small Trusted Computing Base“, Proceedings of the 3rd ACM SIGOPS/EuroSys European Conference on Computer Systems 2008, 2008, Glasgow, Scotland UK

■ [4] Norman Feske and Christian Helmuth, „A Nitpicker's guide to a minimal-complexity secure GUI“, ACSAC '05: Proceedings of the 21st Annual Computer Security Applications Conference, 2005, Washington, DC, USA

42