Column Encryption is SQL-only now #18849
Replies: 6 comments 10 replies
-
@kiwicopple Thanks for the update and I understand the reasons even though it makes life more complicated for people who were using the feature as intended. From the pgsodium documentation, I found this snippet and I think that's what Supabase was doing behind the scenes:
Do you confirm that it is the case? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Nevermind, I confirm that's the way it works, so it's fairly easy to implement directly with SQL. |
Beta Was this translation helpful? Give feedback.
-
Any one know where to look for the encryption key location? The documentation just redirects back to the top of the page https://supabase.com/docs/guides/database/extensions/pgsodium#encryption-key-location |
Beta Was this translation helpful? Give feedback.
-
What is meant by "Your data is already encrypted-at-rest"? Does Supabase already encrypt the whole DB on creation? |
Beta Was this translation helpful? Give feedback.
-
Oh no! That was a shock for me. Could you guys show me the documentation to know how to this, step by step. Also the view table, was created automatic. I have a entire project build on top of this feature :-(. |
Beta Was this translation helpful? Give feedback.
-
I was able to apply encryption on a specific table column as @vinch and @EduardMe suggested using SECURITY LABEL FOR pgsodium ON COLUMN public.table_name.column_name IS 'ENCRYPT WITH KEY ID <your key id> SECURITY INVOKER'; But this only encrypts new data coming in. How do I go about encrypting already existing column data? 🎯 Edit: I have found a temporary solution - export the existing table data and re-import it. It will encrypt all of the incoming data. |
Beta Was this translation helpful? Give feedback.
-
tldr:
Support for column encryption in the table editor has been removed. You can still use it, but you must use SQL. Your data is already encrypted-at-rest, so this is an advanced feature that should be used sparingly.
How it was previously
Previously, the Table Editor in the Supabase dashboard supported encrypting newly created columns using pgsodium’s Transparent Column Encryption (TCE).
Why we’re changing it
While this makes it easy to use, we found that the easiness has led to a lot of “mis-use” of Encryption. We’ve decided to remove it from the UI for now because TCE has a few sharp edges and the dashboard makes it too easy to encrypt columns without considering trade-offs.
This mis-use led to multiple users frequently running into unrecoverable issues with encryption. A non-exhaustive list of issues which we observed users running into when using TCE through the dashboard includes the following:
pg_sodium
to make the view a security invoker.If you want TCE, use SQL instead
As of now, you can use TCE in SQL by following the pg_sodium documentation so users who already are using TCE can continue doing so via the SQL editor on the dashboard, while new users will have to learn the nuts and bolts of what they are doing before trying to use the feature.
Beta Was this translation helpful? Give feedback.
All reactions