-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Impersonate users in cluster #9751
Copy link
Copy link
Closed
Labels
comp-distributedDistributed table engine & query routing across shards (sharding/load balancing).Distributed table engine & query routing across shards (sharding/load balancing).comp-rbacAuthorization: roles, grants, quotas, row-level security, access checks.Authorization: roles, grants, quotas, row-level security, access checks.feature
Description
Given:
- cluster configuration with have extra flag
<impersonate_users>1</impersonate_users> defaultuser has a specialimpersonatepermission
Scenario:
- user
filimonovconnect toserver Aand run a query on Distributed table. server Aconnects toserver B&server Cwith its own credentials (let's say as user 'default')- the query send from
server Ato other servers have an extra setting:SELECT ... SETTINGS user='filimonov'(because of<impersonate_users>1</impersonate_users>) - Target server dynamically change the
defaultuser tofilimonov(because it allowed byimpersonatepermission). - all user restrictions for
filimonovuser are applied (row-based security, allow databases, etc).
Later extra scenarios like "execute particular matview as user XXX" can be added.
Inspired by
- https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/customizing-permissions-with-impersonation-in-sql-server
- https://docs.microsoft.com/en-us/sql/t-sql/statements/execute-as-transact-sql?view=sql-server-ver15
- sudo :)
Allows to solve the following issues:
- using interserver connection pool w/o reconnects
- one-time user authentication (no need to store / pass / rerequest authentication information to pass forward)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
comp-distributedDistributed table engine & query routing across shards (sharding/load balancing).Distributed table engine & query routing across shards (sharding/load balancing).comp-rbacAuthorization: roles, grants, quotas, row-level security, access checks.Authorization: roles, grants, quotas, row-level security, access checks.feature