Skip to content

Part 1 : Adds RLS and CLS control Policies #2048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

singhpk234
Copy link
Contributor

@singhpk234 singhpk234 commented Jul 14, 2025

About the PR

This PR adds proposed policy spec proposed as part [OSS] Row and Column Based Access Control: Policy Definitions

This uses iceberg expressions, to define row level filters and uses column projections as way to project, presently since we are just talking of column (waiting for UDF's in Apache Iceberg to standardize), May be we can use transforms for the projections ? open to it !

Note: In last Apache Iceberg Community Sync all were generally alligned that using iceberg expression with extending its support for reference to iceberg UDF's were the right way to go !

This additionally introduces 2 context variables which are resolved at the catalog end based on the caller
$current_prinicipal, checks if the current principal is the principal activated, if yes makes this as true !
$current_principal_role, checks if the the underlying role is one of the activated principal roles based on current caller context !

so a policy being defined with this context variables are replace inline and evaluated using iceberg expression sdk !

so when ever the caller calls /get-applicable-policies it gets back context resolved variables and row and column policy

TODO : Policy merging

please check tests for E2E tests

Note : This is for engines who wants to get the policies directly ! rather than getting the secure view and are willing to integrate to the Polaris Policy Store directly

check this combination
https://docs.google.com/document/d/1AJicez7xPhzwKXenGZ19h0hngxrwAg3rSajDV1v0x-s/edit?tab=t.0#bookmark=id.j29shahtycb8

@singhpk234
Copy link
Contributor Author

proposal in Apache Polaris for the policy spec - https://lists.apache.org/thread/rf2zsgk9qh36z3s63gx6dgtl0s4cwngr

@singhpk234 singhpk234 requested review from HonahX and flyrain July 14, 2025 21:47
@singhpk234
Copy link
Contributor Author

cc @laurentgo

PolicyEntity policyEntity, boolean inherited) {
private boolean filterApplicablePolicy(PolicyEntity policyEntity) {
// check the type
if (policyEntity.getPolicyType().equals(ACCESS_CONTROL)) {
Copy link
Contributor Author

@singhpk234 singhpk234 Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a PolicyEntityAugmentor which could conditionally modify the object, let me think about it more.

@singhpk234 singhpk234 force-pushed the feature/fgac-policies branch from 6878f0f to decd92b Compare July 14, 2025 23:15
@singhpk234 singhpk234 force-pushed the feature/fgac-policies branch from decd92b to 85ba526 Compare July 15, 2025 06:53
@snazy
Copy link
Member

snazy commented Jul 15, 2025

I'm a bit surprised to see a "ready for review (and merge)" PR for this.
From what I understand quite a few concerns were mentioned, so I'm not sure it's the best idea to start with a code change, but rather collaborate to eventually get to a consensus on the whole approach.

@jbonofre jbonofre self-requested a review July 15, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants