TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Monzo: How our security team handle secrets

137 pointsby p10jkleover 5 years ago

14 comments

micah_chattover 5 years ago
(Disclosure: I work on Kubernetes&#x2F;EKS Security at AWS)<p>I&#x27;m curious why they didn&#x27;t look into using Kubernetes ProjectedVolumeTokens for authenticating to Vault? The tokens Kubernetes issues are not stored in etcd, and they contain pod-specific metadata so they are invalidated as soon as the pod dies (when using TokenReview). Alternatively, they can be used to directly authenticate with Vault since they&#x27;re OIDC-valid tokens [1].<p>The semantics around secrets in Kubernetes aren&#x27;t nearly as robust as Vault, so I was surprised to not see this more clearly called out (ex: list secrets == get all keys and values). Even if you use KMS&#x2F;AES encryption (which they reference) that doesn&#x27;t help with access control.<p>[1] <a href="https:&#x2F;&#x2F;www.vaultproject.io&#x2F;docs&#x2F;auth&#x2F;jwt.html" rel="nofollow">https:&#x2F;&#x2F;www.vaultproject.io&#x2F;docs&#x2F;auth&#x2F;jwt.html</a>
评论 #21227937 未加载
评论 #21228871 未加载
nemothekidover 5 years ago
The intersection of microservices + Vault is something I&#x27;ve long had to deal with - as far back as Vault 0.5.0, so I&#x27;m a bit &quot;surprised&quot; that isn&#x27;t something that is turn-key with Vault+k8s today.<p>I was working with Mesos (before k8s had taken the world by storm), and had a similar issue - how do services get vault tokens without having a workflow that may include storing &quot;secrets&quot; in configuration. What I ended up writing was a tool[1] that a service could query, with it&#x27;s Mesos Task ID, to get a token. The tool would then read it&#x27;s own configuration, as well as the current mesos state to determine if the request was valid or not.<p>Unlike the k8s solution, as I understand it, you don&#x27;t need to treat the &#x27;service account token&#x27; as a secret (reducing the attack surface of when someone steals that token _and_ also has access to Vault). This is accomplished in two ways:<p>1. You can determine if a request is valid by looking at how long the service is running. If someone steals a Task ID, but the service has already been running for 2 minutes, then the Task ID is useless.<p>2. The Vault token is only issued once per service launch. This means if an attack steals the Task ID, but the token has already been given out, the Task ID is useless. If the attacker beats the the service in asking for that key, then the service should raise the alarm bells about it&#x27;s key potentially being stolen. If you are even more paranoid, you could even decide to invalidate all active keys and reduce the amount of time the attacker has a valid Vault Token.<p>This was largely designed years ago with some cues I took from one of Vault&#x27;s lead engineers so I expected that the k8s integration would work similarly. I&#x27;m not too familiar with k8s however so there might be other constraints I&#x27;m overlooking in why Vault&#x27;s k8s is integrated the way it is.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;nemosupremo&#x2F;vault-gatekeeper" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nemosupremo&#x2F;vault-gatekeeper</a>
评论 #21226598 未加载
Shoopover 5 years ago
&gt; We run about 1,100 microservices written in Go<p>Asking as a university student: is this a common number of microservices to have running in production? It looks like monzo has about 1,351 total employees [0]. If all of them were software engineers, this would be a little less than one microservice per engineer. How do you handle code reuse and reliability among thousands of microservices? It seems like the number of possible failure states would be unthinkable.<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Monzo_(bank)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Monzo_(bank)</a>
评论 #21226546 未加载
评论 #21228326 未加载
评论 #21228181 未加载
tialaramexover 5 years ago
The bit where a secret gets pasted into the Very Secure system is a clear problem. Because before it was pasted, and while it was being pasted, it&#x27;s not in that secure system it&#x27;s on some dev&#x27;s laptop.<p>Most of your secrets will be&#x2F; should be just random bits maybe in some particular format that was convenient for a particular application e.g. a 4-digit PIN or a sixteen character Hexadecimal string, or 10 characters of A-Za-z0-9<p>So for these cases there&#x27;s no reason that secret is ever on a developer&#x27;s laptop. Best case the developer made a truly random secret, maybe they (like me) keep a set of hexadecimal dice on their desk for random choices. Just as likely it&#x27;s tainted, the developer ran a randomizer until out popped a string they liked - or even they found one on a web site, or used the same one as in their test environment.<p>Either way, since what you wanted was random bits it makes sense in most cases (not all cases, obviously a secret key you were sent by somebody else, for example an API key for their system will have to be copied somehow) to have a feature that just spits the right format of random bits into the secure system without any human seeing them at all.<p>Even better, in cases where it&#x27;s an option, is not to rely on stored secrets at all. I think Monzo&#x27;s post is not worrying about this difference, but it can be critical in terms of decisions about debugging to prefer to have entirely ephemeral secrets. When a pod goes away, the ephemeral secrets that pod had vanish with it, and so you aren&#x27;t storing them anywhere anyway. If they aren&#x27;t stored, they can&#x27;t get stolen by anybody and you&#x27;ve got one less thing to go wrong.
评论 #21226794 未加载
评论 #21226528 未加载
评论 #21227326 未加载
atonseover 5 years ago
I so, so, so, badly want to use Vault everywhere.<p>The one thing keeping me from adopting isn&#x27;t that it won&#x27;t be secure enough. I worry _constantly_ that I&#x27;ll lock myself out of my data, my infrastructure, etc.<p>Have others had that worry? How&#x27;d you get over it and just start using Vault? (probably through incremental, low-risk adoption first?)
评论 #21226239 未加载
评论 #21226123 未加载
评论 #21225867 未加载
评论 #21225959 未加载
whycombagatorover 5 years ago
Vault interests me but seems to come with a lot of complexity&#x2F;requires an army of devops. There&#x27;s a YC backed company called Envkey[0] that looks interesting + simple, but there is no option to self host yet<p>[0] <a href="https:&#x2F;&#x2F;www.envkey.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.envkey.com&#x2F;</a>
评论 #21228650 未加载
评论 #21227161 未加载
评论 #21227539 未加载
评论 #21226753 未加载
rossmohaxover 5 years ago
One thing bugs me about Vault and I rarely see it beeing discussed: how come a design where Vault simultaniously stores secret AND is able to access other systems these secrets are for is deemed as good and secure?<p>Vault is a company-wide &quot;root account&quot;, reachable from every part of internal network, storing all the company secret data and have reach to many internal and external systems like databases, where it have full rights to dynamically configure short lived credentials. Doesn&#x27;t it put too much trust into a single system?
评论 #21230555 未加载
评论 #21229235 未加载
IshKebabover 5 years ago
Ha I love how they explain what &quot;cryptography&quot; means, as if anyone reading this wouldn&#x27;t know.<p>Also I love the level of openness. No other bank would do this. (If you&#x27;re in the UK, Monzo is honestly amazing. I&#x27;ve cancelled all my other bank accounts.)
评论 #21226134 未加载
评论 #21229076 未加载
评论 #21226217 未加载
评论 #21239824 未加载
lifeisstillgoodover 5 years ago
&gt;&gt; We check that a secret exists in our staging environment (s101) when writing to prod, and warn if it doesn&#x27;t.<p>My first thought ... so you have a script that can see prod and non prod at the same time?<p>I think I may be developing paranoia.
评论 #21230601 未加载
haolezover 5 years ago
Slightly related, but what’s a good practice for storing secrets that need to be recovered as plain text?<p>I’m thinking of a system where the user can register her&#x2F;his API keys to other third-party systems.
评论 #21226587 未加载
评论 #21226694 未加载
_57jbover 5 years ago
One exposure&#x2F;exercise rotating secrets and it is curtains for you.<p>It gets better...stop building rube goldberg secret contraptions.
ggregoireover 5 years ago
Any opinions about Vault vs. AWS secret management solutions?
评论 #21228398 未加载
etxmover 5 years ago
Nitpick: k8s has supported encryption at rest for secrets for a while.<p><a href="https:&#x2F;&#x2F;kubernetes.io&#x2F;docs&#x2F;tasks&#x2F;administer-cluster&#x2F;encrypt-data&#x2F;" rel="nofollow">https:&#x2F;&#x2F;kubernetes.io&#x2F;docs&#x2F;tasks&#x2F;administer-cluster&#x2F;encrypt-...</a>
评论 #21226536 未加载
mkageniusover 5 years ago
Related: I have seen lot of people make mistake of hardcoding the secrets in the android app, please make sure you do not do that. I have a tool to check these embedded secrets: <a href="https:&#x2F;&#x2F;android.fallible.co&#x2F;" rel="nofollow">https:&#x2F;&#x2F;android.fallible.co&#x2F;</a>