sa sfiability modulo theories and
play

Sa#sfiability Modulo Theories and Network Verifica#on - PowerPoint PPT Presentation

Sa#sfiability Modulo Theories and Network Verifica#on Nikolaj Bjrner Microso1 Research Formal Methods and Networks Summer School Ithaca, June


  1. Sa#sfiability ¡Modulo ¡Theories ¡ and ¡ ¡ Network ¡Verifica#on ¡ Nikolaj ¡Bjørner ¡ ¡ Microso1 ¡Research ¡ Formal ¡Methods ¡and ¡Networks ¡Summer ¡School ¡ ¡ Ithaca, ¡June ¡10-­‑14 ¡2013 ¡

  2. Lectures Wednesday ¡2:00pm-­‑2:45pm: ¡ ¡ ¡ An ¡IntroducIon ¡to ¡SMT ¡with ¡Z3 ¡ ¡ Thursday ¡ 11:00am-­‑11:45am ¡ ¡Algorithmic ¡principles ¡of ¡SAT/SMT ¡ ¡ Friday ¡ 9:00am-­‑9:45am ¡ ¡ Theories, ¡Solvers ¡and ¡ Applica3ons ¡

  3. ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡source ¡is ¡(evil) ¡subver#ng ¡8/ ¡

  4. ¡ ¡ ¡ ¡is ¡open ¡shared ¡source ¡ ¡ ¡ ¡ ¡ ¡ h5p://z3.codeplex.com/ ¡ ¡

  5. Z3 ¡architecture ¡-­‑ ¡new ¡ Tac3cs ¡ SMT-­‑LIB ¡ SMT ¡(legacy ¡core) ¡ Bit-­‑Vectors ¡ Arrays ¡ Record ¡ Lin-­‑arithme3c ¡ Recursive ¡Datatypes ¡ & ¡replay ¡ Free ¡(uninterpreted) ¡func3ons ¡ OCaml ¡ Quan3fier ¡instan3a3on ¡ And-­‑then ¡ SAT ¡core ¡for ¡Bit-­‑vectors ¡ .NET ¡ Or-­‑else ¡ ∃ R: ¡Non-­‑linear ¡real ¡arithmeIc ¡ C ¡ Try-­‑for ¡ FloaIng ¡point ¡arithmeIc ¡ Java ¡ Par-­‑or ¡ Horn ¡clauses ¡ Python ¡ Par-­‑then ¡ SimplificaIon ¡

  6. Some ¡Microso1 ¡Tools ¡based ¡on ¡ ¡ TesIng ¡ Program ¡ ¡ Over-­‑ ¡ VerificaIon ¡ ApproximaIon ¡ ¡ ¡ ¡ ¡ ¡ ¡ HAVOC BEK ¡ Analysis ¡ ¡ ¡ ¡ AudiIng ¡ ¡ ¡ ¡ ¡ ¡ ¡ Under-­‑ ¡ ¡ ApproximaIon ¡ Synthesis ¡ Type ¡Safety ¡ SLAyer ¡ SAGE ¡

  7. Cool ¡tools ¡using ¡ ¡ Sledge ¡ Hammer ¡ ESBMC ¡ PUG ¡ Scala Z3 ¡ Me3Tarski ¡ KeYmaera ¡ Jeves ¡

  8. TesIng ¡

  9. HunIng ¡for ¡Security ¡Bugs ¡ • Two ¡main ¡techniques ¡used ¡by ¡“black ¡hats”: ¡ ¡ – Code ¡inspec+on ¡ (of ¡binaries) ¡and ¡ Blackbox ¡fuzz ¡tes+ng ¡ • Blackbox ¡fuzz ¡tesIng: ¡ Old introduction slide to SAGE & Pex – A ¡form ¡of ¡blackbox ¡random ¡tesIng ¡ – Randomly ¡fuzz ¡(=modify) ¡a ¡well-­‑formed ¡input ¡ State today: – Grammar-­‑based ¡fuzzing: ¡rules ¡that ¡encode ¡how ¡to ¡fuzz ¡ • Heavily ¡used ¡in ¡security ¡tesIng ¡ Pex is mature & Moles in VS2012 – At ¡MS: ¡various ¡internal ¡tools ¡ ¡ SAGE actively used internally at Microsoft – Conceptually ¡simple ¡yet ¡effecIve ¡in ¡pracIce… ¡ • Has ¡been ¡instrumental ¡in ¡weeding ¡out ¡1000’s ¡of ¡bugs ¡during ¡ development ¡and ¡test ¡

  10. Method: ¡Dynamic ¡Test ¡GeneraIon ¡ ¡ Run ¡ program ¡with ¡ random ¡ Input x, y inputs. ¡ Z := x + y ¡ Gather ¡constraints ¡ on ¡inputs. ¡ z == ¡ hash(x) ¡ Use ¡constraint ¡solver ¡ to ¡ Return z error(); generate ¡new ¡inputs. ¡ ¡ Can’t statically generate value for x that satisfy “z==hash(x)” Combina3on ¡with ¡ randomiza3on: ¡DART ¡ But we can solve for y in: Godefroid-­‑Klarlund-­‑Sen-­‑05,… ¡ x + y = hash(x)

  11. Fuzzing ¡and ¡Test ¡Case ¡GeneraIon ¡ SAGE Internal. For Security Fuzzing External. For Developers Runs on .NET code Runs on x86 instructions Try it on: http://pex4fun.com Finding security bugs before the hackers black hat

  12. Fuzzing ¡and ¡Test ¡Case ¡GeneraIon ¡ Dr. Strangelove? Bug: ***433 SAGE “2/29/2012 3:41 PM Edited by ***** SubStatus -> Local Fix I think the fuzzers are starting to become sentient. We must crush them before it is too late. Internal. For Security Fuzzing External. For Developers In this case, the fuzzer figured out that if [X was between A and B then Y would get Runs on .NET code Runs on x86 instructions set to Z triggering U and V to happen …… ] … .. Try it on: http://pex4fun.com And if this fuzzer asks for the nuclear launch codes, don’t tell it what they are … ” Finding security bugs before the hackers black hat

  13. SAGE ¡by ¡numbers ¡ 100s ¡CPU-­‑years ¡ -­‑ ¡largest ¡dedicated ¡fuzz ¡lab ¡in ¡the ¡world ¡ ¡ 100s ¡apps ¡-­‑ ¡ fuzzed ¡using ¡SAGE ¡ ¡ 100s ¡previously ¡unknown ¡bugs ¡found ¡ ¡ Billion+ ¡computers ¡updated ¡with ¡bug ¡fixes ¡ ¡ Millions ¡of ¡ $ ¡saved ¡for ¡Users ¡and ¡Microso1 ¡ ¡ 10s ¡of ¡related ¡tools ¡(incl. ¡Pex), ¡100s ¡DART ¡cita3ons ¡ ¡ 3+ ¡Billion ¡constraints ¡ ¡-­‑ ¡ largest ¡usage ¡for ¡any ¡SMT ¡solver ¡ Adapted from [Patrice Godefroid, ISSTA 2010]

  14. VerificaIon ¡ Program Verification It ¡is ¡cool ¡ HAVOC easy ¡ Auditing fun ¡ ajracIve ¡ Type Safety SLAyer

  15. Building ¡Verve ¡ 9 ¡person-­‑months ¡ Source ¡file ¡ Kernel.cs ¡ Verifica3on ¡tool ¡ Compila3on ¡tool ¡ C# ¡compiler ¡ Verified ¡ Nucleus.bpl ¡(x86) ¡ Kernel.obj ¡(x86) ¡ Boogie/Z3 ¡ TAL ¡checker ¡ Translator/ ¡ Linker/ISO ¡generator ¡ Assembler ¡ Verve.iso ¡ ¡ Safe ¡to ¡the ¡Last ¡InstrucIon ¡/ ¡Jean ¡Yang ¡& ¡Chris ¡ Hawbliztl ¡PLDI ¡2010 ¡

  16. ValidaIon ¡ SecGuru: ¡Automa3c ¡Valida3on ¡of ¡ Network ¡Connec3vity ¡Restric3ons ¡ ¡ ¡Karthick ¡Jayaraman, ¡Charlie ¡Kaufman, ¡ ¡ ¡and ¡Ramanathan ¡Venkatapathy ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Nikolaj ¡Bjørner ¡

  17. Network ¡Policies: ¡ ¡ Complexity, ¡Challenge ¡and ¡Opportunity ¡ Several ¡devices, ¡vendors, ¡formats ¡ Net ¡filters ¡ • Human ¡errors ¡> ¡4 ¡x ¡DOS ¡a5acks ¡ Firewalls ¡ • Routers ¡ • ¡ Challenge ¡in ¡the ¡field ¡ Human ¡Errors ¡by ¡Ac3vity ¡ Do ¡devices ¡enforce ¡policy? ¡ • Ripple ¡effect ¡of ¡policy ¡changes ¡ ¡ • 13% ¡ ¡ Config ¡Changes ¡ Arcane ¡ 13% ¡ Low-­‑level ¡configuraIon ¡files ¡ • Device ¡hw/sw ¡updates ¡ Mostly ¡manual ¡effort ¡ • Kept ¡working ¡by ¡ ¡ • WA ¡Cluster ¡Setup ¡ 74% ¡ ¡“Masters ¡of ¡Complexity” ¡

  18. A ¡Data-­‑center ¡Architecture ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡

  19. A ¡Data-­‑center ¡Architecture ¡ Defense ¡in ¡Depth ¡= ¡Crypto ¡+ ¡Policies ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-­‑ ¡outside ¡IP ¡can ¡be ¡spoofed ¡ ¡ Efficient ¡and ¡Flexible ¡Defense ¡by ¡Policy ¡only ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-­‑ ¡inside ¡IP ¡cannot ¡be ¡spoofed ¡ Policies ¡(Access ¡Control ¡Lists) ¡ma5er ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡

  20. Network ¡Policies ¡ What ¡they ¡look ¡like ¡in ¡routers ¡ ¡ Defense ¡in ¡Depth ¡= ¡Crypto ¡+ ¡Policies ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-­‑ ¡outside ¡IP ¡can ¡be ¡spoofed ¡ ¡ Efficient ¡and ¡Flexible ¡Defense ¡by ¡Policy ¡only ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-­‑ ¡inside ¡IP ¡cannot ¡be ¡spoofed ¡ Type ¡ Src ¡ Src ¡ Remote ¡ Remote ¡ Protocol ¡ Policy ¡ ¡ Policy ¡ ¡ Address ¡ Port ¡ Address ¡ Port ¡ Policy ¡ ¡ Allow ¡ 10.20.0.0/19 ¡ * ¡ 157.55.252.0/22 ¡ * ¡ 6 ¡ Allow ¡ 10.20.0.0/19 ¡ * ¡ 157.55.252.0/22 ¡ * ¡ 17 ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Policy ¡ ¡ Allow ¡ 10.20.0.0/19 ¡ * ¡ 157.55.252.0/22 ¡ * ¡ 4 ¡ Allow ¡ 10.20.0.0/19 ¡ * ¡ 157.55.252.0/22 ¡ * ¡ 1 ¡ Policy ¡ ¡ Deny ¡ ¡ * ¡ * ¡ 65.52.244.0/22 ¡ * ¡ 4 ¡

  21. A ¡Need ¡for ¡AutomaIng ¡Policy ¡ ConfiguraIon ¡ Constantly ¡growing ¡ ¡ ¡ New ¡clusters ¡– ¡“same” ¡ policy, ¡but ¡ ¡ ¡ ¡ ¡different ¡addresses ¡ ¡ Constantly ¡changing ¡ ¡ Hardware ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡– ¡ capacity, ¡semanIcs ¡ ¡ New ¡Services ¡ ¡– ¡ selecIvely ¡ exposed ¡ ¡ Patches ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ – ¡to ¡ live ¡site ¡incidents ¡ Bare ¡metal ¡ low-­‑level ¡format ¡of ¡routers ¡are ¡also ¡ used ¡for ¡policy ¡configuraIons ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend