4 ms·
So this is a neat idea, because Credstash and Sneaker are certainly not perfect gizmos, but it leads to the turtles problem: how do I securely handle the initia
by eropple 10y ago
So this is a neat idea, because Credstash and Sneaker are certainly not perfect gizmos, but it leads to the turtles problem: how do I securely handle the initial key that's being plopped on systems? If I can do that, I don't need Cryptic.
I've become a big fan of Credstash over the last few months largely because it solves (well, more like makes irrelevant, I wouldn't really strongly say it's "solved") this problem through using AWS as a trusted third party. Further, Credstash actually handles key ACLs in a much, much smarter way in that it uses KMS encryption contexts, which can be dropped into an IAM policy's Condition block, to further restrict access to secrets. Cryptic doesn't seem to offer this, and its use of Redis as a backing store (itself intended to be used in trusted environments) makes me worried, too.
If continuing along with this project--and please don't take this as discouraging, it seems largely reasonable as a thing!--I would look in more depth at how Credstash uses KMS and bloodily rip it off to improve Cryptic's KMS functionality; it's very, very good at what it's doing.
- domodwyer 10y agoI'm aware of the context parameter passed to KMS, and it is indeed something I plan on adding - one step at a time! This was largely a side project that's gone quite well so far(!) - it's something I'll continue to add to. Any other suggestions are more than welcome. Like it says in the readme, I just wanted a simple (single binary) deployment - it's in no way a dig at credstash.
- eropple 10y agoI get you--I mean, if this was Credstash-compatible (using DynamoDB), I'd probably use it.
- ak217 10y agoCredstash looks great, but having written something very similar for internal use (a secrets management system using KMS and S3 for use by EC2 instances) I was expecting it to have built in functionality to manage IAM policies the way you describe. Otherwise I'm not sure how this restricts different roles from accessing each other's secrets, which is the essential part of defense in depth for secret management. For example, with S3, I have been defining IAM policies that restrict each role's access to just the secrets granted to that role, with a prefix-conditional IAM statement. You can further define similar parameterized policies for IAM users and groups without even enumerating their names.
- eropple 10y agoAs mentioned, KMS uses encryption contexts (a set of key-value pairs) to namespace your secrets. KMS won't decrypt the data key if you aren't in the key policy or your IAM policies don't allow access to that particular encryption context. You're doing it at the S3 object level (presumably with a single KMS key?). Credstash does it at the KMS access level. Both are roughly equivalent, but Dynamo accesses are a lot cheaper in my neck of the woods than S3 accesses.
- ak217 10y agoIt seems to me that cost is negligible for any of the use cases. The KMS CMK cost will dominate access cost in my estimation. I see that Credstash cites latency as a factor in favor of S3, which is not a major factor if you retrieve a secret only once in a while and put it into memory, but could enable cool use cases where you really retrieve it on demand. S3 does have other advantages - ease of use and granularity of IAM access control, I think. The Credstash documentation and code lead me to believe you are responsible for managing your own IAM policies - it won't set the policies in credential writer mode. Is that not correct? I expect this functionality to be part of the secret manager.
- eropple 10y ago> I see that Credstash cites latency as a factor in favor of S3, which is not a major factor if you retrieve a secret only once in a while and put it into memory Sorry, I wasn't clear. I meant "cheaper" in terms of time. I have a lot of machines in flight at any time, and I do actively roll credentials--chef-zero runs every five minutes and pulls credentials out of Credstash. S3 accesses add latency, which slows my converges (sometimes by a lot; I currently have around ~25 secret lookups in one particular Chef run). > I expect this functionality to be part of the secret manager. I'm not saying you're wrong to want that, but I'm very skeptical of it--extremely skeptical. I can't envision a situation where I'd rather have policy management as part of the secret manager as opposed to part of my provisioning infrastructure. My KMS accesses are in IAM roles; there is no situation in which I would ever want Credstash to manage those, because I have other stuff in them! I build my policies in CloudFormation, just like I do everything else. If anything, my biggest criticism of Credstash is that it has a hardcoded table name that I'd rather was an environment variable so that I could establish that via CloudFormation and dump it into an env var via Chef.