Ask HN: In a microservice architecture, how do you handle managing secrets?
21–30 of 60 posts
Re: Ask HN: In a microservice architecture, how do you handle managing secrets?
#22Azure Key Vault! Disclosure: am dev in Azure, although not on this specific product. https://azure.microsoft.com/en-us/services/key-vault/
Re: Ask HN: In a microservice architecture, how do you handle managing secrets?
#23A simple solution if you are in AWS is S3 with instance profiles for access.
Yes, but is there a succinct howto on this?
1) Create an S3 bucket. Remove all permissions from it
2) Create an IAM role - give it explicit read permissions to just that bucket (there's a HOWTO at the bottom of this article: http://mikeferrier.com/2011/10/27/granting-access-to-a-singl...). When you start an ec2 instance, you can give it one (and only one) IAM instance role.
3) Put your secrets or configs in a file on that bucket. For example, config.json or whatever format you choose.
4) On your instance or container, use the aws-cli on when your app starts to copy that file down from S3, then read it into memory in your application and then delete it.
It's a bit of a hack but you can now easily restrict access to that secrets bucket, and only your running instances/containers can access it. The secrets only exist in running app memory. Now don't allow SSH access to those instances :)
Re: Ask HN: In a microservice architecture, how do you handle managing secrets?
#24A simple solution if you are in AWS is S3 with instance profiles for access.
Yes, but is there a succinct howto on this?
2) Create a S3 bucket
3) Write a bucket policy that whitelists specific IAM Roles to specific key paths within the bucket.
Re: Ask HN: In a microservice architecture, how do you handle managing secrets?
#25it's a huge pain point for us. We're a .NET shop rolling our own that mimics/overlays app.config and web.config patterns for both dev and production usage. Our concern is less on how do you get the secrets to the box (though that's obviously important) and more on how do you keep an attacker who has started penetrating your infrastructure from gaining control of the infrastructure that holds your secrets.
Have you had a look at the new ASP.NET Configuration classes? [1] I hate having to manage web.config but I get your point about keeping attackers at bay (and not providing pivot points). [1]: http://docs.asp.net/en/latest/fundamentals/configuration.htm...
Re: Ask HN: In a microservice architecture, how do you handle managing secrets?
#26Re: Ask HN: In a microservice architecture, how do you handle managing secrets?
#27We're using Ansible which means we use ansible-vault to store secrets. We store the encrypted files in S3 and decrypt them on deploy as needed.
Re: Ask HN: In a microservice architecture, how do you handle managing secrets?
#28We use Kubernetes, which includes its own secrets API: http://kubernetes.io/v1.1/docs/user-guide/secrets.html I can't remember which issue this was on, but it seemed like there was some discussion on their GitHub project about making pluggable secrets backends (HashiCorp's Vault was mentioned). Kubernetes' secrets API is still very basic, but I think the fundamental concept is very sound and has a great foundation to…
https://github.com/kubernetes/kubernetes/issues/10439#issuec...
Re: Ask HN: In a microservice architecture, how do you handle managing secrets?
#29Re: Ask HN: In a microservice architecture, how do you handle managing secrets?
#30https://www.distelli.com/docs/user-guides/securing-your-appl...
Disclaimer: I'm the founder at Distelli