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

Secure Microservices Adoption #MicroXchg2017

Secure Microservices Adoption #MicroXchg2017

Grygoriy Gonchar

February 17, 2017
Tweet

More Decks by Grygoriy Gonchar

Other Decks in Technology

Transcript

  1. Validating client certificates server { ssl_verify_client on; ssl_client_certificate /etc/nginx/certs/zone-1-ca.crt; if

    ($ssl_client_s_cn !~ '/CN=shopping-cart-srv/') { return 403; } } http://nginx.org/en/docs/http/ngx_http_ssl_module.html
  2. Why TLS client certificates You pay once for automated short-lived

    TLS certificates - you get both strong transport security and authentication Mutual authentication can be implemented Single service identity reduce amount of application secrets, asymmetric security - no shared secrets Application code can even don’t know about TLS but risk of misconfiguration exists Certificate hierarchies as additional layer of defence
  3. Solution Summary BFF can delegate AuthN and encapsulate roles complexity

    from Downstream Microservices End-user types and roles are easier to change Downstream Microservices deal with entity level AuthZ and are agnostic to end- user types and roles Downstream Microservices deal only with trust between services using TLS client certificates Downstream Microservices are more context agnostic and reusable
  4. No secrets in code “A litmus test for whether an

    app has all config correctly factored out of the code is whether the codebase could be made open source at any moment, without compromising any credentials.” https://12factor.net/config
  5. No secrets in code https://github.com/awslabs/git-secrets $ git-secrets --scan -r my-project/

    conf//application.yml:8: AWS_ACCESS_KEY_ID: 'FR4EFR3Y76R2HE4H’ conf//application.yml:9: AWS_SECRET_KEY: 'wcwdc9wd8w8qqDDqq0 [ERROR] Matched one or more prohibited patterns
  6. Secret Management Software Store secrets encrypted Transfer secrets encrypted Audit

    all access Rotate automatically Fine-grained access control
  7. Secret Management Software Store secrets encrypted Transfer secrets encrypted Audit

    all access Rotate automatically Fine-grained access control - !permit role: *my-application privilege: [ read ] resource: *database-password - !permit role: *deployment-agent privilege: [ write ] resource: *database-password https://developer.conjur.net/reference/policy-markup.html
  8. Secret Management Software Conjur https://www.conjur.com/secretsmanagement Vault https://github.com/hashicorp/vault Docker 1.13 Secrets

    https://docs.docker.com/engine/swarm/secrets/ Kubernetes Secrets https://kubernetes.io/docs/user-guide/secrets/ DC/OS Secrets https://docs.mesosphere.com/1.8/administration/secrets/ Many more https://github.com/sweis/crypto-might-not-suck
  9. Microservices Architecture Separation into Microservices can reduce security risks Distribution

    and technology diversity introduce new risks Thoughtful AuthN & AuthZ strategy required Secure Microservices adoption require automation to mitigate new risks (secrets management, vulnerability assessment etc.)