Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Securiing Microservices

Tony Rice
October 27, 2017

Securiing Microservices

Best practices, patterns and gotchas for securing Microservices.

Tony Rice

October 27, 2017
Tweet

More Decks by Tony Rice

Other Decks in Technology

Transcript

  1. Cisco Public 2017 All Rights Reserved Microservices • many small

    services • decoupled and independent • well defined • sharing data over the network • DevOps and Continuous Delivery • easy to reuse, scale • Incrementally built by autonomous teams
  2. Cisco Public 2017 All Rights Reserved Why Microservices? “Write programs

    that do one thing and do it well.” Ken Thompson Bell System Technical Journal, 1978
  3. Cisco Public 2017 All Rights Reserved Why Microservices? “small, sharp

    tools” Andrew Hunt The Pragmatic Programmer, 1999
  4. Cisco Public 2017 All Rights Reserved Microservices weaken AppSec •

    Larger, varied attack surface • More complex • adds complexity to smaller organizations, more stacks to track and patch • API contracts • Distributed attacks more difficult to detect • Integration tests are critical
  5. Cisco Public 2017 All Rights Reserved Microservices strengthen AppSec •

    Defense in depth, isolation • Less complex • Easier, faster, cheaper security patch distribution • Encourages automated testing • Smaller, bounded, attack surface • Simpler code, handled by focused smaller teams • Fewer stateful sessions • longer app lifetime
  6. Cisco Public 2017 All Rights Reserved Microservice Patterns API Gateway

    • Frontend acts as
 client • Translates protocol
  7. Cisco Public 2017 All Rights Reserved Complexity • Database per

    service? • Data/Message integrity • Rapid change
  8. Cisco Public 2017 All Rights Reserved More Gotchas • Cross

    Service Microservice Injection • Serialization / Deserialization • Dont pass credentials around in the clear • Dont hardcode credentials ANYWHERE (source code, docker configs) • ENV is not interprocess communication
  9. Cisco Public 2017 All Rights Reserved Best Practices - centralize

    commonalities Centralize, externalize and apply across all microservices • Authentication, Authorization, and Accounting (AAA) • Configuration • reduces disparities which lead to exploitable vulnerabilities / escalation of privileges
  10. Cisco Public 2017 All Rights Reserved Best Practices - Developers^3

    • Development team structure should reflect service architecture.
  11. Cisco Public 2017 All Rights Reserved Best Practices - minimalism

    • Segment functions and environments • Grant only the level of access needed • “Need to know”, “least privilege” • Offload network functions to edge (rate-limiting, reputation, etc.) Untitled (in honor of Harold Joachim) 3, 1977 by Dan Flavin
  12. Cisco Public 2017 All Rights Reserved Best Practices - Threat

    Model Threat modeling 1. identify assets 2. map out communication between them 3. identify threats 4. measure risk 5. formulate remediation Sean Gallager, ARS Technica, July 8, 2017
  13. Cisco Public 2017 All Rights Reserved Best Practices • Review,

    review, review • Code reviews during development • Usage reviews after • Remove dead code and underutilized services promptly
  14. Cisco Public 2017 All Rights Reserved NORAD norad.cisco.com Firewall ampqs

    Tenant RELAY RELAY am pqs am pqs NORAD - JIRA gateway REST API infosec-jira CACHE SVC QUEUE WORKER BUSINESS RULES USER MGMT
  15. Cisco Public 2017 All Rights Reserved Active Directory / LDAP

    Spark Client https web hook web hook web services gateway internal resource whitelist @sparkbot <question> https web hook
  16. Cisco Public 2017 All Rights Reserved Resources • REST Cheat

    Sheet • Mobile Cheat Sheet • Network Cheat Sheet • http://microservices.io/ owasp.org