91 points · by vmatsiiako · 3y ago · 55 comments
Our project Machine ID is replacing API keys with short-lived certificates:
https://goteleport.com/docs/machine-id/introduction/
Another great option is SPIFFEE https://spiffe.io/
The adoption is slower than we wanted, because it's not trivial to replace API keys, but we see more and more companies using mTLS + short lived certs as alternative to shared secrets.
LVH from Latacora explains it way better than I could in "A child's garden of inter-service authentication" [1]
However, here is my view:
If your token is not bound to the connection, someone can steal and reuse it, just like any other token. It is possible to use OAuth token binding [2], but at this level of complexity, mTLS + short lived certs deliver the same security and are easier to deploy.
It's easy to mess up JWT signatures, although, to be fair, it's not like X.509 certificates format is any better, however it's been more tested over years of use.
[1] https://latacora.micro.blog/2018/06/12/a-childs-garden.html [2] https://connect2id.com/learn/token-binding
P.S.
I tried Infisical a couple of months ago. I think if I was Hashicorp Vault team's PM, I'd be worried. Your team has done such a great job at U.X. I was astonished to see an early startup with such a great integration catalog. I think you aced it - modern developers are desperate for out of the box integrations with 100+ services they have to use every day.
For example you store your secrets in the env. Well your program crashes and the log capture software dumps the entire env, or it’s included in some crash report.
Leaks from every corner.
Put an encryption key in the code and use it to decrypt the environment on use to recover the API key. You have to get both leaks to recover the key.
So, you really need to be doing everything else correctly first and can't use that to fix sloppy key management and monitoring/prevention.
I think this is about as good as you can do, honestly, since even using something along the lines of short-lived certs, you still have secrets to protect, and you lose the ability to easily do immediate revocations.
No surprise that they get leaked all the time now, though at least one can cancel them at any point... and then you have to spend an hour or two replacing the cached version everywhere.
GitGuardian can provide an automatic audit of your company-specific leaks we found on GitHub. Just ask: https://www.gitguardian.com/complimentary-audit-secrets-leak...
More details on how it works: https://blog.gitguardian.com/github-secrets-leak-free-audit/
ie. "Here, just run document.cookie='SID=EB73542386AF235' " Then you'll be logged in as an account that can do what you're trying to do.
It's not scanning developer support tickets to see when devs hand over credentials to specific individuals.
It's pretty much checking if there's a variable called "_token" or "_secret" or similar which is then assigned to a string matching a regex looking for high entropy random-looking values.
We have similarly simple UX but are more robust on security. Browser-based end-to-end encryption as offered by Infisical is a bit of a fig leaf—it doesn’t protect against insider threats.
I definitely resonate with your point though on the automatic errors due to false positives. There is a lot of room for improvement.
Done well, they have an audience set for what they authenticate. Which can limit the exposure back to the issuer. But you are supposed to trust that holding the token means you know who the user is.
Right?
> Many style guides advise against usage of these redundant acronyms in formal contexts, but they are widely used in colloquial speech.
So while users are allowed to read the token and its contents, you don't want user-identifying tokens to fall in the hands of someone else.
You might be thinking of a public key.