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

GET /microservices/secured #JavaDay2016

GET /microservices/secured #JavaDay2016

Specific Microservices security concerns described (risk isolation, authentication, authorization, trust boundaries, dependencies security check, secrets storage and management)

Grygoriy Gonchar

October 15, 2016
Tweet

More Decks by Grygoriy Gonchar

Other Decks in Programming

Transcript

  1. Validating client certificates server {
 ssl_verify_client on;
 ssl_client_certificate /etc/nginx/certs/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 1. You pay once for automated

    short-lived TLS certificates - you get both strong transport security and authentication 2. Mutual authentication can be implemented 3. Application code can even don’t know about it
  3. Why API Gateway 1. Greatly simplifies security design 2. Simplifies

    session management 3. Can do more than security
  4. Why API Gateway NOT 1. Gateway might have lack of

    domain knowledge for authorization decisions 2. Changes and ownership topics might become complicated 3. Affects availability
  5. 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
  6. 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\re4RRfs'
 [ERROR] Matched one or more prohibited patterns
  7. Secret Management Software KeyWhiz: https://github.com/square/keywhiz
 Vault: https://github.com/hashicorp/vault
 Knox: https://github.com/pinterest/knox
 Confidant:

    https://github.com/lyft/confidant
 Secretary: https://github.com/meltwater/secretary
 Sops: https://github.com/mozilla/sops
 Summon: https://github.com/conjurinc/summon
 Biscuit: https://github.com/dcoker/biscuit https://github.com/sweis/crypto-might-not-suck
  8. Why Secret Management Software Store secrets encrypted Audit all access

    Rotate automatically Fine-grained access control
  9. Why Secret Management Software Store 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
  10. Microservices Architecture 1. Isolated Microservices reduce security risks 2. Secure

    Microservices adoption require automation to mitigate new risks