38
Hybrid Monitoring of A/acker Knowledge Frédéric Besson, Nataliia Bielova , Thomas Jensen INRIA IEEE Computer Security Founda@ons 2016 June 29, 2016

Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Hybrid'Monitoring'of''

A/acker'Knowledge'Frédéric'Besson,'Nataliia'Bielova,'Thomas'Jensen'

INRIA''

IEEE'Computer'Security'Founda@ons'2016'June'29,'2016'

'

Page 2: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Informa@on'flow'control''

2'

Noninterference' A/acker’s'knowledge'Quan=ta=ve'

Informa=on'Flow'

Secret'input'does'not'flow'into'public'output'

What'informa@on'about'the'secret'is'flown'to'the'output'in'concrete'program'execu@on?'

How'much'informa@on'(in'bits)'about'secret'a'program'leaks'to'the'output?'

Page 3: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Informa@on'flow'control''

3'

Noninterference' A/acker’s'knowledge'Quan=ta=ve'

Informa=on'Flow'

Secret'input'does'not'flow'into'public'output'

What'informa@on'about'the'secret'is'flown'to'the'output'in'concrete'program'execu@on?'

How'much'informa@on'(in'bits)'about'secret'a'program'leaks'to'the'output?'

Page 4: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

A'program'which'is'not'secure'if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

1' 0' 1'

[l=1,'x=1]' [l=1,'x=0]'

set'of'secure'execu@ons''star@ng'with'l=1,'x=1''

set'of'insecure'execu@ons''star@ng'with'l=1,'x=0''

4'

h1=0�h2=0'

Page 5: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Security'Defini@on'

•  TINI:'Termina=onHInsensi=ve'Noninterference'

!  Program'P'is'TINI'if'for'all'lowZequivalence'classes:'

5'

1' �'

secure'execu@ons''

1'

[l'='0]'

secure'execu@ons''

[l'='1]'

Page 6: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

What'does'an'a^acker'learn?'

0' 1'

[l=1,'x=0]'

insecure'execu@ons'''

6'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

h1=0�h2=0'

Page 7: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

What'does'an'a^acker'learn?'

h1=0�h2=0'

a^acker'knows''values'of'both'secrets'

0' 1'

[l=1,'x=0]'

insecure'execu@ons'''

7'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

h1=0�h2=0'

Page 8: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

What'does'an'a^acker'learn?'

h1=0�h2=0' h1=1�h2=1

a^acker'knows''values'of'both'secrets'

a^acker'knows''some'informa=on'

about'secrets'

0' 1'

[l=1,'x=0]'

insecure'execu@ons'''

8'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

h1=0�h2=0'

Page 9: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

A'program'which'is'secure'

9'

l = 0;if h = 1 then skipelse

x = 5;while x > 0 do

x = x-1; l = x; output l

•  Does'any'dynamic/hybrid'monitor'accept'all'execu=ons'of'this'program?'

0'

[l'='0]'

h'='1'h=0'

secure'execu@ons''

Page 10: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

A'program'which'is'secure'

10'

l = 0;if h = 1 then skipelse

x = 5;while x > 0 do

x = x-1; l = x; output l

Dynamic'[h=0]' Hybrid'[h=1]'

branch'taken'block'execu@on'due'to'low'assignment'in'high'context'

…branch'taken'sta@c'analysis''…'block'execu@on'since'l'could'be'modified'in'elseZbranch'

•  Dynamic'monitors'block'too'early''!  [Zdancewic'’02,'Aus@n'and'Flanagan'’10]''

•  Hybrid'monitors'block'due'to'imprecision'of'sta=c'analysis'!  [Le'Guernic'‘07,'Russo'and'Sabelfeld'’10,'Besson'et'al'‘13]'

Page 11: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Challenges'

•  How'to'track'a/acker’s'knowledge?'

•  How'to'make'a'monitor'accept'more'secure'

execu=ons?'

11'

Answer:''Hybrid'monitoring'of'a/acker’s'knowledge'

Page 12: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Hybrid'monitor'

•  Dynamic'analysis'monitors'one'execu@on'•  Sta@c'analysis'is'called'onZtheZfly'for'nonZexecuted'branches'

•  Two'sets'of'rules:'one'for'dynamic'+'one'for'sta@c'

12'

Dynamic'+'Sta=c'analysis'

Page 13: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Hybrid'monitor'

•  !,#!’:#Env#∪#{·}# •  .,#.’#:#Var#→#K##labeling with knowledge •  Env##for dynamic analysis •  ·##for static analysis

13'

(P,#!,".)#⇓##(!’,".’)

Page 14: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

•  .(x)#splits'the'ini@al'environments'in'equivalence'classes'w.r.t.'the'possible'values'of'x

.(x)#:'

'

Expressive'knowledge'domain'

14'

1

⊤#(unknown value)

0 insecure'execu@ons'''

[l'='0]'

.:#Var#→#K

Page 15: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Expressive'knowledge'domain'

15'

K#≜#Env#→#Value#∪#{⊤,#⊥}

•  .(x)(!)#=#B## if the program terminates then x#has value B

•  .(x)(!)#=#⊤ no information (x#can have any value)

•  .(x)(!)#=#⊥# the program certainly does not terminate on !#'

.:#Var#→#K

Page 16: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

16'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

Page 17: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

17'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

Page 18: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

18'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

Page 19: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

19'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

sta=c'analysis'

The'result'of'sta=c'analysis''only'applies'to'environments'

where'h1=1'

Page 20: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

20'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

sta=c'analysis'

1

Page 21: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

21'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1

Page 22: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

22'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1

The'result'of'sta=c'analysis''only'applies'to'environments'

where'h2=0'

sta=c'analysis'

Page 23: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

23'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1

The'new'knowledge'in'these''environments'comes'from'the''

knowledge'of'x'

sta=c'analysis'

Page 24: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

24'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1

sta=c'analysis'

The'new'knowledge'in'these''environments'comes'from'the''

knowledge'of'x'

Page 25: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

25'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1

sta=c'analysis'

1

The'new'knowledge'in'these''environments'comes'from'the''

knowledge'of'x'

Page 26: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

26'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1

1

The'knowledge'in'current''execu=on'applies'to'environments''

where'h2=1'

Page 27: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

27'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1 1

The'knowledge'in'current''execu=on'applies'to'environments''

where'h2=1'

Page 28: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

28'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1 1

Page 29: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

29'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1 1

Page 30: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

30'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

0

.(x):#'

[h1'='0,'h2'='1]'

0' 1'

[l'='0,'x=0]'REAL'KNOWLEDGE'

0

.(l):#'

1

REAL'KNOWLEDGE'=''

APPROXIMATED'KNOWLEDGE''

1

Page 31: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Implementa@on'

•  Symbolic'representa@on'of'knowledge'

31'

K�#⊂#D(E×G)#×#E

•  (f,#e)#∈#E×G#returns'the'value'of'e#when#f#holds'in'!: !  if##⟦f⟧!#then#⟦e⟧!#else#⊤

•  ɸ#∈#E#specifies'when'the'knowledge'is'⊥ !  if##⟦ɸ⟧!#then#⊥#'

program'expressions'proposi=onal'formulas'

Page 32: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Result'1:'Correctness'guarantee'

•  Hybrid'monitor'overZapproximates'a^acker’s'knowledge'

32'

h1=1 � h2=1

0' 1'

[public'='0]'

insecure'execu@ons'''

h1= 1

REAL''

KNOWLEDGE'

APPROXIMATED''

KNOWLEDGE'

Page 33: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Result'2:'Precision'

33'

0' 1'

h1 = 1 �h2 = 1

REAL''

KNOWLEDGE'

h1 = 1 �h2 = 1

APPROXIMATED''

KNOWLEDGE'

insecure'execu@ons'''

[l='0,'x=0]'

if h1 = 1 then x = 1else skip;if h2 = 1 then l = 1 else l = x;output l

[h1=0,'h2=1,'l=0,'x=0]'

Page 34: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Result'3:'Enforcement'of'noninterference'

34'

1'

[x=1,'y=0]'

secure'execu@ons''

if h = 1 then l = x + y;else l = x - y; output l

[h=1,'x=1,'y=0]'

no knowledge

APPROXIMATED''

KNOWLEDGE'

ACCEPTED'

no knowledge

REAL''

KNOWLEDGE'

1

Page 35: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Result'4:'Provably'more''permissive'monitor'

35'

l = 0;if h = 1 then skipelse

x = 5;while x > 0 do

x = x-1; l = x; output l

Our'monitor'combined'with'inlined'dynamic'monitor'accepts'all'execu=ons'of'this'secure'program'

0'

[l'='0]'

h'='1'h'='0'

secure'execu@ons''

(More'details'in'the'paper)'

Page 36: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Conclusions'

36'

•  Hybrid'monitor'tracks'a/acker’s'knowledge''! more'precise'than'[Besson'et'al.'CSF’13]'! modeled'and'proved'correct'!  enforces'noninterference'(TINI)'!  has'running'prototype''

•  Combina=on'with'another'monitor'!  proved'sound'(TINI)''!  proved'more'permissive'than'previous'monitors'

Page 37: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Postdoc'posi@on'

•  Informa=on'flow'control'

•  Security'monitors'and'type'systems'

•  Soundness'and'permissiveness'

•  Star@ng'date:'flexible,'Nov'2016'–'Jun'2017'•  Dura@on:'1'year'•  Loca@on:'INRIA'Sophia'An@polis'(Nice,'France)'

37'

Page 38: Hybrid'Monitoring'of'' A/acker'Knowledge · 29-06-2016  · values'of'both'secrets' 0' 1' [l=1,'x=0]' insecure'execu@ons'' ' 7' if h1 = 1 then x = 1 else skip; if h2 = 1 then l =

Conclusions'

38'

•  Hybrid'monitor'tracks'a/acker’s'knowledge''! more'precise'than'[Besson'et'al.’13]'! modeled'and'proved'correct'!  enforces'noninterference'(TINI)'!  has'running'prototype''

•  Combina=on'with'another'monitor'!  proved'sound'(TINI)''!  proved'more'permissive'