Pre-requisites Warning |
---|
Before you begin, please verify that your enterprise has deployed both Hive and Ranger according to recommended configuration practices. For more information, please consult the documentation that was provided with your Hadoop distribution. | and Hive with RangerSecure impersonation ensures consistent and easily traceable security access to the data stored within your Hadoop cluster. Info |
---|
NOTE: Although not required, secure impersonation is highly recommended for connecting the platform with Hive. |
Since secure impersonation for the combination of HiveServer2 and Ranger is not supported by Ranger, you must apply the following additional configuration changes to the to enable secure impersonation in the environment:- Enable the platform with secure impersonation. See Configure for Secure Impersonation for details.
- Add the hive service user
hive to the Unix or LDAP group . Set the following parameter:
Code Block |
---|
"hdfs.permissions.userUmask" = 027 |
- Ensure that the Unix or LDAP group has read access to the Hive warehouse directory, as described in the following section. For more information, see http://hortonworks.com/blog/best-practices-for-hive-authorization-using-apache-ranger-in-hdp-2-2/.
When the is enabled with secure impersonation and submits requests to Hive, the following steps occur:- The platform authenticates as the user through Kerberos.
The Hive server authorizes access to the underlying table through Ranger as the Hadoop principal user assigned to . Info |
---|
NOTE: This Hadoop principal is the user that should be configured through policies in Ranger to have the appropriate privileges. |
- The Hive server executes access to the physical data file on HDFS as the Unix user
hive , which should be part of the group .
Info |
---|
NOTE: Since Ranger assigns access to databases, tables, and columns to Unix users and groups, a common practice is to assign the Hadoop principal users (used by ) to dedicated Unix groups that are separate from the Unix group use within Ranger. Ranger should not grant any privileges and roles to the Unix group . |
Info |
---|
NOTE: In UNIX environments, usernames and group names are case-sensitive. Please verify that you are using the case-sensitive names for users and groups in your Hadoop configuration and . |
In Ranger, you can configure access through policies. A Ranger policy is a combination of: - Specified database, table, or tabled column
- Permissions associated with that specified object.
- Assignment of permissions to individual users or groups
Info |
---|
NOTE: In general, to manage access through Ranger, permissions to underlying Hadoop components such as HDFS or Hive should be minimized within those components. All permissions in Ranger are additive, which means that you should be careful about overlapping users and groups. |
The following components require these permissions at a minimum to be assigned to the Hadoop principal: Component | Permissions |
---|
HDFS | Read, Write, Execute | Hive | Select, Update. Create (for Hive publishing) | Info |
---|
NOTE: The following configuration is required for integration of HDP with Hive publishing when Ranger is enabled. |
- In the Ambari console, navigate to the following: HDFS > Configs > Advanced > Advanced ranger-hdfs-plugin-properties.
Set the following to true : Enable Ranger for HDFS. From the left nav bar, navigate to the following: Ranger > Configs > Ranger Plugin tab. Set the following to true : Hive Ranger Plugin. - Please verify that the other Ambari properties are set to integrate Hive through Ranger. For more information, see the HDP documentation.
- Restart the HDP cluster.
- Open Ranger.
In the policies area, create the following two policies:
Code Block |
---|
trifacta_policies
hive_warehouse |
- Set the following properties on these policies:
- Policy Type:
Access - Enabled:
true - Resource path:
For trifacta_policies , set this value to either of the following values:
Code Block |
---|
/trifacta
/trifacta/queryResults |
For hive_warehouse , set this value to the location of the Hive warehouse. The following is the default value:
Code Block |
---|
/user/hive/warehouse |
Recursive: true Info |
---|
NOTE: Policies must be recursive. |
Audit Logging: yes Allow conditions: Select group: Hadoop , Trifacta Select user: Trifacta Permissions: Read , Write , Execute
Save the policies.
|