DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

50
DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1

Transcript of DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

Page 1: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

1

DIFC Programs byAutomatic Instrumentation

William Harris, Somesh Jha, and Thomas Reps

Page 2: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

2

Decentralized Information Flow ControlOperating System

(DIFC OS)

Allows programs to control flow of their datathroughout the entire system.

Page 3: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

3

Spawner

OS Policy

Worker

Enforce

Define

Network

Requester Worker

Page 4: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

4

void Program() { ...}

void Program() { label l = …; … add_tag(l);}

Page 5: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

Failing ProgramFailing Policy 5

Program Security Policy

Instrumenter

Secure Program

Our Approach

Page 6: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

6

Contributions

• From high-level policies to DIFC code

• Efficiently generate DIFC code

• Provide useful debugging information

Page 7: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

7

Spawner

Worker

Network

Requester

: (Worker ! Network)Requester $ WorkerRequester ! Spawner

Page 8: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

8

Outline

• Challenge of instrumentation

• Instrumentation via constraints

• Case studies

Page 9: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

9

The Challenge of Instrumentation

• DIFC mechanics

• Instrumenting a server

Page 10: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

10

DIFC Mechanics

P1

{ a }

P2P3

{ }

OS

{ a }

Page 11: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

11

raise a label = read more

Page 12: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

12

Raising a Label to Read

P2

+{ a }

Lab{ a }{ }

P1

Lab{ a }

add_tag(a);

Page 13: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

13

lower label = declassify

Page 14: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

14

Lowering a Label to Declassify

P1

+{ a }

Lab{ a }{ }

P2

Lab{ a }

Lab

{ }

-{ a }

Network

remove_tag(a);

Page 15: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

15

The Challenge of Instrumentation

• DIFC mechanics

• Instrumenting a server

Page 16: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

16

Spawner

Worker

Lab{ a }

-{ }

Proxy

+{ a }

-{ a }

Lab{ }

Lab{ } Network

Requester

: (Worker ! Network)Requester $ Worker

Page 17: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

Instrument DIFC code that is:1. Legal2. Secure3. Functional

Challenge of Instrumentation

Page 18: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

18

Outline

• Challenge of instrumentation

• Instrumentation via constraints

• Case studies

Page 19: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

19

Key Insight

From DIFC code,a DIFC system dynamically compares labels to decide flows.

Page 20: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

20

Key Insight

From a program and policy,an instrumenter statically constrainslabels to instrument DIFC code.

Page 21: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

21

Key Payoffs of Constraints

• Naturally express semantics, policies

• Efficiently generate DIFC code

• Provide useful debugging information

Page 22: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

22

Instrumentation via Constraints

• Generating constraints

• Solving constraints

Page 23: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

23

Generating Constraints

1. Legal

2. Secure

3. Functional

Page 24: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

24

Spawner

Worker

Network

Requester

void Spawner() {

1: Conn c = requestConn();

2: spawn(Worker, c);

}

Lab1 Pos1 Neg1 Create1

Lab2 Pos2 Neg2 Create2

Page 25: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

25

Legal Rule #1:A process’s label only increases by tags in its positive capability.

1: Conn c = requestConn();2: spawn(Worker, c);

Lab2 µ Lab1 [ Pos1

Page 26: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

26

Legal Rule #2:A process’s label only decreases bytags in its negative capability.

1: Conn c = requestConn();2: spawn(Worker, c);

Lab2 ¶ Lab1 - Neg1

Page 27: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

27

Legal Rule #3:A process’s capabilities only increase to hold tags that the process creates.

1: Conn c = requestConn();2: spawn(Worker, c);

Pos2 µ Pos1 [ Create1Neg2 µ Neg1 [ Create1

Page 28: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

28

Generating Constraints

1. Legal

2. Secure

3. Functional

Page 29: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

29

: (LabW – NegW µ LabN)Spawner

Worker

: (Worker ! Network)

Network

Requester

Page 30: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

30

Generating Constraints

1. Legal

2. Secure

3. Functional

Page 31: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

31

Worker

Requester $ Worker

Spawner

Network

Requester

LabW µ LabR LabR µ LabW

Page 32: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

32

Instrumentation via Constraints

• Generating constraints

• Solving constraints

Page 33: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

33

Solving Constraints

• NP-complete in general

• Amenable to SMT solvers in practice

Page 34: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

34

Worker $ RequesterRequester ! Spawner

Spawner

Worker

: (Worker ! Network)

Network

Requester

Lab2 µ Lab1 [ Pos1…

: (LabW – NegW µ LabN)

LabW µ LabR LabR µ LabWLabW µ LabS

LabS µ LabW

Page 35: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

35

Worker $ RequesterRequester ! Spawner

Spawner

Worker

: (Worker ! Network)

Network

Requester

Page 36: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

36

Worker $ RequesterWorker $ Proxy

Worker

: (Worker ! Network)

ProxyRequester $ Proxy Network

Requester

Page 37: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

37

Spawner

Worker

Lab{ a }

-{ }

Proxy

+{ a }

-{ a }

Lab{ }

Lab{ }

: (Worker ! Network)Worker $ ProxyRequester $ ProxyRequester ! Spawner Network

Requester

Page 38: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

38

void Spawner() {

tag a = create_tag();1: Conn c = requestConn();

2: spawn(Worker, c);

}

Lab1{ }

Pos1{ }

Neg1{ }

Create1{ a }

Lab2{ a }

Pos2{ a }

Neg2{ }

Create2{ }

2: spawn(Worker, c, lab: { a }, pos: { a }, neg: { });

Page 39: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

39

Outline

• Challenge of instrumentation

• Instrumentation via constraints

• Case studies

Page 40: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

40

Case Studies

Application Fully Automatic

Instr. Time (s)

Apache NO 2.302FlumeWiki YES 0.183ClamAV YES 1.374OpenVPN YES 7.912

Page 41: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

41

Program Security Policy

Instrumenter

Secure Program

Conclusion

Page 42: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

42

Thanks for listening!

Page 43: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

43

Program Security Policy

Instrumenter

Secure Program

Conclusion

Page 44: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

44

Extra Slides

Page 45: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

45

Expressivity vs. Automation

Expressive

Auto

mati

c

this work

FineAura

Fable

HiStar

Page 46: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

46

Page 47: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

47

Challenge for DIFC Programmers

• Semantic gap from policy to DIFC code

• Instrumenting legacy code

Page 48: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

48

Mandatory Access Control

P1

P2

OSPolicy

: P1 ! N P2 ! N

Network

Page 49: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

49

Instrument DIFC code that is1. Legal2. Secure3. Functional

Spawner

Worker

Lab{ a }

-{ }

Proxy

+{ a }

-{ a }

Lab{ }

Lab{ } Network

Requester

Key Challenge

Page 50: DIFC Programs by Automatic Instrumentation William Harris, Somesh Jha, and Thomas Reps 1.

50

Application Fully Automatic

Instr. Time (s)

Apache NO 2.302FlumeWiki YES 0.183ClamAV YES 1.374OpenVPN YES 7.912

Case Studies