84 points · by jasoncartwright · 1y ago · 57 comments
Speaking for myself, I remember a time when personal ("indy") projects had the reputation of being better cared for than big company products before online repositories were even a thing.
Did it? I'm not so sure.
One particular example of this is that anonymous access, as hinted in the article, is turned on by default and it’s not straightforward to just disable it, it requires some in depth knowledge around how the Postgres security model works to do it correctly.
This is not a problem with Supabase.
For an in depth discussion of the type of issues I am referring to
I guess the training data has more demos of people doing it the wrong way than examples/blogs/articles about how to do it properly.
I think by default they have some sort of public schema which is the default schema and for which PostgREST is enabled. There may be a checkbox to change that during setup but it's not checked by default.
Instead, one should probably use a different schema for the actual tables and create views that define the public API in the public schema.
I just googled this and it seems to be even recommended in the PostgREST documentation itself: https://postgrest.org/en/v10/schema_structure.html#
Just asking, because it sounded funky when I heard it at first.
They still execute on the server. Server and client code is never mixed in the same file, and there is a way to enforce at the build time that code destined for the server never accidentally gets pulled into the client bundles either.
See here for an overview. https://overreacted.io/what-does-use-client-do/#use-server
BaaS sounds cool but, for small apps, understanding and configuring RLS is a lot harder than writing a backend to expose only what you want.
1. Put anything that you don't want to be accessible by anon in a schema other than "public." This seems obvious, but the public schema is Supabase's default behavior. Supabase's official reply about this question is "I guess you can, but don't worry, RLS." However, security is an onion. Put up as many barricades as you can. If I was king of Supabase, I would err on the side of security.
2. Login to Supabase Studio, set your role to "anon" instead of "postgres" and click on every single table and view that should be private, and make sure there are no results.
Supabase could do a lot better about communicating this, and it would require no breaking changes unlike this disaster[0] which requires hacking your historic migrations!
> Supabase's official reply about this question is "I guess you can, but don't worry, RLS."
Here is a more representative view of our official reply:
https://supabase.com/docs/guides/database/hardening-data-api
To avoid both 1 and 2 I would suggest creating a `private` schema. We are now in the planning stages to make this the default
This is excellent news!
I apologize for my "disaster" wording. I had to eat some hours for that, and I am a bit salty. This was a tough thing technically for you guys, and it's likely more about future users. I get it. However, hacking my old migrations did feel very icky.
All that aside, I would like to genuinely thank your team for reading my reddit comment about my argument for MCP --read-only, and only a couple of days later coming back with ~"Yeah, that actually makes sense, we are doing it."
On HN, we are used to YC-funded CEOs chiming in sometimes, but you guys created a feature based on my rando reddit comment, because it made sense. That's an org I want to work with. I should have made my original comment more accurate about my feelings.
it was great feedback, thank you!
My understanding is the notion is about getting an application to "work" without any underlying theory of operation or evaluation of the imported context.
Pray tell, what is a good choice then?
.
.
... anything you already know yourself to secure so you can correct the "AI"
wow great security advice, maybe add another pro tip like "look out the front window when you vibe drive your car".
Push out crap, hope it sells, leave the problem for someone else to figure out.
Make the minimum thing people will pay money for and hope that a bigger fish gobbles you up.
In order to put something online and have it stay there, you must possess the will to dominate.
Internet citizenship isn't a right and it's something LLMs won't help you with.
If you can't fight then go back to Facebook where you belong.
> Internet citizenship isn't a right
> If you can't fight then go back to Facebook where you belong.
Respectfully, these phrases sound a bit toxic and elitist tbh.
Perhaps you meant that the net is a bit like the wild west, so one best bet mindful of the dangers?
As another commenter mentioned, don't complain your house was broken into if you didn't have locks on the doors.
> it's something LLMs won't help you with.
That phrase, however, is spot on.