Live data from Hacker News

Supabase Vault is now in Beta

supabase.com

11–20 of 29 posts

Re: Supabase Vault is now in Beta

#11

IS Vault their own extension? I'm using Postgresql for a service and I'd love to use this feature. Maybe I should just use supabase as my backend... "I'm going to have to rethink my ink"

yes - it's open source here: https://github.com/supabase/vault This wraps pgsodium ( https://github.com/michelp/pgsodium ), which wraps libsodium ( https://doc.libsodium.org/ ). > I'm using Postgresql for a service and I'd love to use this feature. Maybe I should just use supabase as my backend... We'll try to get the other big clouds to adopt some of these extensions we're developing (including pg_graphql). Vault is…

> We'll try to get the other big clouds to adopt some of these extensions we're developing

This is critical if you're aiming for mass adoption. I need to be able to use this on Google Cloud PostgreSQL and Azure PostgreSQL before I can consider using it.

Re: Supabase Vault is now in Beta

#12
post #8

Vault and pgsodium dev here at supabase, we're pretty excited about the Vault, and this is just the beginning of some of the advanced encryption functions that libsodium provides that we want to bring into the Postgres ecosystem. Happy to answer any questions here about how the Vault works now, and always excited to see use cases and suggestions for features from the community. libsodium is a big API, and pgsodium ex…

forgive my ignorance first of all.

One of the things i was going to work on this weekend was an enhancement to a side project and it involves storing some sensitive information in a database. My usual way of doing this is strong encryption in the application code with a key from an environment variable then base64 encode the result and put it in a text column.

Is Vault something that can handle this without getting into my app code? Basically, if i gave a someone root access to my supabase instance is that encrypted data safe?

PS the more i read about supabase the more magical it becomes. It's incredible work so congratulations, i love it.

Re: Supabase Vault is now in Beta

#14

Very nice. I'm building a new startup MVP with supabase it's been lovely so far. Now if there could be an EC2 competitor I may be able to avoid (re-learning) AWS entirely.

we've found Fly.io to be very nice

Fly.io plus Cloudflare have been a great combination for us, and we've added point solutions for other things as needed like email, auth, etc. Feels much more approachable than AWS when you're at a small scale.

Re: Supabase Vault is now in Beta

#16
post #12
post #8

Vault and pgsodium dev here at supabase, we're pretty excited about the Vault, and this is just the beginning of some of the advanced encryption functions that libsodium provides that we want to bring into the Postgres ecosystem. Happy to answer any questions here about how the Vault works now, and always excited to see use cases and suggestions for features from the community. libsodium is a big API, and pgsodium ex…

forgive my ignorance first of all. One of the things i was going to work on this weekend was an enhancement to a side project and it involves storing some sensitive information in a database. My usual way of doing this is strong encryption in the application code with a key from an environment variable then base64 encode the result and put it in a text column. Is Vault something that can handle this without getting i…

> Is Vault something that can handle this without getting into my app code? Basically, if i gave a someone root access to my supabase instance is that encrypted data safe?

The answer is slightly offset from your question, so let me start by pointing out that the Vault is about Encrypted Data At Rest. This is mentioned in the docs and in the blog and video, but it's something that I like to always mention first in discussions. The main purpose of the Vault is to store your data encrypted, so that it's encrypted on disk, and in backups. In SQL the decrypted secrets are available to you, because that's where you are using them and encrypted data must be decrypted to be useful.

If someone roots access to your database, then yes they can access the decrypted secrets through the view. This is by design, the secrets must be decrypted to be useful in query code. This risk is similar to someone rooting your application code, they will see decrypted secrets via your environment key, so no it won't protect you against anyone rooting processes in your stack that need useful access to secrets and it's not meant to. Like all security you must take a layered approach, the Vault is just one storage level layer strategy.

One big difference from the env var approach though is that the key Supabase uses to encrypt your secrets with the Vault is stored outside the database, it is inaccessible to SQL, which is an enhancement over sticking the raw key into an environment variable or a table that is accessible to your application. Instead of revealing the raw key, pgsodium has a feature called [Server Key Management](https://github.com/michelp/pgsodium#server-key-management) where you do not have access to the raw key, but instead reference keys by an key identifier. It is safe to store this identifier alongside the data it encrypts. The raw key itself is never stored. I'm very intentionally overusing the word "store" here, because that's specifically the layer of security that the Vault provides.

Re: Supabase Vault is now in Beta

#17

>Group encryption: [...] Came here to ask just about that but I see it's on your roadmap already, that's good and godspeed with that since encryption is hard . During my PhD, I worked a little while with threshold encryption schemes (sometimes called horcrux encryption schemes, i.e. make n keys, you need at least m of them to perform some operations) (ref. my noob-ish question here ha https://crypto.stackexchange.com…

You've hit the nail right on the head with this question on how hard group encryption is, and we don't have all the answers yet as we are still working the use cases around it. We are hoping to reach a level of security that you mention in your SE question using something similar to the excellent accepted answer, distributed private key sharing among trusted participants.

The basis we are exploring is using an algorithm called Signcryption (https://github.com/jedisct1/libsodium-signcryption) that is already included in pgsodium. This doesn't solve any of the shared private key issues you mention above, but it is a useful foundation for distributing encrypted messages that separate out sender and receiver identifiers from their keys, a sort of lower level foundation on top of which distributed key sharing can occur.

I also think signcryption is a great foundation for a better token format than JWT or PASETO, as it covers all of their use cases without algorithm confusion attacks (despite PASETO's insistence on "Algorithm Lucidity") and supports more features such as third party verification and streaming shared key generation from any token without having to exchange the key, we hope to use these tokens so that end-to-end peers can exchange tokens, derive streaming shared keys, and then do direct point-to-point message exchange using libsodium crypto_secretstream API which supports key ratcheting for forward secrecy.

Would love to discuss more about your research with you and include it with attribution into our future work, send me an intro at michel@supabase.io when any other ideas or resources you'd like us to see!

Re: Supabase Vault is now in Beta

#18

Very nice. I'm building a new startup MVP with supabase it's been lovely so far. Now if there could be an EC2 competitor I may be able to avoid (re-learning) AWS entirely.

Try fly.io. For our use case, even though I've used AWS/EC2 for 10+ years, Fly.io and similar (render.com probably but I haven't used it) are refreshing because I know a lot of the best practices are just baked in.

I really don't see the point of running a large class of applications on AWS at this point, apart from "X customer won't bother us if we respond with the word AWS".

If only fly/render/all these people come up with an easy way to translate a docker compose config to their architecture, that would be madly powerful (first thing I'd try is to self-host Supabase!)

Re: Supabase Vault is now in Beta

#20
post #18

Very nice. I'm building a new startup MVP with supabase it's been lovely so far. Now if there could be an EC2 competitor I may be able to avoid (re-learning) AWS entirely.

Try fly.io. For our use case, even though I've used AWS/EC2 for 10+ years, Fly.io and similar (render.com probably but I haven't used it) are refreshing because I know a lot of the best practices are just baked in. I really don't see the point of running a large class of applications on AWS at this point, apart from "X customer won't bother us if we respond with the word AWS". If only fly/render/all these people come…

+1 to render.com
Post reply on HN