You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/hdinsight/spark/ranger-policies-for-spark.md
+16-9Lines changed: 16 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Configure Apache Ranger policies for Spark SQL in HDInsight with Enterpri
3
3
description: This article describes how to configure Ranger policies for Spark SQL with Enterprise Security Package.
4
4
ms.service: hdinsight-aks
5
5
ms.topic: how-to
6
-
ms.date: 02/12/2024
6
+
ms.date: 03/07/2024
7
7
---
8
8
9
9
# Configure Apache Ranger policies for Spark SQL in HDInsight with Enterprise Security Package
@@ -32,7 +32,7 @@ In this article, you learn how to:
32
32
33
33
## Create domain users
34
34
35
-
For information on how to create **sparkuser** domain users, see [Create an HDInsight cluster with ESP](../domain-joined/apache-domain-joined-configure-using-azure-adds.md#create-an-hdinsight-cluster-with-esp). In a production scenario, domain users come from your Microsoft Entra tenant.
35
+
For information on how to create `sparkuser` domain users, see [Create an HDInsight cluster with ESP](../domain-joined/apache-domain-joined-configure-using-azure-adds.md#create-an-hdinsight-cluster-with-esp). In a production scenario, domain users come from your Microsoft Entra tenant.
36
36
37
37
## Create a Ranger policy
38
38
@@ -61,7 +61,7 @@ In this section, you create two Ranger policies:
61
61
| database | default |
62
62
| table | hivesampletable |
63
63
| column | * |
64
-
| Select User | sparkuser |
64
+
| Select User |`sparkuser`|
65
65
| Permissions | select |
66
66
67
67
:::image type="content" source="./media/ranger-policies-for-spark/sample-policy-details.png" alt-text="Screenshot that shows sample details for an access policy." lightbox="./media/ranger-policies-for-spark/sample-policy-details.png":::
@@ -101,7 +101,7 @@ The following example shows how to create a policy to mask a column:
101
101
|Hive Database|default|
102
102
|Hive Table| hivesampletable|
103
103
|Hive Column|devicemake|
104
-
|Select User|sparkuser|
104
+
|Select User|`sparkuser`|
105
105
|Access Types|select|
106
106
|Select Masking Option|Hash|
107
107
@@ -145,7 +145,7 @@ Consider these points:
145
145
In such cases, we recommend that you either:
146
146
147
147
- Use the Hive catalog for both Hive and Spark.
148
-
- Maintain different database, table, and column names for both Hive and Spark catalogs so that the policies are not applied to databases across catalogs.
148
+
- Maintain different database, table, and column names for both Hive and Spark catalogs so that the policies aren't applied to databases across catalogs.
149
149
150
150
- If you use the Hive catalog for both Hive and Spark, consider the following example.
151
151
@@ -174,9 +174,9 @@ Let's say that you have the policies defined in the Ranger repo already under th
You can also open this configuration in **/etc/spark3/conf** by using SSH.
177
+
or You can also open this configuration in **/etc/spark3/conf** by using SSH.
178
178
179
-
1. Edit two configurations (**ranger.plugin.spark.service.name** and **ranger.plugin.spark.policy.cache.dir**) to point to the old policy repo **oldclustername_hive**, and then save the configurations.
179
+
Edit two configurations (**ranger.plugin.spark.service.name** and **ranger.plugin.spark.policy.cache.dir**) to point to the old policy repo **oldclustername_hive**, and then save the configurations.
180
180
181
181
Ambari:
182
182
@@ -188,6 +188,14 @@ Let's say that you have the policies defined in the Ranger repo already under th
188
188
189
189
1. Restart the Ranger and Spark services from Ambari.
190
190
191
+
1. Open the Ranger admin UI and click on edit button under **HADOOP SQL** service.
192
+
193
+
:::image type="content" source="./media/ranger-policies-for-spark/ranger-service-edit.png" alt-text="Screenshot that shows edit option for ranger service." lightbox="./media/ranger-policies-for-spark/ranger-service-edit.png":::
194
+
195
+
1. For **oldclustername_hive** service, add **rangersparklookup** user in the **policy.download.auth.users** and **tag.download.auth.users** list and click save.
196
+
197
+
:::image type="content" source="./media/ranger-policies-for-spark/add-new-user-ranger-lookup.png" alt-text="Screenshot that shows how to add user in Ranger service." lightbox="./media/ranger-policies-for-spark/add-new-user-ranger-lookup.png":::
198
+
191
199
The policies are applied on databases in the Spark catalog. If you want to access the databases in the Hive catalog:
192
200
193
201
1. In Ambari, go to **Spark3** > **Configs**.
@@ -198,5 +206,4 @@ The policies are applied on databases in the Spark catalog. If you want to acces
198
206
## Known issues
199
207
200
208
- Apache Ranger integration with Spark SQL doesn't work if the Ranger admin is down.
201
-
- The Ranger database can be overloaded if more than 20 Spark sessions are started concurrently because of continuous policy pulls.
202
-
- In Ranger audit logs, when you hover over the **Resource** column, it doesn't show the entire query that you ran.
209
+
- In Ranger audit logs, when you hover over the **Resource** column, it can't show the entire query that you ran.
0 commit comments