Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use Ranger to desensitize columns in Hive using custom UDF in Kerberos environment

Shulou Source: shulou.com Published: 2022-06-01 15:44:48 10月02日 Update

How to use Ranger to desensitize columns in Hive in Kerberos environment, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, people who have this need can learn, I hope you can gain something.

Here's how to configure Hive column desensitization using custom UDFs in Ranger.

test environment

1. Redhat 7.6

2.CDP DC7.0.3

3. Cluster Kerberos enabled

4. Operation with root user

Desensitization using custom UDFs

2.1 Grant permissions on tables to users

1. Create a policy in Ranger and grant select permission to the test user on t1 table under ranger_test library

2. Query t1 table with test user

Currently user ranger_user1 has select permissions on table t1

2.2 Granting UDF permissions to users

1. Upload the jar package of custom UDF to the server and upload it to HDFS. The role of this custom UDF function is to convert the numbers 1-9 according to a-j.

2. Creating UDF Functions with hive Users

3. Testing the use of UDF functions

4. Log in to Hive with test user and use UDF function, prompt no permissions

5. Create a policy granting test users permission to use the UDF function

6. Verify again with test user, success with UDF function

2.3 Configure column desensitization using custom UDFs

1. Configure desensitization policies to desensitize phone columns using custom UDFs

2. Use ranger_user1 to view the t1 table

As can be seen from the above figure, custom UDF desensitization succeeded.

1. For any UDF function available, you can configure it in a custom way when configuring a desensitization policy, and then specify users/user groups to desensitize.

2. Before creating a desensitization policy, you need to ensure that the corresponding user/user group already has permissions on tables and UDF functions, otherwise the desensitization policy will not grant users/user groups permissions on tables and UDF functions by default.

3. When configuring desensitization policy, select Custom and fill in the UDF function usage mode in the input box, for example: function_name(arg)

Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.

Tags: User desensitization function permission policy test configuration method user group environment success help clarity operating system figure above function content again for this number Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi NVidia Redmi macOS Microsoft