When users submit Impala queries through a separate client application, such as Hue or a business intelligence tool, typically all requests are treated as coming from the same user. In Impala 1.2 and higher, Impala supports "delegation" where users whose names you specify can delegate the execution of a query to another user. The query runs with the privileges of the delegated user, not the original authenticated user.
Starting in Impala 3.1 and higher, you can
delegate using groups. Instead of listing a large number of delegated users, you can
create a group of those users and specify the delegated group name in the
impalad
startup option. The client sends the delegated user name, and
Impala performs an authorization to see if the delegated user belongs to a delegated
group.
The name of the delegated user is passed using the HiveServer2 protocol configuration
property impala.doas.user
when the client connects to Impala.
Currently, the delegation feature is available only for Impala queries submitted through application interfaces such as Hue and BI tools. For example, Impala cannot issue queries using the privileges of the HDFS user.
The delegation feature is enabled by the startup options for impalad:
‑‑authorized_proxy_user_config
and
‑‑authorized_proxy_group_config
.
The syntax for the options are:
‑‑authorized_proxy_user_config=authenticated_user1=delegated_user1,delegated_user2,...;authenticated_user2=...
‑‑authorized_proxy_group_config=authenticated_user1=delegated_group1,delegated_group2,...;authenticated_user2=...
;
,
by default.
‑‑authorized_proxy_user_config_delimiter
startup
option to override the default user delimiter (the comma character) to another
character.
‑‑authorized_proxy_group_config_delimiter
startup
option to override the default group delimiter ( (the comma character) to another
character.
*
) is supported to delegated to any users or any groups, e.g.
‑‑authorized_proxy_group_config=hue=*
. Make sure to use
single quotes or escape characters to ensure that any *
characters do
not undergo wildcard expansion when specified in command-line arguments.
When you start Impala with the
‑‑authorized_proxy_user_config=authenticated_user=delegated_user
or
‑‑authorized_proxy_group_config=authenticated_user=delegated_group
option:
impala.doas.user
or
DelegationUID
.
When the client connects over HTTP, the doAs
parameter can be
specified in the HTTP path, e.g.
/?doAs=
delegated_user.
enable_shell_based_groups_mapping
needs to be enabled.
user()
returns authenticated_user and
effective_user()
returns the delegated user that the client specified.
impalad
daemon starts with one of the following options:
‑‑authorized_proxy_user_config=authenticated_user=delegated_user
‑‑authorized_proxy_group_config=authenticated_user=delegated_group
impala.doas.user
configuration property, e.g. connected user is
authenticated_user with
impala.doas.user=delegated_user
.
See Modifying Impala Startup Options for details about adding or changing impalad startup options.
See this blog post for background information about the delegation capability in HiveServer2.
To set up authentication for the delegated users:
On the server side, configure either user/password authentication through LDAP, or Kerberos authentication, for all the delegated users. See Enabling LDAP Authentication for Impala or Enabling Kerberos Authentication for Impala for details.
On the client side, to learn how to enable delegation, consult the documentation for the ODBC driver you are using.