Skip to content

Impersonate users in cluster #9751

@filimonov

Description

@filimonov

Given:

  1. cluster configuration with have extra flag <impersonate_users>1</impersonate_users>
  2. default user has a special impersonate permission

Scenario:

  1. user filimonov connect to server A and run a query on Distributed table.
  2. server A connects to server B & server C with its own credentials (let's say as user 'default')
  3. the query send from server A to other servers have an extra setting: SELECT ... SETTINGS user='filimonov' (because of <impersonate_users>1</impersonate_users>)
  4. Target server dynamically change the default user to filimonov (because it allowed by impersonate permission).
  5. all user restrictions for filimonov user are applied (row-based security, allow databases, etc).

Later extra scenarios like "execute particular matview as user XXX" can be added.

Inspired by

Allows to solve the following issues:

  1. using interserver connection pool w/o reconnects
  2. one-time user authentication (no need to store / pass / rerequest authentication information to pass forward)

Related: #6843 #8926

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-distributedDistributed table engine & query routing across shards (sharding/load balancing).comp-rbacAuthorization: roles, grants, quotas, row-level security, access checks.feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions