Do I Need Row Level Security with Supabase if My API Handles Authentication?
Answers
Reply to this answer
VOTING_register: Thanks for the insights! Iโm still thinking about adding RLS and creating a new Postgres role soon. Do you think itโs too much risk to release an MVP with RLS enabled without rules and just the service key? Iโm not a professional developer, and I worry that I might make mistakes with RLS and roles.
~supper plans+: It definitely makes sense to implement RLS gradually, especially for critical data. Donโt hesitate to start simple and improve security as you go!
Reply to this answer
~supper plans+: Thanks for clarifying! Iโve heard mixed feedback about using the service key in production but wasnโt sure why. I only use it as a backend .env variable to access the database.
Reply to this answer
~supper plans+: Yes, I have RLS enabled on all tables, without rules applied, which I believe means that access is not allowed by default. I only bypass this with the service key.
Reply to this answer
Add your answer
Answers are reviewed before publication.
8 hats drying: But isnโt the data API made by Supabase just hitting PostgREST to communicate with the database? So, it's not like Iโm directly exposing my database to the frontend, right?