Secure Programs via Game-based Synthesis
Somesh Jha, Tom Reps, and Bill Harris
1 Tuesday, October 22, 13
Secure Programs via Game-based Synthesis Somesh Jha, Tom Reps, and - - PowerPoint PPT Presentation
Secure Programs via Game-based Synthesis Somesh Jha, Tom Reps, and Bill Harris 1 Tuesday, October 22, 13 One-slide summary Secure programming on a conventional OS is intractable Privilege-aware OSs take secure programming from
Secure Programs via Game-based Synthesis
Somesh Jha, Tom Reps, and Bill Harris
1 Tuesday, October 22, 13One-slide summary
intractable
from intractable to challenging
from challenging to simple
2 Tuesday, October 22, 13Outline
Outline
3 Tuesday, October 22, 13Secure Programming is Intractable
to carry out undesirable system operations
to traverse a directory
Xibo to read arbitrary files
to overwrite files
4 Tuesday, October 22, 13How to Carry Out an Exploit
software vulnerability + OS privilege = security exploit
5 Tuesday, October 22, 13software vulnerability + OS privilege = security exploit
6The Conventional-OS Solution
Tuesday, October 22, 13software vulnerability + OS privilege = security exploit
6The Conventional-OS Solution
Tuesday, October 22, 13software vulnerability + OS privilege = security exploit
6The Conventional-OS Solution
Tuesday, October 22, 13Solution
software vulnerability + OS privilege = security exploit
7The Program-Verification
Tuesday, October 22, 13Solution
software vulnerability + OS privilege = security exploit
7The Program-Verification
Tuesday, October 22, 13Solution
software vulnerability + OS privilege = security exploit
7The Program-Verification
Tuesday, October 22, 13Priv.-aware OS
primitives that update privileges
Solution
+ OS privilege = security exploit
9Priv.-aware OS The
software vulnerability
Tuesday, October 22, 13Solution
+ OS privilege = security exploit
Priv.-aware OS The
+ primitives software vulnerability monitor
Tuesday, October 22, 13Solution
+ OS privilege = security exploit
Priv.-aware OS The
+ primitives software vulnerability monitor
Tuesday, October 22, 13[Watson ’10]
to open descriptors to system objects
to manage Amb
10The Capsicum Priv.-aware OS
Tuesday, October 22, 13’s Amb Rules of Capsicum
Tuesday, October 22, 13it has the Amb value of its parent
11’s Amb Rules of Capsicum
Tuesday, October 22, 13it has the Amb value of its parent
it does not have Amb
11’s Amb Rules of Capsicum
Tuesday, October 22, 13it has the Amb value of its parent
it does not have Amb
then it can never obtain Amb
11’s Amb Rules of Capsicum
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); }
12gzip
L1: compress(in, out);
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); }
12gzip
L1: compress(in, out);
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); }
12gzip
http://evil.com L1: compress(in, out);
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); }
12gzip
http://evil.com L1: compress(in, out); /usr/local
Tuesday, October 22, 13A simple policy
13it should
it should not
gzip
able to open descriptors be able to open descriptors
Tuesday, October 22, 13A simple policy
13with AMB
it should
it should not
gzip
have AMB have AMB
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
14gzip with AMB
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
14gzip with AMB
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
14gzip
L0: AMB L1: no AMB
with AMB
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
14gzip
L0: AMB L1: no AMB cap_enter()
with AMB
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
14gzip
L0: AMB L1: no AMB cap_enter()
? ?
with AMB
Tuesday, October 22, 13Programming Challenges
Capsicum
Tuesday, October 22, 13Programming Challenges
16gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
L0: AMB L1: no AMB
Tuesday, October 22, 13Programming Challenges
16gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
L0: AMB L1: no AMB
cap_enter();
Tuesday, October 22, 13Programming Challenges
16gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); } AMB
L0: AMB L1: no AMB
cap_enter();
Tuesday, October 22, 13Programming Challenges
16gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); } AMB
L0: AMB L1: no AMB
cap_enter();
Tuesday, October 22, 13Programming Challenges
16gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); } AMB
L0: AMB L1: no AMB
cap_enter();
Tuesday, October 22, 13Programming Challenges
16gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); } no AMB
L0: AMB L1: no AMB
cap_enter();
Tuesday, October 22, 13Programming Challenges
16gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); } no AMB
L0: AMB L1: no AMB
cap_enter();
Tuesday, October 22, 13Programming Challenges
16gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); } no AMB
L0: AMB L1: no AMB
cap_enter();
Tuesday, October 22, 13it has the AMB value of its parent
Rules of Capsicum’s Amb
it never has AMB
then it can never obtain Amb
17 Tuesday, October 22, 13it has the AMB value of its parent
Rules of Capsicum’s Amb
17 Tuesday, October 22, 13Instrumenting gzip
18main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
L0: AMB L1: no AMB cap_enter();
Tuesday, October 22, 13Instrumenting gzip
18main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
L0: AMB L1: no AMB cap_enter(); sync_fork(); sync_join();
Tuesday, October 22, 13Instrumenting gzip
18main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
AMB
L0: AMB L1: no AMB cap_enter(); sync_fork(); sync_join();
Tuesday, October 22, 13Instrumenting gzip
18main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
AMB
L0: AMB L1: no AMB cap_enter(); sync_fork(); sync_join();
Tuesday, October 22, 13Instrumenting gzip
18main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
AMB
L0: AMB L1: no AMB cap_enter(); sync_fork(); sync_join();
Tuesday, October 22, 13Instrumenting gzip
18main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
no AMB
L0: AMB L1: no AMB cap_enter(); sync_fork(); sync_join();
Tuesday, October 22, 13Instrumenting gzip
18main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
AMB
L0: AMB L1: no AMB cap_enter(); sync_fork(); sync_join();
Tuesday, October 22, 13Instrumenting gzip
18main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
AMB
L0: AMB L1: no AMB cap_enter(); sync_fork(); sync_join();
Tuesday, October 22, 13Capsicum Challenges Not Appearing in This Talk
each UNIX descriptor
(~1 for every system call on a descriptor)
Remote Procedure Call (RPC)
19 Tuesday, October 22, 13Instrumenting Programs
primitives so that it satisfies the policy
20with CapWeave
Tuesday, October 22, 13with CapWeave gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
L0: AMB L1: no AMB
Tuesday, October 22, 13with CapWeave gzip
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
Policy
Cur(p) => (pc[L0](p) => AMB(p) & (pc[L1](p) => !AMB(p))
Tuesday, October 22, 13main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }
22Policy
Cur(p) => (pc[L0](p) => AMB(p) & (pc[L1](p) => !AMB(p))
Tuesday, October 22, 13CapWeave
Policy Cur(p) => (pc[L0](p) => AMB(p) & (pc[L1](p) => !AMB(p)) Tuesday, October 22, 13CapWeave
Instrumented Program
void main() { L0: open2(...); sync_fork(); cap_enter(); L1: compress(); sync_join(); } Policy Cur(p) => (pc[L0](p) => AMB(p) & (pc[L1](p) => !AMB(p)) Tuesday, October 22, 13The Next 700 Policy Weavers
Analogous challenges with Decentralized Information Flow Control (DIFC)
CapWeave
gzip() { file_nms = parse_cl(); sync_fork(); cap_enter(); ... } Policy Cur(p) => (pc[L0](p) => AMB(p)) & (pc[L1](p) => !AMB(p)) 24 Tuesday, October 22, 13CapWeave
gzip() { file_nms = parse_cl(); sync_fork(); cap_enter(); ... } Policy Cur(p) => (pc[L0](p) => AMB(p)) & (pc[L1](p) => !AMB(p))Programmer
Weaver Generator
24 Tuesday, October 22, 13CapWeave
gzip() { file_nms = parse_cl(); sync_fork(); cap_enter(); ... } Policy Cur(p) => (pc[L0](p) => AMB(p)) & (pc[L1](p) => !AMB(p))Programmer
cap_enter: Amb’(p) := Amb(p) & ...Weaver Generator
Capsicum Designer
24 Tuesday, October 22, 13Weaver Generator
25 Tuesday, October 22, 13Weaver Generator
HiStar Designer
25 Tuesday, October 22, 13HiWeave
create_cat(&c): Flows’(p, q) := Flows(p, q) || ...Weaver Generator
HiStar Designer
25 Tuesday, October 22, 13HiWeave
Policy forall w, s. Flows(w, s) => ...Programmer
create_cat(&c): Flows’(p, q) := Flows(p, q) || ...Weaver Generator
HiStar Designer
25 Tuesday, October 22, 13HiWeave
scanner() { create_cat(&c); exec(...); ... } Policy forall w, s. Flows(w, s) => ...Programmer
create_cat(&c): Flows’(p, q) := Flows(p, q) || ...Weaver Generator
HiStar Designer
25 Tuesday, October 22, 13Outline
Outline
26 Tuesday, October 22, 13CapWeave Algorithm
27 Tuesday, October 22, 13CapWeave Algorithm
Inputs: Program P , Amb Policy Q
27 Tuesday, October 22, 13CapWeave Algorithm
Inputs: Program P , Amb Policy Q Output: Instrumentation of P that always satisfies Q
27 Tuesday, October 22, 13CapWeave Algorithm
Inputs: Program P , Amb Policy Q Output: Instrumentation of P that always satisfies Q
Program Amb Policy
main() { file_nms = parse_cl(); for (f in file_nms): L0: (in, out) = open2(f); L1: compress(in, out); }L0: Amb L1: no Amb
Tuesday, October 22, 13L1: no Amb
Tuesday, October 22, 13L0: Amb
noop Tuesday, October 22, 13Building IP#
Basic idea: construct IP# as a forward exploration
1(a). IP#: Define Abstract State-space
Q
32 Tuesday, October 22, 131(a). IP#: Define Abstract State-space
Q Q#
32 Tuesday, October 22, 131(a). IP#: Define Abstract State-space
Q Q#
1(a). IP#: Define Abstract State-space
Q Q#
Q Q#
1(b). IP#: Define Abstract Transformers
Tuesday, October 22, 13Q Q#
1(b). IP#: Define Abstract Transformers
𝜐[cap_enter]
Tuesday, October 22, 13Q Q#
1(b). IP#: Define Abstract Transformers
𝜐[cap_enter]# 𝜐[cap_enter]
Tuesday, October 22, 131(c). Explore Abstract State Space
34Q Q#
Tuesday, October 22, 131(c). Explore Abstract State Space
init L0
34Q Q#
Tuesday, October 22, 131(c). Explore Abstract State Space
init parse_cl ... cap_enter ... noop 𝜐[parse_cl]# L0 L0’ .. 𝜐[noop]# ... 𝜐[cap_enter]#
34Q Q#
Tuesday, October 22, 13𝜐[parse_cl]#
Tuesday, October 22, 13State-Structure Exploration
If a concrete state is a logical structure, ...
State-Structure Exploration
If a concrete state is a logical structure, ...
D A A C B B
State-Structure Exploration
37properties are FOL formulas, ...
∀p. A(p) ⇒ ((B(p) ⇒ C(p)) ⋀ (D(p) ⇒ ¬C(p)))
Tuesday, October 22, 13State-Structure Exploration
...and semantics is given as predicate updates, ... 𝜐[action] ≡ A’(x) = A(x) ⋁ ∃ y. C(y) ⋀ B(q, p) B’(x, y) = B(x, y) ⋁ (C(x) ⋀ D(y)) C’(x) = ... D’(x) = ...
38 Tuesday, October 22, 13State-Structure Exploration
Q
...then abstract space and transformers can be generated automatically [Sagiv ’99]
39 Tuesday, October 22, 13State-Structure Exploration
𝛽
𝜐[action]
𝛽
𝜐[action]#
Q Q#
...then abstract space and transformers can be generated automatically [Sagiv ’99]
39 Tuesday, October 22, 13Capsicum Semantics
D A A C B B
𝜐[action] ≡ 1. 2. Q ≡
40A’(x) = A(x) ⋁ ∃ y. C(y) ⋀ B(q, p) B’(x, y) = B(x, y) ⋁ (C(x) ⋀ D(y)) C’(x) = ... D’(x) = ...
Tuesday, October 22, 13Capsicum State as Structure
41 Tuesday, October 22, 13Capsicum State as Structure
41 Tuesday, October 22, 13Capsicum State as Structure
Cur
41 Tuesday, October 22, 13Capsicum State as Structure
Cur L1
41 Tuesday, October 22, 13Capsicum State as Structure
Cur Amb Amb L1
41 Tuesday, October 22, 13Capsicum State as Structure
Cur Parent Amb Amb L1
41 Tuesday, October 22, 13Capsicum State as Structure
Cur Parent Amb Amb L1
41∀ p. Cur(p) ⋀ L1(p) ⇒ ¬ Amb(p)
Tuesday, October 22, 13Capsicum State as Structure
Cur Parent Amb Amb L1
41∀ p. Cur(p) ⋀ L1(p) ⇒ ¬ Amb(p)
⊭
Tuesday, October 22, 13Capsicum State as Structure
Cur Parent Amb Amb L1
42∀ p. Cur(p) ⋀ L1(p) ⇒ ¬ Amb(p)
Tuesday, October 22, 13Capsicum State as Structure
Cur Parent Amb L1
42∀ p. Cur(p) ⋀ L1(p) ⇒ ¬ Amb(p)
Tuesday, October 22, 13Capsicum State as Structure
Cur Parent Amb L1
42∀ p. Cur(p) ⋀ L1(p) ⇒ ¬ Amb(p)
⊨
Tuesday, October 22, 13Capsicum Structure Transformers
Action sync_fork()
Tuesday, October 22, 13Capsicum Structure Transformers
Amb Cur Action sync_fork()
Tuesday, October 22, 13Fresh
Capsicum Structure Transformers
Amb Cur Action sync_fork()
Tuesday, October 22, 13Amb Fresh
Capsicum Structure Transformers
Amb Cur Action sync_fork()
Tuesday, October 22, 13Cur Parent Amb Fresh
Capsicum Structure Transformers
Amb Action sync_fork()
Tuesday, October 22, 13Cur Parent Amb Fresh
Capsicum Structure Transformers
Amb Action Structure Transformer sync_fork()
Tuesday, October 22, 13Intro Fresh Amb’(p) := Amb(p) ⋁ ( Fresh(p) ⋀ ∃ q. Cur(q) ⋀ Amb(q))
43Cur Parent Amb Fresh
Capsicum Structure Transformers
Amb Action Structure Transformer sync_fork()
Tuesday, October 22, 13Action Structure Transformer Cur Parent Amb Fresh
Capsicum Structure Transformers
Amb
Tuesday, October 22, 13cap_enter() Action Structure Transformer Cur Parent Amb Fresh
Capsicum Structure Transformers
Amb
Tuesday, October 22, 13cap_enter() Action Structure Transformer Cur Parent Fresh
Capsicum Structure Transformers
Amb
Tuesday, October 22, 13cap_enter() Amb’(p) := Amb(p) ⋀ ¬Cur(p) Action Structure Transformer Cur Parent Fresh
Capsicum Structure Transformers
Amb
Tuesday, October 22, 13Building IP#: Summary
transforms of logical structures, we can generate an approximation of runs that cause a violation
structure transforms
45 Tuesday, October 22, 13CapWeave Algorithm
Inputs: Program P , Amb Policy Q Output: Instrumentation of P that always satisfies Q
won by violations of Q
CapWeave Algorithm
Inputs: Program P , Amb Policy Q Output: Instrumentation of P that always satisfies Q
Two-Player Safety Games
the Attacker chooses the next input
the Defender chooses the next input
Instrumentation as a Game
49Capsicum Instrumentation Two-player Games Program instructions Attacker actions Capsicum primitives Defender actions Policy violations Attacker wins Satisfying instrumentation Winning Defender strategy
Tuesday, October 22, 13gzip IP#
Tuesday, October 22, 13gzip Safety Game
Tuesday, October 22, 13gzip Safety Game
Tuesday, October 22, 13CapWeave Algorithm
Inputs: Program P , Amb Policy Q Output: Instrumentation of P that always satisfies Q
won by violations of Q
52 Tuesday, October 22, 13CapWeave Algorithm
Inputs: Program P , Amb Policy Q Output: Instrumentation of P that always satisfies Q
won by violations of Q
generate primitive controller for P
52 Tuesday, October 22, 13CapWeave Performance
53Name Program kLoC Policy LoC Weaving Time
bzip2-1.0.6 8 70 4m57s gzip-1.2.4 9 68 3m26s php-cgi-5.3.2 852 114 46m36s tar-1.25 108 49 0m08s tcpdump-4.1.1 87 52 0m09s wget-1.12 64 35 0m10s
Tuesday, October 22, 13Performance on Included Tests
54Name Base Time Hand Overhd capweave Overhd Diff. Overhd (%)
bzip2-1.0.6 0.593s 0.909 1.099 20.90 gzip-1.2.4 0.036s 1.111 1.278 15.03 php-cgi-5.3.2 0.289s 1.170 1.938 65.64 tar-1.25 0.156s 13.301 21.917 64.78 tcpdump-4.1.1 1.328s 0.981 1.224 24.77 wget-1.12 4.539s 1.906 1.106 0.91
Tuesday, October 22, 13Outline
Outline
55The HiStar Priv-aware OS [Zeldovich ’06]
which define allowed flows
Sandboxing a Virus Scanner
launcher() { exec(“/bin/scanner”); } wrapper() { child = sync_fork(&launcher); while (true) { read(child, buf); sanitize(buf); write(netd, buf); } }
57 Tuesday, October 22, 13A Flow Policy for a Virus Scanner
from the scanner to the network, unless it goes through the wrapper
scanner to the wrapper
wrapper to the network
58 Tuesday, October 22, 13Rules for HiStar’s Flow
to low or high
process is low in c, and p can declassify c
category
Rules for HiStar’s Flow
Information can flow from p to q if for each category:
Sandboxing a Virus Scanner
61launcher() { exec(“/bin/scanner”); } wrapper() { child = sync_fork(&launcher); while (true) { read(child, buf); sanitize(buf); write(netd, buf); } }
Tuesday, October 22, 13Sandboxing a Virus Scanner
61launcher() { exec(“/bin/scanner”); } wrapper() { child = sync_fork(&launcher); while (true) { read(child, buf); sanitize(buf); write(netd, buf); } } create_cat(&x); raise(x);
Tuesday, October 22, 13Sandboxing a Virus Scanner
61launcher() { exec(“/bin/scanner”); } wrapper() { child = sync_fork(&launcher); while (true) { read(child, buf); sanitize(buf); write(netd, buf); } } drop_declass(x); create_cat(&x); raise(x);
Tuesday, October 22, 13HiStar Challenges Not Appearing in This Talk
(calling a closure implicitly performs two label operations and three ordering checks)
62 Tuesday, October 22, 13Weave Algorithm
Inputs: Program P , Policy Q Output: Instrumentation of P that satisfies Q
(using semantics)
won by violations of Q
generate primitive controller for P
63Amb Capsicum
Cap
Tuesday, October 22, 13Weave Algorithm
Inputs: Program P , Policy Q Output: Instrumentation of P that satisfies Q
(using semantics)
won by violations of Q
generate primitive controller for P
63Amb Capsicum
Cap
Tuesday, October 22, 13Weave Algorithm
Inputs: Program P , Policy Q Output: Instrumentation of P that satisfies Q
(using semantics)
won by violations of Q
generate primitive controller for P
63HiStar Flow
Hi
Tuesday, October 22, 13Semantics
D A A C B B
𝜐[action] ≡ 1. 2. Q ≡
64A’(x) = A(x) ⋁ ∃ y. C(y) ⋀ B(q, p) B’(x, y) = B(x, y) ⋁ (C(x) ⋀ D(y)) C’(x) = ... D’(x) = ...
Capsicum
Tuesday, October 22, 13Semantics
D A A C B B
𝜐[action] ≡ 1. 2. Q ≡
64A’(x) = A(x) ⋁ ∃ y. C(y) ⋀ B(q, p) B’(x, y) = B(x, y) ⋁ (C(x) ⋀ D(y)) C’(x) = ... D’(x) = ...
HiStar
Tuesday, October 22, 13HiStar State as Structure
65 Tuesday, October 22, 13HiStar State as Structure
65Cur
Tuesday, October 22, 13HiStar State as Structure
Label Label Label
65Cur
Tuesday, October 22, 13HiStar State as Structure
Label Label Label
65x Cur
Tuesday, October 22, 13HiStar State as Structure
Label Label Label High Low Low
65x Cur
Tuesday, October 22, 13HiStar State as Structure
Label Label Label High Low Low Flows Flows Flows
65x Cur
Tuesday, October 22, 13HiStar State as Structure
Label Label Label High Low Low Flows Flows Flows
65Scan Wrap Netd x Cur
Tuesday, October 22, 13HiStar State as Structure
Label Label Label ∀ w, s, n. Wrap(w) ⋀ Scan(s) ⋀ Netd(n) ⇒ Flows(s, w) ⋀ Flows(w, n) High Low Low Flows Flows Flows
65Scan Wrap Netd x Cur
Tuesday, October 22, 13HiStar State as Structure
Label Label Label ∀ w, s, n. Wrap(w) ⋀ Scan(s) ⋀ Netd(n) ⇒ Flows(s, w) ⋀ Flows(w, n) High Low Low Flows Flows Flows
65Scan Wrap Netd
⊭
x Cur
Tuesday, October 22, 13HiStar State as Structure
66Label Label Label High Low Low Flows Flows Flows Scan Wrap Netd Decl ∀ w, s, n. Wrap(w) ⋀ Scan(s) ⋀ Netd(n) ⇒ Flows(s, w) ⋀ Flows(w, n) x Cur
Tuesday, October 22, 13HiStar State as Structure
66Label Label Label High Low Low Flows Flows Flows Scan Wrap Netd Decl ∀ w, s, n. Wrap(w) ⋀ Scan(s) ⋀ Netd(n) ⇒ Flows(s, w) ⋀ Flows(w, n) x Cur
Tuesday, October 22, 13HiStar State as Structure
66Label Label Label High Low Low Flows Flows Flows Scan Wrap Netd Decl
⊨
∀ w, s, n. Wrap(w) ⋀ Scan(s) ⋀ Netd(n) ⇒ Flows(s, w) ⋀ Flows(w, n) x Cur
Tuesday, October 22, 13HiStar State Transformers
create_cat(&x) Action
67 Tuesday, October 22, 13Label Cur
HiStar State Transformers
create_cat(&x) Action
67Flows
Tuesday, October 22, 13Label Cur
HiStar State Transformers
create_cat(&x) Action
67Fresh Flows
Tuesday, October 22, 13Label Cur
HiStar State Transformers
create_cat(&x) Action Decl
67Fresh Low x Flows
Tuesday, October 22, 13Label Cur
HiStar State Transformers
Intro Fresh Decl’(p, c) := Decl(p, c) ⋁ (Cur(p) ⋀ Fresh(c)) Structure Transform create_cat(&x) Action Decl
67Fresh Low x Flows
Tuesday, October 22, 13HiStar State Transformers
raise(&x) Action
68Label Cur Decl Fresh Low x Flows
Tuesday, October 22, 13HiStar State Transformers
raise(&x) Action
68High Label Cur Decl Fresh x Flows
Tuesday, October 22, 13HiStar State Transformers
Intro Fresh High’(l, c) := High(l, c) ⋁ ∃ p. Cur(p) & Label(p, l) & x(c) Structure Transform raise(&x) Action
68High Label Cur Decl Fresh x Flows
Tuesday, October 22, 13Summary: HiStar Semantics
predicate transforms and automatically generate a weaver for HiStar
capability and DIFC semantics
69 Tuesday, October 22, 13Scanner Game
noop sync_fork noop create_cat(&c)
70exec noop drop_decl(c) raise(c) exec ... noop sync_fork sync_fork
Tuesday, October 22, 13Scanner Game
create_cat(&c)
70drop_decl(c) raise(c) exec ... sync_fork
Tuesday, October 22, 13HiWeave 𝛽 Performance
Generates code for clamwrap in < 3 mins
71 Tuesday, October 22, 13HiWeave
scanner() { create_cat(&c); sync_fork(); ... } Policy forall w, s, n. Wrap(w) && ...Programmer
create_cat(&c): Decl’(p, c) := Decl(p, c) || ...Weaver Generator
HiStar Designer
72 Tuesday, October 22, 13Outline
Open Challenges
Automating Abstraction Refinement
requires a lot of design effort
via counter-strategies?
75 Tuesday, October 22, 13Automating Error Diagnosis
presenting them to the user?
76 Tuesday, October 22, 13Compositional Synthesis
as a composition of processes
conjunction of local, global policies
[Long, ’89]
77 Tuesday, October 22, 13HiStar Logger
Logger Local (security) policy: only Logger should be able to modify log log.txt
78 Tuesday, October 22, 13HiStar Logger
Logger Global (functionality) policy: under certain conditions, Logger will append log on behalf of Environment Environment log.txt
79 Tuesday, October 22, 13Optimizing Generated Code
cost model, but have high complexity in general
Designing a Policy Logic
to declare policies purely over privileges
policy writer to understand?
TVLA
Our Collaborators
82Capsicum-dev MIT
HiStar
Nickolai Zeldovich Mooly Sagiv Tuesday, October 22, 13HiWeave
scanner() { create_cat(&c); sync_fork(); ... } Policy forall w, s, n. Wrap(w) && ... create_cat(&c): Decl’(p, c) := Decl(p, c) || ...Weaver Generator
83Questions?
Tuesday, October 22, 13Extra Slides
84 Tuesday, October 22, 13Three-valued logic
Three-valued Structures
Cur Parent Parent Cur Amb Cur Parent Amb Amb Cur Parent Parent Amb Amb ...
86 Tuesday, October 22, 13Abstraction Function
Cur Parent Parent Amb Amb alpha_{Cur} Cur Parent Amb
87 Tuesday, October 22, 13Abstraction Function
Cur Parent Parent Amb alpha_{Cur} Cur Parent Amb?
88 Tuesday, October 22, 13Abstract Fork (def)
Action Semantics fork() Intro Fresh Amb(p) := Amb(p) || (Fresh(p) & E q. Cur(q) & Amb(q)) Cur Parent Amb Parent Amb Cur Fresh Amb Amb
89 Tuesday, October 22, 13Abstract Fork (definite)
Action Semantics fork() Intro Fresh Amb(p) := Amb(p) || (Fresh(p) & E q. Cur(q) & Amb(q)) Parent Amb Cur Fresh Parent Amb Cur Parent Fresh Amb Amb
90 Tuesday, October 22, 13