self defending software g automatically patching errors
play

Self-defending software: g Automatically patching errors in - PowerPoint PPT Presentation

Self-defending software: g Automatically patching errors in deployed software Michael Ernst Michael Ernst University of Washington Joint work with: Joint work with: Saman Amarasinghe, Jonathan Bachrach, Michael Carbin, Sung Kim, Samuel


  1. Self-defending software: g Automatically patching errors in deployed software Michael Ernst Michael Ernst University of Washington Joint work with: Joint work with: Saman Amarasinghe, Jonathan Bachrach, Michael Carbin, Sung Kim, Samuel Larsen, Mi h l C bi S Ki S l L Carlos Pacheco, Jeff Perkins, Martin Rinard, F Frank Sherwood, Stelios Sidiroglou, Greg k Sh d St li Sidi l G Sullivan, Weng-Fai Wong, Yoav Zibin

  2. Problem: Your code has bugs and vulnerabilities d l bili i • Attack detectors exist Attack detectors exist – Code injection, memory errors (buffer overrun) • Reaction: Reaction: – Crash the application • Loss of data Loss of data • Overhead of restart • Attack recurs • Denial of service – Automatically patch the application

  3. ClearView: S Security for legacy software it f l ft Requirements: Requirements: 1. Protect against unknown vulnerabilities 2 2. Preserve functionality P f ti lit 3. Commercial & legacy software

  4. 1. Unknown vulnerabilities 1. Unknown vulnerabilities • Proactively prevent attacks via unknown Proactively prevent attacks via unknown vulnerabilities – Zero-day exploits “Zero day exploits” – No pre-generated signatures – No hard-coded fixes No hard coded fixes – No time for human reaction – Works for bugs as well as attacks W k f b ll tt k

  5. 2. Preserve functionality 2. Preserve functionality • Maintain continuity: application Maintain continuity: application continues to operate despite attacks • For applications that require high availability For applications that require high availability – Important for mission-critical applications – Web servers, air traffic control, communications Web servers, air traffic control, communications • Technique: create a patch (repair the application) ( p pp ) – Patching is a valuable option for your toolbox

  6. 3. Commercial/ legacy software 3. Commercial/ legacy software • No modification to source or executables No modification to source or executables • No cooperation required from developers – Cannot assume built-in survivability features C t b ilt i i bilit f t – No source information (no debug symbols) • x86 Windows binaries

  7. Learn from success and failure Learn from success and failure • Normal executions show what the application Normal executions show what the application is supposed to do • Each attack (or failure) provides information about the underlying vulnerability • Repairs improve over time R i i ti – Eventually, the attack is rendered harmless – Similar to an immune system Similar to an immune system • Detect all attacks (of given types) – Prevent negative consequences – Prevent negative consequences – First few attacks may crash the application

  8. all executions Detect, learn, repair [Lin & Ernst 2003] [Li & E t 2003] Pluggable detector, Attack does not depend on learning detector detector normal attacks executions (or bugs) • Learn normal behavior (constraints) from successful runs Learning • Check constraints during attacks predictive • True on every good run constraints • False during every attack • Patch to re-establish constraints Repair • Evaluate and distribute patches patch Restores normal behavior

  9. A deployment of ClearView A deployment of ClearView Community machines Server (Server may be (Server may be replicated, distributed, etc.) Threat model does not (yet!) include malicious nodes Encrypted, authenticated communication

  10. Learning normal behavior Learning normal behavior Community machines Observe normal behavior Generalize observed behavior Server … copy_len ≤ buff_size … Clients send Server generalizes inference results (merges results) Clients do local inference

  11. Attack detection & suppression Attack detection & suppression Community machines Server Detectors used in our research: – Code injection (Memory Firewall) – Memory corruption (Heap Guard) – Memory corruption (Heap Guard) Many other possibilities exist Detector collects information and terminates application

  12. Learning attack behavior Learning attack behavior Community machines What was the effect of the attack? Server Clients send difference in Server correlates behavior: violated constraints Instrumentation continuously constraints to attack evaluates learned behavior

  13. Repair Repair Community machines Propose a set of patches for each behavior that predicts the attack p Server Predictive: copy len ≤ buff size py_ _ Candidate patches: 1. Set copy_len = buff_size 2. Set copy len = 0 py_ 3. Set buff_size = copy_len 4. Return from procedure Server generates a set of patches

  14. Repair Repair Community machines Distribute patches to the community Server Ranking: P t h 1 Patch 1: 0 0 Patch 2: 0 Patch 3: 0 …

  15. Repair Repair Community machines Evaluate patches Success = no detector is triggered gg Server Ranking: P t h 3 Patch 3: +5 5 Patch 2: 0 Patch 1: -5 … When attacked, clients send outcome to server Detector is still Server ranks patches running on clients

  16. Repair Repair Community machines Redistribute the best patches Server Ranking: P t h 3 Patch 3: +5 5 Patch 2: 0 Patch 3 Patch 1: -5 … Server redistributes the most effective patches

  17. Outline Outline • Overview Overview • Learning normal behavior • Learning attack behavior L i tt k b h i • Repair: propose and evaluate patches • Evaluation: adversarial Red Team exercise • Conclusion Conclusion

  18. Learning normal behavior Learning normal behavior Community machines Generalize observed behavior Server … copy_len ≤ buff_size … Clients send Server generalizes inference results (merges results) Clients do local inference

  19. Dynamic invariant detection Dynamic invariant detection • Daikon generalizes observed program executions Candidate constraints: Remaining candidates: Observation: copy_len < buff_size copy_len < buff_size copy_len ≤ buff_size copy_len ≤ buff_size copy_len: 22 copy_len = buff_size l b ff i copy_len = buff_size l b ff i buff_size: 42 ff copy_len ≥ buff_size copy_len ≥ buff_size copy_len > buff_size copy_len > buff_size copy len ≠ buff size py_ _ copy len ≠ buff size py_ _ • Many optimizations for accuracy and speed Many optimizations for accuracy and speed – Data structures, code analysis, statistical tests, … • We further enhanced the technique q

  20. Quality of inference results Quality of inference results • Not sound – Overfitting if observed executions are not representative • Not complete – Templates are not exhaustive Templates are not exhaustive • Useful! • Unsoundness is not a hindrance Unsoundness is not a hindrance – Does not affect attack detection – For repair, mitigated by the correlation step – Continued learning improves results Continued learning improves results

  21. Outline Outline • Overview Overview • Learning normal behavior • Learning attack behavior L i tt k b h i • Repair: propose and evaluate patches • Evaluation: adversarial Red Team exercise • Conclusion Conclusion

  22. Detecting attacks (or bugs) Detecting attacks (or bugs) Goal: detect problems close to their source Goal: detect problems close to their source Code injection (Determina Memory Firewall) – Triggers if control jumps to code that was not T i if t l j t d th t t in the original executable M Memory corruption (Heap Guard) ti (H G d) – Triggers if sentinel values are overwritten These have low overhead and no false positives Other detectors are possible

  23. Learning from failures Learning from failures Each attack provides information about the Each attack provides information about the underlying vulnerability – That it exists That it exists – Where it can be exploited – How the exploit operates How the exploit operates – What repairs are successful

  24. Attack detection & suppression Attack detection & suppression Community machines Server Detector collects information and terminates application

  25. Learning attack behavior Learning attack behavior Community machines Where did the attack happen? scanf Server read_input p process_record _ main Detector maintains a shadow call stack Client sends attack info to server Detector collects information and terminates application

  26. Learning attack behavior Learning attack behavior Community machines Extra checking in attacked code Check the learned constraints Server scanf read_input process_record main Server generates Server sends instru- instrumentation for mentation to all clients targeted code locations Clients install instrumentation

  27. Learning attack behavior Learning attack behavior Community machines What was the effect of the attack? Server Predictive: Predictive: copy_len ≤ buff_size Clients send difference in Server correlates behavior: violated constraints Instrumentation continuously constraints to attack evaluates inferred behavior

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