Repository navigation
row level security on source tables #1027
Replies: 3 comments
|
Hi, thanks for digging into this. You're right that the current check is too broad for the case you describe. It is not currently possible. pg_trickle falls back to FULL whenever any source has RLS enabled, without checking whether RLS actually applies to the stream-table owner. One nuance is that the scheduler's superuser identity is not what executes the defining SQL. pg_trickle switches to the stream-table owner with row_security = on. However, if that owner is a superuser or has BYPASSRLS, PostgreSQL I think we can safely narrow the restriction:
WAL alone is not enough for owners subject to RLS because policies can depend on other tables or functions, changing visibility without producing a WAL event for the protected source. So yes, this should be supported. Until that check is narrowed, FULL is the only supported mode for an RLS-enabled source. Thanks for raising it. |
|
Thank you so much for your time, this project and your reactivity :) I'm gonna test this right away. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi! I'm reading the source code and https://github.com/trickle-labs/pg-trickle/blob/main/plans/sql/PLAN_ROW_LEVEL_SECURITY.md#current-state
and I should be able to to
DIFFERENTIALmaintenance usingcdc_mode => WALon a source with RLS enabled, since the bgworker is a superuser and the wal contains all diffs, regardless of RLS.Is it currently possible? It seems like pg-trickle is overly restrictive here, there should be a way to force differential mode, although I understand the caution for correctness.
If I follow what is said in https://github.com/trickle-labs/pg-trickle/blob/main/docs/SQL_REFERENCE.md#row-level-security-rls,
if the stream table is owned by a superuser, then the source's policies should be ignored and I should be able to continue without a forced fallback to
FULLmode.All reactions