expressing security constraints using capabilities
play

Expressing Security Constraints using capabilities Mark S. Miller - PowerPoint PPT Presentation

Expressing Security Constraints using capabilities Mark S. Miller and the Cajadores Overview This talk The What and Why of object-capabilities (ocaps) My Securing EcmaScript 5 talk tomorrow The How of doing ocaps in JavaScript Patterns


  1. Expressing Security Constraints using capabilities Mark S. Miller and the Cajadores

  2. Overview This talk The What and Why of object-capabilities (ocaps) My “Securing EcmaScript 5” talk tomorrow The How of doing ocaps in JavaScript Patterns of Safe Cooperation In Secure EcmaScript (SES) Distributed Cryptographic Capabilities In Distributed Resilient Secure EcmaScript (Dr. SES)

  3. Security as Extreme Modularity Modularity: Avoid needless dependencies Security: Avoid needless vulnerabilities Vulnerability is a form of dependency Mod: Principle of info hiding - need to know. Sec: Principle of least authority - need to do.

  4. The Mashup problem: Code as Media <html> <head> <title>Basic Mashup</title> <script> function animate ( id ) { var element = document.getElementById(id); var textNode = element.childNodes[0]; var text = textNode.data; var reverse = false; element.onclick = function() { reverse = !reverse; }; setInterval(function() { textNode.data = text = reverse ? text.substring(1) + text[0] : text[text.length-1] + text.substring(0, text.length-1); }, 100); } </script> </head> <body onload="animate('target')"> <pre id="target">Hello Programmable World! </pre> </body> </html>

  5. How do I designate thee? by Introduction ref to Carol ref to Bob decides to share by Parenthood by Endowment by Initial Conditions How might object Bob come to know of object Carol?

  6. How do I designate thee? Alice says : bob.foo(carol) by Introduction ref to Carol ref to Bob decides to share by Parenthood by Endowment by Initial Conditions

  7. How do I designate thee? Alice says : bob.foo(carol) by Introduction ref to Carol ref to Bob decides to share by Parenthood by Endowment by Initial Conditions

  8. How do I designate thee? Alice says : bob.foo(carol) by Introduction ref to Carol ref to Bob decides to share by Parenthood by Endowment by Initial Conditions

  9. How do I designate thee? Alice says : bob.foo(carol) by Introduction ref to Carol ref to Bob decides to share by Parenthood by Endowment by Initial Conditions

  10. How do I designate thee? Alice says : bob.foo(carol) by Introduction ref to Carol ref to Bob decides to share by Parenthood by Endowment by Initial Conditions

  11. How do I designate thee? Bob says : var carol = { ... }; by Introduction ref to Carol ref to Bob decides to share by Parenthood by Endowment by Initial Conditions

  12. How do I designate thee? Alice says : var bob = { ... carol ... }; by Introduction ref to Carol ref to Bob decides to share by Parenthood by Endowment by Initial Conditions

  13. How do I designate thee? At t 0 : by Introduction ref to Carol ref to Bob decides to share by Parenthood by Endowment by Initial Conditions

  14. OCaps: Small step from pure objects Memory safety and encapsulation + Effects only by using held references + No powerful references by default

  15. OCaps: Small step from pure objects Memory safety and encapsulation + Effects only by using held references + No powerful references by default Reference graph ≡ Access graph Only connectivity begets connectivity Natural Least Authority OO expressiveness for security patterns

  16. Objects as Closures function makeCounter () { makeCounter var count = 0; return def({ incr incr incr: function() { return ++count; }, incr incr incr incr decr: function() { return –count; } count }); count count } decr decr decr decr decr decr

  17. Objects as Closures function makeCounter () { makeCounter var count = 0; return def({ incr incr incr: function() { return ++count; }, incr incr incr incr decr: function() { return –count; } count }); count count } decr decr decr decr decr decr A record of closures hiding state is a fine representation of an object of methods hiding instance vars

  18. Revocable Function Forwarder function makeFnCaretaker ( target ) { makeCaretaker return def({ wrapper: function(…args) { revoke revoke revoke revoke wrapper wrapper wrapper wrapper revoke revoke revoke revoke wrapper wrapper wrapper wrapper revoke revoke revoke revoke wrapper wrapper wrapper wrapper return target(…args); }, target target target target target target revoke: function() { target = null; } }); }

  19. Unconditional Access Alice says: Alice Bob foo bob.foo(carol); Grants Bob full access to Carol forever Carol

  20. Revocability ≡ Temporal attenuation Alice says: Alice Bob foo var ct = makeCaretaker(carol); bob.foo(ct.wrapper); revoke revoke wrapper wrapper target Carol

  21. Revocability ≡ Temporal attenuation Alice says: Alice Bob var ct = makeCaretaker(carol); bob.foo(ct.wrapper); //… revoke revoke wrapper wrapper target Carol

  22. Revocability ≡ Temporal attenuation Alice says: Alice Bob var ct = makeCaretaker(carol); bob.foo(ct.wrapper); //… revoke revoke wrapper wrapper ct.revoke(); target Carol

  23. Revocability ≡ Temporal attenuation Alice says: Alice Bob var ct = makeCaretaker(carol); bob.foo(ct.wrapper); //… revoke revoke wrapper wrapper ct.revoke(); target Carol

  24. Attenuators ≡ Access Abstractions Alice says: Alice Bob foo var ct = makeCaretaker(carol); bob.foo(ct.wrapper); Express security policy by the behavior of the objects you provide Carol

  25. Membranes: Transitive Interposition Alice Bob function makeFnMembrane ( target ) { var enabled = true; function wrap ( wrapped ) { if (wrapped !== Object(wrapped)) { return wrapped; Dave } return function(… args ) { if (!enabled) { throw new Error(“revoked”); } return wrap(wrapped(…args.map(wrap)); } } return def({ wrapper: wrap(target), Carol revoke: function() { target = null; } }); }

  26. Attenuators Compose function makeROFile ( file ) { return def({ read: file.read, getLength: file.getLength }); } var rorFile = makeROFile(revocableFile);

  27. No powerful references by default Alice says: Alice Bob var bobSrc = //site B bob var carolSrc = //site C var bob = safeEval(bobSrc); Carol var carol = safeEval(carolSrc); carol

  28. No powerful references by default Alice says: Alice Bob var bobSrc = //site B bob var carolSrc = //site C var bob = safeEval(bobSrc); Carol var carol = safeEval(carolSrc); carol Bob and Carol are confined . Only Alice controls how they can interact or get more connected.

  29. No powerful references by default Alice says: Alice bob Bob carol Carol

  30. Only connectivity begets connectivity Alice says: bob Bob var counter = makeCounter(); counter incr incr bob(counter.incr); carol(counter.decr); carol count count Carol count bob = carol = null; decr decr

  31. Only connectivity begets connectivity Alice says: bob Bob var counter = makeCounter(); counter incr incr bob(counter.incr); carol(counter.decr); carol count count Carol count bob = carol = null; decr decr Bob can only count up and see result. Carol only down. Alice can do both.

  32. Membrane safeEval → compartment var compartment = makeMembrane(safeEval); var vbob = compartment.wrapper(bobSrc); Bob Alice

  33. Membrane safeEval → compartment var compartment = makeMembrane(safeEval); var vbob = compartment.wrapper(bobSrc); //… Bob Alice

  34. Membrane safeEval → compartment var compartment = makeMembrane(safeEval); var vbob = compartment.wrapper(bobSrc); //… compartment.revoke(); Bob Alice GC

  35. Composing Authority +? Usually intersection

  36. Rights Amplification ≥ + +

  37. Rights Amplification function makeBrand () { Alice Bob foo var amp = WeakMap(); function seal ( payload ) { var box = def({}); amp.set(box, payload); return box; makeBrand } function unseal ( box ) { seal unseal seal unseal return amp.get(box); amp amp box } box box return def({seal: seal, unseal: unseal}); payload payload payload }

  38. Dr. SES Distributed Resilient Secure EcmaScript Most suspicion is not within an address space Stretch reference graph between machines Preserve distributed “memory safety”

  39. Dr. SES Distributed Resilient Secure EcmaScript Shared State Message Passing Blocking C++/pthreads Blocking receive Java, C#, Mozart/Oz CSP, Occam, CCS JoCAML, Polyphonic C# Erlang, Scala, Go Non-blocking Soft Transactional Mem Comm Event Loops Argus, Fortress, X10 Actors, AmbientTalk E, Waterken Ajax

  40. Dr. SES Distributed Resilient Secure EcmaScript Shared State Message Passing Blocking C++/pthreads Blocking receive Java, C#, Mozart/Oz CSP, Occam, CCS JoCAML, Polyphonic C# Erlang, Scala, Go Non-blocking Soft Transactional Mem Comm Event Loops Argus, Fortress, X10 Actors, AmbientTalk E, Waterken Ajax No conventional deadlocks or memory races

  41. Dr. SES Distributed Resilient Secure EcmaScript Shared State Message Passing Blocking C++/pthreads Blocking receive Java, C#, Mozart/Oz CSP, Occam, CCS JoCAML, Polyphonic C# Erlang, Scala, Go Non-blocking Soft Transactional Mem Comm Event Loops Argus, Fortress, X10 Actors, AmbientTalk E, Waterken Ajax, Dr. SES No conventional deadlocks or memory races var result = bob.foo(carol); // do it immediately var resultP = bobP ! foo(carol); // do it eventually

Recommend


More recommend