[ad_1]
Cloudera Knowledge Platform (CDP) helps entry controls on tables and columns, in addition to on recordsdata and directories through Apache Ranger since its first launch. It’s common to have totally different workloads utilizing the identical knowledge – some require authorizations on the desk degree (Apache Hive queries) and others on the underlying recordsdata (Apache Spark jobs). Sadly, in such situations you would need to create and keep separate Ranger insurance policies for each Hive and HDFS, that correspond to one another.
Consequently, each time a change is made on a Hive desk coverage, the info admin ought to make a constant change within the corresponding HDFS coverage. Failure to take action might end in safety and/or knowledge publicity points. Ideally the info admin would set a single desk coverage, and the corresponding file entry insurance policies would routinely be saved in sync together with entry audits, referring to the desk coverage that enforced it.
On this weblog submit I’ll introduce a brand new characteristic that gives this habits referred to as the Ranger Useful resource Mapping Service (RMS). The RMS was included in CDP Personal Cloud Base 7.1.4 as tech preview and have become GA in CDP Personal Cloud Base 7.1.5.
What’s Ranger RMS?
In a nutshell, Ranger RMS permits automated translation of entry insurance policies from Hive to HDFS, lowering the operational burden of coverage administration. In easy phrases, which means any person with entry permissions on a Hive desk routinely receives comparable HDFS file degree entry permissions on the desk’s knowledge recordsdata. So, Ranger RMS lets you authorize entry to HDFS directories and recordsdata utilizing insurance policies outlined for Hive tables. Any entry authorization materialized by means of Ranger RMS is totally audited and could be current in Ranger Audit logs.
How does it assist?
The performance offered by Ranger RMS may be very helpful for the utilization of exterior desk knowledge by non-Hive workloads similar to Spark. Allow us to take into account the customers who’re at present on the totally different variations of the Cloudera product stack to grasp how this characteristic would profit them.
- CDH – Within the CDH stack, Apache Sentry managed authorizations for Hive/Impala tables. Sentry has a characteristic referred to as HDFS ACL Sync, which would supply the same performance. Sentry makes use of HDFS ACLs to supply entry to customers on HDFS recordsdata of Hive tables. The implementation of HDFS ACL Sync in Sentry may be very totally different from how Ranger RMS handles automated translations of entry insurance policies from Hive to HDFS. However the underlying idea and the outcomes are the identical for table-level entry.
- HDP – Within the HDP stack, if direct HDFS entry is required on Hive desk areas, storage entry insurance policies would should be created manually. These could be completed by means of both HDFS insurance policies in Ranger or through setting POSIX permissions or HDFS ACLs on the recordsdata and directories. Primarily, two totally different Hive and HDFS insurance policies have been managed and manually saved in sync for all such tables.
- CDP (previous to CDP Personal Cloud Base 7.1.4) – Direct HDFS entry to Hive desk areas was dealt with in CDP utilizing manually created storage entry insurance policies both by means of HDFS insurance policies or utilizing different choices like POSIX permissions or HDFS ACLs. Once more, two totally different insurance policies needed to be at all times created and saved in sync for all such tables.
With the introduction of Ranger RMS in CDP Personal Cloud Base 7.1.4, Ranger offers an equal performance because the Sentry HDFS ACL sync in CDH. Customers upgrading or migrating from CDH to the most recent model of CDP shouldn’t fear about shedding this necessary functionality. Moreover, for HDP customers upgrading or migrating to the most recent model of CDP, Ranger RMS removes the necessity for individually managed storage insurance policies on Hive desk areas. This implies many manually carried out Ranger HDFS insurance policies, Hadoop ACLs, or POSIX permissions created solely for this goal can now be eliminated, if desired. This eases the operational upkeep requirement for insurance policies and reduces the prospect of errors that may occur throughout the handbook steps carried out by an information steward or admin.
What does it do?
As instructed, Ranger RMS internally interprets the Hive insurance policies into HDFS entry guidelines and permits the HDFS NameNode to implement them. Although it appears direct and easy, the automated translation of entry considers a number of components earlier than granting any person the HDFS file degree entry. Ranger RMS doesn’t create specific HDFS insurance policies in Ranger, nor does it change the HDFS ACLs offered to customers (as Apache Sentry does for ‘hdfs dfs -ls’ command). As a substitute, it generates a mapping that permits the Ranger Plugin in HDFS to make run-time selections primarily based on the Hadoop SQL grants.
The image beneath reveals the interactions between NameNode, Ranger Admin, Hive Metastore and Ranger RMS.

Every time Ranger RMS begins, it connects to the Hive Metastore (HMS) and performs a sync that generates a useful resource mapping file linking Hive sources to their storage areas on HDFS. This mapping file is saved domestically in a storage cache inside RMS. It’s also endured in RMS particular tables within the backend database utilized by the Ranger service. After startup, Ranger RMS periodically updates this map, querying HMS each 30 seconds for brand spanking new mapping updates through Hive notifications. This polling frequency is configurable utilizing the “ranger-rms.polling.notifications.frequence.ms” setting.
If no sync checkpoint exists or it’s not acknowledged by HMS, then a full sync is finished. For instance, clearing the Ranger RMS mapping within the backend database could also be required when particular configuration modifications are made. Such an motion clears the sync checkpoint and causes a full resync to happen the following time RMS is restarted. The synchronization course of queries HMS to assemble Hive object metadata, similar to database identify and desk identify to map to the underlying file paths in HDFS.
On the HDFS aspect, the Ranger HDFS plugin operating within the NameNode now has an extra HivePolicyEnforcer module. Along with downloading the HDFS insurance policies from Ranger Admin, this enhanced HDFS plugin additionally downloads Hive insurance policies from Ranger Admin, together with the mapping file from Ranger RMS. HDFS entry is then decided by each HDFS insurance policies and Hive insurance policies.
Through the analysis of entry necessities for HDFS recordsdata, any HDFS insurance policies from Ranger are utilized first. It’s then checked to see if the HDFS useful resource has an entry within the useful resource mapping file offered by RMS. Subsequent the corresponding Hive useful resource is computed from the mapping after which Hive insurance policies current in Ranger are utilized. Lastly relying on the varied configurations, the composite analysis result’s computed.
Coverage Analysis Stream with Ranger RMS
The next circulate diagram depicts the coverage analysis course of when Ranger RMS is concerned. You will need to notice that even when you have Ranger RMS enabled, manually created HDFS insurance policies can have precedence and may override RMS coverage habits.

What about Managed Tables, can it assist?
Tlisted below are two forms of Hive tables in CDP – Managed Tables and Exterior Tables. An in depth rationalization of those differing types could be present in the official documentation for Hive. Whereas the first use case for Ranger RMS is to simplify Exterior desk coverage administration, there are particular situations the place you could have to allow this on Managed tables.
Spark Direct Reader mode in Hive Warehouse Connector can learn Hive transactional tables immediately from the filesystem. That is one particular use-case the place enabling RMS for Hive Managed Tables could be useful. The person launching such a Spark utility should have learn and execute permissions on the Hive warehouse location. In case your setting has many purposes utilizing Spark direct reader to eat Hive transactional desk knowledge inside a Spark utility, you possibly can take into account enabling Ranger RMS for Hive Managed Tables. Aside from this use-case, the advice is to not open up the Hive warehouse location for Managed Tables by means of RMS for safety causes. Please examine your use-cases correctly particularly for Hive Managed Tables earlier than enabling Ranger RMS for Managed Tables. This characteristic might not be fascinating in lots of eventualities the place Hive Managed Tables location ought to be locked down utterly.
A very powerful level for Ranger RMS on a Managed Desk is the placement. It ought to be famous that the placement for such Managed Tables can solely be the managed area of the database through which they’re created. If a location will not be outlined on the database degree, then it defaults to the worth of “hive.metastore.warehouse.dir”.
Ranger RMS does present an choice to map managed tables as specified beneath.
- RMS at present has a checkbox configuration to “Allow Mapping Hive Managed Tables”
- This configuration, if enabled, offers the HDFS entry to managed tables’ recordsdata primarily based on the insurance policies in Ranger Hadoop SQL.
- This configuration is anticipated to be enabled solely throughout the preliminary set up and configuration of Ranger RMS.

If this configuration will not be enabled in Ranger RMS, then the default Hive managed area could be locked all the way down to the person and group for “hive”. In such a case, customers belonging to every other teams wouldn’t have any entry to the default hive managed location in HDFS.
Although Ranger RMS offers an choice to map Hive Managed Tables, it must be understood that enabling this characteristic for Managed Tables offers customers who’ve SQL degree entry on such tables with direct learn entry on the corresponding tables’ HDFS recordsdata. The next ought to be famous when enabling this characteristic in RMS. Customers with replace permission on Managed Tables in Hadoop SQL would have the ability to replace desk knowledge by means of SQL. However RMS wouldn’t present customers with direct write entry on the managed HDFS location even when they’ve replace permission in Hadoop SQL.
Direct HDFS Entry on Hive Desk Knowledge Utilizing Ranger RMS
If Ranger RMS is put in and configured in a CDP setting the next particulars present high-level entry necessities for performing learn/write on Hive tables’ corresponding HDFS recordsdata.
- If the configuration for “Mapping Hive Managed Tables” will not be enabled in Ranger RMS, the person entry to HDFS recordsdata for Managed Tables depend upon the kind of databases
- No person would have the ability to entry the underlying HDFS recordsdata for Managed Tables current in databases created with none “managedlocation” clause
- Customers can have entry to the underlying HDFS recordsdata for Managed Tables current in databases created utilizing a non-default “managedlocation” clause primarily based on the HDFS POSIX permissions or HDFS ACLs of these directories
- If the configuration for “Mapping Hive Managed Tables” is enabled in Ranger RMS, then customers are allowed to entry the underlying HDFS recordsdata for Managed Tables
- Any person who created a Managed Desk (proprietor) would have the ability to immediately entry the corresponding HDFS recordsdata for the desk
- Any person with choose/replace privilege on all columns in a Managed Desk could be have learn entry to the corresponding HDFS recordsdata for the desk
- For Exterior Tables, primarily based on the choose/replace permissions customers are allowed to entry the corresponding HDFS recordsdata for the tables
- Any person who created an Exterior Desk (proprietor) would have the ability to immediately entry the corresponding HDFS recordsdata for the desk
- Any person with choose/replace privilege on all columns in an Exterior Desk would have the ability to immediately entry the corresponding HDFS recordsdata for the desk
- Any person with entry to solely a particular set of columns in a desk wouldn’t have the ability to immediately entry the corresponding HDFS recordsdata for the desk
- Any person given entry to all columns in a desk particularly by including column names and never by “*” within the columns dropdown in Hadoop SQL wouldn’t have the ability to immediately entry the corresponding HDFS recordsdata for the desk
- Any person with entry to columns which have masking insurance policies outlined on them wouldn’t have the ability to immediately entry the corresponding HDFS recordsdata for the desk
- Any person with entry to columns which have row filtering insurance policies outlined on them wouldn’t have the ability to immediately entry the corresponding HDFS recordsdata for the desk
Abstract
Ranger RMS provides a key functionality that enhances the safety design of CDP clusters. By offering an automated methodology to make use of Hive insurance policies to entry the corresponding tables’ HDFS knowledge immediately, it not solely brings in an necessary characteristic to the Ranger knowledge safety framework, but additionally reduces the coverage administration overhead significantly.
To be taught extra about Ranger RMS and associated options, listed below are some useful sources:
Putting in Ranger RMS
Ranger Hive-HDFS ACL Sync Overview
CDP Information Hub
[ad_2]
