| ▲ | staticassertion 2 hours ago | ||||||||||||||||
Of course it's designed for security... that has nothing to do with my statement. No single boundary is "absolutely reliable", that's my entire point. | |||||||||||||||||
| ▲ | skeeter2020 2 hours ago | parent | next [-] | ||||||||||||||||
You can (and in some cases should) combine this with other boundaries, like access control or specific query logic. RLS moves the core checks closer to the data being controlled (i.e. the database) specifically to prevent the errors like forgetting to add the "where user_id = xxx" clause. It is super-valuable in compliance scenarios where someone like your DB Admin has permission to control access but not see any data, and consumers (both devs and end users) can write queries to see different levels of access but are not allowed to control data. Obviously it's not a silver bullet and the isolation can be confusing when debugging, but generally a single point for your applying RBAC is a feature not a shortcoming. The next level of security might be how you define your roles. I actually believe the simplest, most secure client scenario is physical isolation, where you give the user/consumer only the data they are allowed to use and then don't try to control it (someone mentioned this above, using parquet & duckdb). There's downsides here too: doesn't work for write scenarios, can be resource intensive or time delayed, doesn't handle chain of custody well, etc. You typically have two strategies: 1. pick the best approach for the specific situation. 2. pick your one tool as your hammer and be a d!ck about it. | |||||||||||||||||
| |||||||||||||||||
| ▲ | weird-eye-issue 2 hours ago | parent | prev [-] | ||||||||||||||||
This is the real world not everybody can get a perfectly isolated database instance. Also you do realize that is not necessarily any more secure than RLS right? Something still has to control what database the code connects to. That could have a flaw just as much as you could have a flaw when setting up RLS. | |||||||||||||||||
| |||||||||||||||||